Add the following entry to you projects module xml file.
<inherits name='com.extjs.gxt.ui.GXT'/>
Add the following stylesheet to your host page.
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
Ext GWT requires no doctype or the following doctype (quirksmode).
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Eclipse Setup (should be similiar for other development enviornments) These instructions assume you have a existing project and launch confifuration.
Place only the following code snippet within the onModuleLoad in a GWT application:
public void onModuleLoad() {
ContentPanel cp = new ContentPanel();
cp.setHeading("Folder Contents");
cp.setSize(250,140);
cp.setPosition(10, 10);
cp.setCollapsible(true);
cp.setFrame(true);
cp.setBodyStyle("backgroundColor: white;");
cp.getHeader().addTool(new ToolButton("x-tool-gear"));
cp.getHeader().addTool(new ToolButton("x-tool-close"));
cp.addText(getBogusText());
cp.addButton(new Button("Ok"));
cp.setIconStyle("tree-folder-open");
RootPanel.get().add(cp);
cp.layout();
}
Use TreeStore.add(M parent, M item, boolean addChildren), TreeLoader.loadChildren(parent) or TreeLoader.load()
FormPanel has a FormLayout which only renders Fields. If you want to use other widgets, use AdapterField
Use TreeBinder.addSelectionChangedListener(..)
Just manually add the items, using TreeItem.add(TreeItem), starting with tree.getRootItem().
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Second, make sure no other stylesheets are loaded that might conflict with Ext GWT - ie only have css/ext-all.css
widget.sinkEvents(Event.ONCLICK);
widget.addListener(Events.OnClick, new Listener<DomEvent>() {
public void handleEvent(DomEvent be) {
System.out.println("Clicked!");
}
});
In some cases, you can add a selection listener to a widget instead of listening for mouse clicks.
event.doit=false;
Use the event.doit=false in a window listener and then add/remove that listener depending on the answer.
Yes you can.
Call layout() on the panel.
You can extend Component, BoxComponent for a sized component, Container for a "layouted" component when you don't want to expose the layout and LayoutContainer for a "layouted" component when you want to expose the layout.