List of usage examples for com.google.gwt.user.client.ui Tree setAnimationEnabled
@Override
public void setAnimationEnabled(boolean enable)
From source file:com.controlj.addon.gwttree.client.TreeManager.java
License:Open Source License
private Tree createStaticTree(TreeEntry root) { Tree staticTree = new Tree(); staticTree.setAnimationEnabled(true); staticTree.addItem(createTreeItemAndChildren(root)); return staticTree; }
From source file:com.controlj.addon.gwttree.client.TreeManager.java
License:Open Source License
private Tree createDynamicTree(TreeEntry root) { Tree dynamicTree = new Tree(); dynamicTree.setAnimationEnabled(true); dynamicTree.addItem(createDynamicTreeItem(root)); // Add a handler to get the next set of children dynamicTree.addOpenHandler(new OpenHandler<TreeItem>() { @Override/*from ww w.j a v a2 s . co m*/ public void onOpen(OpenEvent<TreeItem> event) { TreeEntry entry = (TreeEntry) event.getTarget().getUserObject(); requestDynamicTreeChildren(event.getTarget(), entry); } }); return dynamicTree; }
From source file:com.google.gwt.sample.showcase.client.content.lists.CwTree.java
License:Apache License
/** * Initialize this example.//from w w w . j a v a 2 s . c o m */ @ShowcaseSource @Override public Widget onInitialize() { // Create a static tree and a container to hold it Tree staticTree = createStaticTree(); staticTree.setAnimationEnabled(true); staticTree.ensureDebugId("cwTree-staticTree"); ScrollPanel staticTreeWrapper = new ScrollPanel(staticTree); staticTreeWrapper.ensureDebugId("cwTree-staticTree-Wrapper"); staticTreeWrapper.setSize("300px", "300px"); // Wrap the static tree in a DecoratorPanel DecoratorPanel staticDecorator = new DecoratorPanel(); staticDecorator.setWidget(staticTreeWrapper); // Create a dynamically generated tree and a container to hold it final Tree dynamicTree = createDynamicTree(); dynamicTree.ensureDebugId("cwTree-dynamicTree"); ScrollPanel dynamicTreeWrapper = new ScrollPanel(dynamicTree); dynamicTreeWrapper.ensureDebugId("cwTree-dynamicTree-Wrapper"); dynamicTreeWrapper.setSize("300px", "300px"); // Wrap the dynamic tree in a DecoratorPanel DecoratorPanel dynamicDecorator = new DecoratorPanel(); dynamicDecorator.setWidget(dynamicTreeWrapper); // Combine trees onto the page Grid grid = new Grid(2, 3); grid.setCellPadding(2); grid.getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_TOP); grid.setHTML(0, 0, constants.cwTreeStaticLabel()); grid.setHTML(0, 1, " "); grid.setHTML(0, 2, constants.cwTreeDynamicLabel()); grid.setWidget(1, 0, staticDecorator); grid.setHTML(1, 1, " "); grid.setWidget(1, 2, dynamicDecorator); // Wrap the trees in DecoratorPanels return grid; }
From source file:com.googlecode.hmvc4gwt.example.hmvcblog.frontend.blog.client.blog.blogentry.comment.BlogEntryCommentController.java
License:Apache License
public void initView() { Tree treeBlogEntryComment = new Tree(); treeBlogEntryComment.setAnimationEnabled(true); treeBlogEntryComment.setTitle("Show labelComments"); getView().setTreeBlogEntryComment(treeBlogEntryComment); Button buttonAddComment = new Button(I18N.constants.buttonAddBlogEntryComment()); getView().setButtonAddComment(buttonAddComment); buttonAddComment.addClickListener(new ClickListener() { public void onClick(Widget sender) { addComment();// w w w . j a v a 2s . co m } }); TreeItem treeItemButton = new TreeItem(buttonAddComment); treeBlogEntryComment.addItem(treeItemButton); }
From source file:com.ponysdk.ui.terminal.ui.PTTree.java
License:Apache License
@Override public void create(final PTInstruction create, final UIService uiService) { final Tree tree = new Tree(); tree.setAnimationEnabled(true); init(create, uiService, tree);//from w w w . ja v a2 s . c om }
From source file:com.qualogy.qafe.gwt.client.ui.renderer.TreeRenderer.java
License:Apache License
public UIObject render(ComponentGVO component, String uuid, String parent, String context) { Tree uiObject = null; if (component != null) { if (component instanceof TreeGVO) { TreeGVO gvo = (TreeGVO) component; QTreeItem rootItem = new QTreeItem(gvo.getDisplayname()); if (gvo.getMenu() != null) { final ComponentGVO finalComponentGVO = component; final String finalUuid = uuid; final String finalParent = parent; uiObject = new QTree(rootItem, hasDisplayName(gvo)) { @Override/*from ww w. j a v a 2 s. com*/ public void onBrowserEvent(Event event) { if (event.getTypeInt() == Event.ONCONTEXTMENU) { DOM.eventPreventDefault(event); applyContextMenu(event, finalComponentGVO, finalUuid, finalParent); } super.onBrowserEvent(event); } @Override protected void setElement(Element elem) { super.setElement(elem); sinkEvents(Event.ONCONTEXTMENU); } }; } else { uiObject = new QTree(rootItem, hasDisplayName(gvo)); } uiObject.setAnimationEnabled(true); Label rootItemLabel = rootItem.getLabel(); fillInRootItemLabel(uuid, parent, context, uiObject, gvo, rootItemLabel); if (gvo.getChildren() != null) { for (TreeItemGVO mainItemGVO : gvo.getChildren()) { String label = mainItemGVO.getDisplayname(); processMainItem(uuid, parent, context, (QTree) uiObject, mainItemGVO, mainItemGVO.getChildren(), label); } } RendererHelper.fillIn(gvo, uiObject, uuid, parent, context); } } return uiObject; }
From source file:com.qualogy.qafe.mgwt.client.ui.renderer.TreeRenderer.java
License:Apache License
public UIObject render(ComponentGVO component, String owner, String uuid, String parent, String context, AbstractActivity activity) {//ww w .ja v a 2s . c o m Tree uiObject = null; if (component != null) { if (component instanceof TreeGVO) { TreeGVO gvo = (TreeGVO) component; // QTreeItem rootItem = new QTreeItem(gvo.getDisplayname()); // if (gvo.getMenu() != null) { // final ComponentGVO finalComponentGVO = component; // final String finalUuid = uuid; // final String finalParent = parent; // uiObject = new QTree(rootItem, hasDisplayName(gvo)) { // @Override // public void onBrowserEvent(Event event) { // if (event.getTypeInt() == Event.ONCONTEXTMENU) { // DOM.eventPreventDefault(event); // applyContextMenu(event, finalComponentGVO, finalUuid, finalParent); // } // super.onBrowserEvent(event); // } // // @Override // protected void setElement(Element elem) { // super.setElement(elem); // sinkEvents(Event.ONCONTEXTMENU); // } // }; // } else { // uiObject = new QTree(rootItem, hasDisplayName(gvo)); // } uiObject.setAnimationEnabled(true); // Label rootItemLabel = rootItem.getLabel(); // fillInRootItemLabel(uuid, parent, context, uiObject, gvo, rootItemLabel); // // if (gvo.getChildren() != null) { // for (TreeItemGVO mainItemGVO : gvo.getChildren()) { // String label = mainItemGVO.getDisplayname(); // processMainItem(uuid, parent, context, (QTree)uiObject, mainItemGVO, mainItemGVO.getChildren(), label); // } // } RendererHelper.fillIn(gvo, uiObject, uuid, parent, context); } } return uiObject; }
From source file:gwtquery.plugins.enhance.client.EnhanceGwtSample.java
License:Apache License
private void displayWidgetHierarchy() { DisclosurePanel disclosurePanel = $("#disclosure").widget(); Tree widgetHierarchy = new Tree(); TreeItem rootItem = new TreeItem(SafeHtmlUtils.fromString(disclosurePanel.getClass().getName())); widgetHierarchy.addItem(rootItem);/*ww w .j av a 2 s. c om*/ widgetHierarchy.setAnimationEnabled(true); addChildren(rootItem, disclosurePanel); RootPanel.get().add(new Label("Widgets hierarchy :")); RootPanel.get().add(widgetHierarchy); }
From source file:net.s17fabu.vip.gwt.showcase.client.content.lists.CwTree.java
License:Apache License
/** * Initialize this example.//from w w w .j av a 2 s.c o m */ @Override public Widget onInitialize() { // Create a static tree and a container to hold it Tree staticTree = createStaticTree(); staticTree.setAnimationEnabled(true); staticTree.ensureDebugId("cwTree-staticTree"); ScrollPanel staticTreeWrapper = new ScrollPanel(staticTree); staticTreeWrapper.ensureDebugId("cwTree-staticTree-Wrapper"); staticTreeWrapper.setSize("300px", "300px"); // Wrap the static tree in a DecoratorPanel DecoratorPanel staticDecorator = new DecoratorPanel(); staticDecorator.setWidget(staticTreeWrapper); // Create a dynamically generated tree and a container to hold it final Tree dynamicTree = createDynamicTree(); dynamicTree.ensureDebugId("cwTree-dynamicTree"); ScrollPanel dynamicTreeWrapper = new ScrollPanel(dynamicTree); dynamicTreeWrapper.ensureDebugId("cwTree-dynamicTree-Wrapper"); dynamicTreeWrapper.setSize("300px", "300px"); // Wrap the dynamic tree in a DecoratorPanel DecoratorPanel dynamicDecorator = new DecoratorPanel(); dynamicDecorator.setWidget(dynamicTreeWrapper); // Combine trees onto the page Grid grid = new Grid(2, 3); grid.setCellPadding(2); grid.getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_TOP); grid.setHTML(0, 0, constants.cwTreeStaticLabel()); grid.setHTML(0, 1, " "); grid.setHTML(0, 2, constants.cwTreeDynamicLabel()); grid.setWidget(1, 0, staticDecorator); grid.setHTML(1, 1, " "); grid.setWidget(1, 2, dynamicDecorator); // Wrap the trees in DecoratorPanels return grid; }
From source file:org.apache.solr.explorer.client.plugin.debug.ui.DebugConsoleTab.java
License:Apache License
public DebugConsoleTab() { FlowPanel main = new FlowPanel(); BasicTable table = new BasicTable(); table.setHeaderHTML(0, "Name"); table.setHeaderHTML(1, "Value"); table.setText(0, 0, "Raw Query"); table.setWidet(0, 1, rawQueryStringLabel = new Label()); table.setText(1, 0, "Query"); table.setWidet(1, 1, queryStringLabel = new Label()); table.setText(2, 0, "Parsed Query"); table.setWidet(2, 1, parsedQueryStringLabel = new Label()); table.setText(3, 0, "Parsed Query (ToString)"); table.setWidet(3, 1, parsedQueryStringToStringLabel = new Label()); table.setText(4, 0, "Query Parser"); table.setWidet(4, 1, qParserLabel = new Label()); table.getColumnFormatter().setWidth(0, "200px"); table.getCellFormatter().setStyleName(0, 0, "PropertiesTableNameCell"); table.getCellFormatter().setStyleName(1, 0, "PropertiesTableNameCell"); table.getCellFormatter().setStyleName(2, 0, "PropertiesTableNameCell"); table.getCellFormatter().setStyleName(3, 0, "PropertiesTableNameCell"); table.getCellFormatter().setStyleName(4, 0, "PropertiesTableNameCell"); main.add(table);/* ww w.j a va 2 s . c om*/ HTML gap = new HTML(); gap.setSize("10px", "10px"); main.add(gap); timingRootLabel = new HTML(); TreeItem root = new TreeItem(timingRootLabel); prepareItem = new TreeItem("Prepare"); root.addItem(prepareItem); processItem = new TreeItem("Process"); root.addItem(processItem); Tree tree = new Tree(); tree.setAnimationEnabled(true); tree.addItem(root); main.add(tree); gap = new HTML(); gap.setSize("10px", "10px"); main.add(gap); ScrollPanel sp = new ScrollPanel(main); sp.setSize("100%", "100%"); initWidget(sp); }