当前位置: 首页>>代码示例>>Java>>正文


Java Tree.addSelectionHandler方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Tree.addSelectionHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Tree.addSelectionHandler方法的具体用法?Java Tree.addSelectionHandler怎么用?Java Tree.addSelectionHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Tree的用法示例。


在下文中一共展示了Tree.addSelectionHandler方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onModuleLoad

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * This is the entry point method.
 */
public void onModuleLoad() {
  HorizontalPanel mainPanel = new HorizontalPanel();

  final MiddlePanel mPanel = new MiddlePanel();

  Tree menu = new Tree();
  menu.addSelectionHandler(new SelectionHandler<TreeItem>() {
    public void onSelection(SelectionEvent<TreeItem> event) {
      mPanel.set((MenuItem) event.getSelectedItem());
    }
  });

  initMenu(menu);
  mainPanel.add(menu);
  mainPanel.add(mPanel);
  menu.setSelectedItem(menu.getItem(0));
  mainPanel.setStyleName("mvp4gshowcase");
  RootPanel.get()
           .add(mainPanel);
}
 
开发者ID:mvp4g,项目名称:mvp4g-examples,代码行数:24,代码来源:Mvp4gShowCase.java

示例2: FolderSelectTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setStyleName("okm-TreeItem");
	rootItem.setUserObject(new GWTFolder());
	rootItem.setSelected(true);
	rootItem.setState(true);
	tree.setStyleName("okm-Tree");
	tree.addItem(rootItem);
	tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			boolean refresh = true;
			TreeItem item = event.getSelectedItem();

			// Case that not refreshing tree and file browser ( right click )
			if (actualItem.equals(item)) {
				refresh = false;
			} else {
				// Disables actual item because on changing active node by
				// application this it's not changed automatically
				if (!actualItem.equals(item)) {
					actualItem.setSelected(false);
					actualItem = item;
				} else {
					refresh = false;
				}
			}

			if (refresh) {
				refresh(true);
			}
		}
	});
	actualItem = tree.getItem(0);
	initWidget(tree);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:40,代码来源:FolderSelectTree.java

示例3: ExpressionView

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Instantiates a new expression view.
 */
public ExpressionView()
{
	super();
	setSpacing(5);

	Button btnRefresh = new Button("Refresh");
	btnRefresh.addClickHandler(new ClickHandler()
	{
		@Override
		public void onClick(ClickEvent event)
		{
			refreshButtonPressed();
		}
	});
	add(btnRefresh);

	HorizontalPanel horizontalPanel = new HorizontalPanel();
	horizontalPanel.setSpacing(10);
	add(horizontalPanel);
	horizontalPanel.setSize("517px", "279px");

	Tree tree = new Tree();
	tree.addSelectionHandler(this);
	horizontalPanel.add(tree);

	trtmByPerson = new TreeItem(SafeHtmlUtils.fromString("By Person"));
	tree.addItem(trtmByPerson);

	trtmByTable = new TreeItem(SafeHtmlUtils.fromString("By Table"));
	tree.addItem(trtmByTable);

	trtmByTarget = new TreeItem(SafeHtmlUtils.fromString("By Target"));
	tree.addItem(trtmByTarget);

	verticalPanel = new VerticalPanel();
	horizontalPanel.add(verticalPanel);
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:41,代码来源:ExpressionView.java

示例4: setTreeOfChanges

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void setTreeOfChanges(final RefactoringPreview changes) {
  showDiffPanel(false);

  final SelectionModel<RefactoringPreview> selectionModel = new SingleSelectionModel<>();
  selectionModel.addSelectionChangeHandler(
      event -> {
        RefactoringPreview selectedNode =
            (RefactoringPreview) ((SingleSelectionModel) selectionModel).getSelectedObject();
        delegate.onSelectionChanged(selectedNode);
      });

  Tree tree = new Tree();

  tree.getElement().setId("tree-of-changes");

  for (RefactoringPreview parentChange : changes.getChildrens()) {
    TreeItem treeItem = new TreeItem();
    containerChanges.put(treeItem, parentChange);
    createTreeElement(treeItem, parentChange.getText(), parentChange.getChildrens());
    tree.addItem(treeItem);
  }

  tree.addSelectionHandler(
      event -> {
        if (selectedElement != null) {
          selectedElement.getStyle().setProperty("background", "transparent");
        }

        selectedElement = event.getSelectedItem().getWidget().getElement();
        selectedElement.getStyle().setProperty("background", getEditorSelectionColor());
      });

  treePanel.add(tree);
}
 
开发者ID:eclipse,项目名称:che,代码行数:37,代码来源:PreviewViewImpl.java

示例5: initNavigationTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
private Tree initNavigationTree() {
    Tree navTree = new Tree();

    List<GalleryTreeNode> mainNodes = galleryTree.getMainNodes();
    populateNavigationTree(mainNodes, navTree);

    navTree.addSelectionHandler(new SelectionHandler<TreeItem>() {
        public void onSelection(SelectionEvent<TreeItem> event) {
            TreeItem ti = event.getSelectedItem();
            GalleryTreeNode node = (GalleryTreeNode) ti.getUserObject();
            treeItemClicked(ti, node);
        }
    });
    return navTree;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:16,代码来源:GalleryTreeViewImpl.java

示例6: FolderSelectTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setStyleName("okm-TreeItem");
	rootItem.setUserObject(new GWTFolder());
	rootItem.setSelected(true);
	rootItem.setState(true);
	tree.setStyleName("okm-Tree");
	tree.addItem(rootItem);
	tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			boolean refresh = true;
			TreeItem item = event.getSelectedItem();

			// Enables or disables move button ( evalues security to move to folder with permissions )
			if (rootItem.equals(item)) {
				Main.get().categoriesPopup.enable(false);
			} else {
				Main.get().categoriesPopup.enable(true);
			}

			// Case that not refreshing tree and file browser ( right click )
			if (actualItem.equals(item)) {
				refresh = false;
			} else {
				// Disables actual item because on changing active node by
				// application this it's not changed automatically
				if (!actualItem.equals(item)) {
					actualItem.setSelected(false);
					actualItem = item;
				} else {
					refresh = false;
				}
			}

			if (refresh) {
				refresh(true);
			}
		}
	});
	actualItem = tree.getItem(0);
	initWidget(tree);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:47,代码来源:FolderSelectTree.java

示例7: FolderSelectTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setStyleName("okm-TreeItem");
	rootItem.setUserObject(new GWTFolder());
	rootItem.setSelected(true);
	rootItem.setState(true);
	tree.setStyleName("okm-Tree");
	tree.addItem(rootItem);
	tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			boolean refresh = true;
			TreeItem item = event.getSelectedItem();

			// Enables or disables move button ( evalues security to move to folder with permissions )
			if (rootItem.equals(item)) {
				Main.get().wizardPopup.categoriesWidget.enable(false);
			} else {
				Main.get().wizardPopup.categoriesWidget.enable(true);
			}

			// Case that not refreshing tree and file browser ( right click )
			if (actualItem.equals(item)) {
				refresh = false;
			} else {
				// Disables actual item because on changing active node by
				// application this it's not changed automatically
				if (!actualItem.equals(item)) {
					actualItem.setSelected(false);
					actualItem = item;
				} else {
					refresh = false;
				}
			}

			if (refresh) {
				refresh(true);
			}
		}
	});
	actualItem = tree.getItem(0);
	initWidget(tree);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:47,代码来源:FolderSelectTree.java

示例8: FolderSelectTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setStyleName("okm-TreeItem");
	rootItem.setUserObject(new GWTFolder());
	rootItem.setSelected(true);
	rootItem.setState(true);
	tree.setStyleName("okm-Tree");
	tree.addItem(rootItem);
	tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			boolean refresh = true;
			TreeItem item = event.getSelectedItem();

			// Case that not refreshing tree and file browser ( right click )
			if (actualItem.equals(item)) {
				refresh = false;
			} else {
				// Disables actual item because on changing active node by
				// application this it's not changed automatically
				if (!actualItem.equals(item)) {
					actualItem.setSelected(false);
					actualItem = item;
				} else {
					refresh = false;
				}
			}

			// Enables or disables move button ( evalues security to move to folder with permissions )
			if (rootItem.equals(actualItem)) {
				Main.get().mainPanel.desktop.navigator.thesaurusTree.thesaurusSelectPopup.enable(false);
			} else {
				Main.get().mainPanel.desktop.navigator.thesaurusTree.thesaurusSelectPopup.enable(true);
			}

			if (refresh) {
				refresh(true);
			}
		}
	});
	actualItem = tree.getItem(0);
	initWidget(tree);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:47,代码来源:FolderSelectTree.java

示例9: FolderSelectTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setStyleName("okm-TreeItem");
	rootItem.setUserObject(new GWTFolder());
	rootItem.setSelected(true);
	rootItem.setState(true);
	tree.setStyleName("okm-Tree");
	tree.addItem(rootItem);
	tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			boolean refresh = true;
			TreeItem item = event.getSelectedItem();

			// Enables or disables move button ( evalues security to move to folder with permissions )
			if (rootItem.equals(item)) {
				Main.get().mainPanel.desktop.navigator.categoriesTree.categoriesSelectPopup.enable(false);
			} else {
				Main.get().mainPanel.desktop.navigator.categoriesTree.categoriesSelectPopup.enable(true);
			}

			// Case that not refreshing tree and file browser ( right click )
			if (actualItem.equals(item)) {
				refresh = false;
			} else {
				// Disables actual item because on changing active node by
				// application this it's not changed automatically
				if (!actualItem.equals(item)) {
					actualItem.setSelected(false);
					actualItem = item;
				} else {
					refresh = false;
				}
			}

			if (refresh) {
				refresh(true);
			}
		}
	});
	actualItem = tree.getItem(0);
	initWidget(tree);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:47,代码来源:FolderSelectTree.java

示例10: FolderSelectTree

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Folder Tree
 */
public FolderSelectTree() {
	tree = new Tree();
	rootItem.setStyleName("okm-TreeItem");
	rootItem.setUserObject(new GWTFolder());
	rootItem.setSelected(true);
	rootItem.setState(true);
	tree.setStyleName("okm-Tree");
	tree.addItem(rootItem);
	tree.addSelectionHandler(new SelectionHandler<TreeItem>() {

		@Override
		public void onSelection(SelectionEvent<TreeItem> event) {
			boolean refresh = true;
			TreeItem item = event.getSelectedItem();

			// Enables or disables move button ( evalues security to move to folder with permissions )
			evaluateSecurityToAction(item);

			// Case that not refreshing tree and file browser ( right click )
			if (actualItem.equals(item)) {
				refresh = false;
			} else {
				// Disables actual item because on changing active node by
				// application this it's not changed automatically
				if (!actualItem.equals(item)) {
					actualItem.setSelected(false);
					actualItem = item;
				} else {
					refresh = false;
				}
			}

			if (refresh) {
				refresh(true);
			}
		}
	});
	actualItem = tree.getItem(0);
	initWidget(tree);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:44,代码来源:FolderSelectTree.java


注:本文中的com.google.gwt.user.client.ui.Tree.addSelectionHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。