com.google.gwt.user.client.ui.Tree.addSelectionHandler()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中com.google.gwt.user.client.ui.Tree.addSelectionHandler()方法的一些代码示例,展示了Tree.addSelectionHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.addSelectionHandler()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Tree
类名称:Tree
方法名:addSelectionHandler

Tree.addSelectionHandler介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * @deprecated will be removed in GWT 2.0 along with the listener classes
 */
@Deprecated
public static void add(com.google.gwt.user.client.ui.Tree tree,
  TreeListener listener) {
 WrappedTreeListener t = new WrappedTreeListener(listener);
 tree.addSelectionHandler(t);
 tree.addCloseHandler(t);
 tree.addOpenHandler(t);
}

代码示例来源:origin: de.esoco/gewt

/***************************************
   * {@inheritDoc}
   */
  @Override
  protected HandlerRegistration initEventDispatching(
    Widget    rWidget,
    EventType eEventType)
  {
    if (eEventType == EventType.SELECTION &&
      rWidget instanceof com.google.gwt.user.client.ui.Tree)
    {
      return ((com.google.gwt.user.client.ui.Tree) rWidget)
          .addSelectionHandler(this);
    }
    else
    {
      return super.initEventDispatching(rWidget, eEventType);
    }
  }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * @deprecated will be removed in GWT 2.0 along with the listener classes
 */
@Deprecated
public static void add(com.google.gwt.user.client.ui.Tree tree,
  TreeListener listener) {
 WrappedTreeListener t = new WrappedTreeListener(listener);
 tree.addSelectionHandler(t);
 tree.addCloseHandler(t);
 tree.addOpenHandler(t);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * @deprecated will be removed in GWT 2.0 along with the listener classes
 */
@Deprecated
public static void add(com.google.gwt.user.client.ui.Tree tree,
  TreeListener listener) {
 WrappedTreeListener t = new WrappedTreeListener(listener);
 tree.addSelectionHandler(t);
 tree.addCloseHandler(t);
 tree.addOpenHandler(t);
}

代码示例来源:origin: org.kie.guvnor/guvnor-metadata-widget

/**
 * Create a new cat explorer.
 * @param resource active resource path, based on it will display related categories
 * @param handler category select handler
 */
public CategoryExplorerWidget( final Path resource,
                final CategorySelectHandler handler ) {
  this.resource = checkNotNull( "resource", resource );
  this.categorySelectHandler = handler;
  panel.add( navTreeWidget );
  loadInitialTree();
  initWidget( panel );
  navTreeWidget.addSelectionHandler( this );
  this.setStyleName( "category-explorer-Tree" );
}

代码示例来源:origin: org.uberfire/widgets-core-client

@Override
public void reset() {
  rootTreeItem.setUserObject(REPOSITORY_ID);
  rootTreeItem.addItem(LAZY_LOAD);
  rootTreeItem.removeItems();
  tree.addOpenHandler(new OpenHandler<TreeItem>() {
    @Override
    public void onOpen(final OpenEvent<TreeItem> event) {
      if (needsLoading(event.getTarget()) && event.getTarget().getUserObject() instanceof Path) {
        presenter.loadDirectoryContent(new FileExplorerItemImpl(event.getTarget()), (Path) event.getTarget().getUserObject());
      }
    }
  });
  tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
    @Override
    public void onSelection(SelectionEvent<TreeItem> event) {
      final Object userObject = event.getSelectedItem().getUserObject();
      if (userObject != null && userObject instanceof Path) {
        final Path path = (Path) userObject;
        presenter.redirect(path);
      } else if (userObject != null && userObject instanceof Root) {
        final Root root = (Root) userObject;
        presenter.redirect(root);
      } else if (event.getSelectedItem().getUserObject() instanceof String &&
          (event.getSelectedItem().getUserObject()).equals(REPOSITORY_ID)) {
        presenter.redirectRepositoryList();
      }
    }
  });
}

代码示例来源:origin: oVirt/ovirt-engine

public void addSelectionHandler() {
  tree.addSelectionHandler(event -> onItemSelection(event.getSelectedItem(), false));
  tree.addMouseDownHandler(event -> {
    if (event.getNativeEvent().getButton() == NativeEvent.BUTTON_RIGHT) {
      onItemSelection(findSelectedItem(event.getClientX(), event.getClientY()), true);
    }
  });
  tree.addKeyDownHandler(event -> isControlKeyDown = event.isControlKeyDown());
  tree.addKeyUpHandler(event -> isControlKeyDown = event.isControlKeyDown());
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-java-ext-lang-client

@Override
public void setTreeOfChanges(Map<String, PreviewNode> nodes) {
 containerChanges.clear();
 showDiffPanel(false);
 final SelectionModel<PreviewNode> selectionModel = new SingleSelectionModel<>();
 selectionModel.addSelectionChangeHandler(
   event -> {
    PreviewNode selectedNode =
      (PreviewNode) ((SingleSelectionModel) selectionModel).getSelectedObject();
    delegate.onSelectionChanged(selectedNode);
   });
 Tree tree = new Tree();
 tree.getElement().setId("tree-of-changes");
 for (PreviewNode parentChange : nodes.values()) {
  TreeItem treeItem = new TreeItem();
  containerChanges.put(treeItem, parentChange);
  createTreeElement(treeItem, parentChange.getDescription(), parentChange.getChildren());
  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.clear();
 treePanel.add(tree);
}

代码示例来源:origin: kiegroup/drools-wb

tree.addSelectionHandler( new SelectionHandler<TreeItem>() {
  public void onSelection( SelectionEvent<TreeItem> event ) {
    Object o = event.getSelectedItem().getUserObject();

代码示例来源:origin: org.kie.guvnor/guvnor-drl-text-editor-client

tree.addSelectionHandler( new SelectionHandler<TreeItem>() {
  public void onSelection( SelectionEvent<TreeItem> event ) {
    Object o = event.getSelectedItem().getUserObject();

代码示例来源:origin: kiegroup/drools-wb

tree.addSelectionHandler( new SelectionHandler<TreeItem>() {
  public void onSelection( SelectionEvent<TreeItem> event ) {
    Object o = event.getSelectedItem().getUserObject();

相关文章