Hello guys!
I have been trying to use the image component from
Incubator
with no success, the problem is I am getting the following error.
The type com.itmill.toolkit.ui.Embedded cannot be resolved. It is indirectly referenced from required .class files
I have the jar added to the build path.
Bellow is the code from the class I am trying to use the Image component.
import java.util.Map;
import javax.servlet.http.HttpSession;
import com.example.wabongosuomi.WabongosuomiApplication;
import com.example.wabongosuomi.utils.Utils;
import com.itmill.incubator.image.Image;
import com.vaadin.service.ApplicationContext;
import com.vaadin.terminal.FileResource;
import com.vaadin.terminal.gwt.server.WebApplicationContext;
import com.vaadin.ui.Button;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
@SuppressWarnings("serial")
public class MemberToolsPanel extends Panel implements Button.ClickListener{
private String username = "";
private java.io.File file;
private FileResource fileResource;
private Embedded embLogo;
public ApplicationContext ctx;
public WebApplicationContext webCtx;
public HttpSession session;
private Window main;
private Image image;
@SuppressWarnings("unchecked")
public MemberToolsPanel(WabongosuomiApplication app, Map params)
{
main = app.getMainWindow();
ctx = main.getApplication().getContext();
webCtx = (WebApplicationContext) ctx;
session = webCtx.getHttpSession();
username = (String)session.getAttribute("UserName");
setCaption("Home");
Label lb = new Label("This is the panel");
addComponent(lb);
setSizeFull();
setStyleName(Panel.STYLE_LIGHT);
int imageExists = Utils.checkFileExistance(Utils.imagePath()+"/images/Home_Thumb_"+username+".jpg");
if(imageExists == 1)
{
image = new Image(Utils.imagePath()+"/images/Home_Thumb_"+username+".jpg", true);
// file = new java.io.File(Utils.imagePath()+"/images/Home_Thumb_"+username+".jpg");
// fileResource = new FileResource(file, app.getMainWindow().getApplication());
// embLogo = new Embedded("",fileResource);
// embLogo.setWidth("300px");
// embLogo.setHeight("240px");
}
if(imageExists == 0)
{
image = new Image(Utils.imagePath()+"/images/Home_Thumb_default.jpg", true);
// file = new java.io.File(Utils.imagePath()+"/images/Home_Thumb_default.jpg");
// fileResource = new FileResource(file, app.getMainWindow().getApplication());
// embLogo = new Embedded("",fileResource);
}
image.fit(150,150,true);
image.roundCorners(5);
image.shadow(135, 5);
addComponent(image);
}
public void buttonClick(ClickEvent event) {
// TODO Auto-generated method stub
}
}
Thanks.