This the class that creates my ContentPanels (simple stuff, it's just a start)
Code:
public class PContentPanel extends ContentPanel {
public PContentPanel(int type,String id) {
super();
setId(id);
setHeading("ID : "+getId()+" - Type : "+type);
setIconStyle("icon-text");
setUrl("http://www.google.com");
setSize(200, 200);
this.setCollapsible(true);
Draggable d = new Draggable(this,getHeader());
d.setUseProxy(false);
if (getParent() instanceof Component) {
d.setContainer((Component)getParent());
}
new Resizable(this);
}
}
This is the code that adds PContentPanel to the TabItem in the TabPanel
Code:
contentPanel = new PContentPanel(eventType,this.getController().getControllerName());
//This a class that deals with actions of the main TabPanel (Strategy Pattern)
mainTabPanelActions = MainTabPanelActions.getInstance();
TabItem item = mainTabPanelActions.getActiveTabItem();
item.add(contentPanel);
item.layout();
Thanks a lot!