Package javax.swing.event

Examples of javax.swing.event.TreeSelectionListener


    setEnabled(false);

    enableOnBrowserTreeSelection(new Class[] { MessageStoreQueueTreeNode.class, MessageStoreTopicTreeNode.class, MessageStoreTreeNode.class,
        DestinationConfigTreeNode.class, NamingConfigTreeNode.class }, this, true);
    enableOnBrowserTreeSelection(new Class[] { NamingConfigTreeNode.class }, this, new TreeSelectionListener() {
      public void valueChanged(TreeSelectionEvent e) {
        setEnabled(getBrowserTree().getLastSelectedHermesTreeNode() != null);
      }
    }, true);
  }
View Full Code Here


    putValue(Action.NAME, "Collapse");
    putValue(Action.SHORT_DESCRIPTION, "Collapse tree.");
    putValue(Action.SMALL_ICON, IconCache.getIcon("hermes.collapse.all"));
    setEnabled(false);

    browserTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        CollapseBrowserTreeAction.this.setEnabled(e.getPath() != null);
      }
    });
View Full Code Here

      enableOnBrowserTreeSelection(new Class[] { clazz }, action, null, single);
   }

   public void enableOnBrowserTreeSelection(final Class[] classes, final Action action, final TreeSelectionListener delegate, final boolean single)
   {
      getBrowserTree().getSelectionModel().addTreeSelectionListener(new TreeSelectionListener()
      {
         public void valueChanged(final TreeSelectionEvent event)
         {
            for (int i = 0; i < classes.length; i++)
            {
View Full Code Here

    putValue(Action.SMALL_ICON, IconCache.getIcon("hermes.queue.truncate"));

    setEnabled(false);

    if (!HermesBrowser.getBrowser().isRestricted()) {
      enableOnBrowserTreeSelection(new Class[] { DestinationConfigTreeNode.class, RepositoryTreeNode.class }, this, new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent e) {
          if (getBrowserTree().hasSelection() && getBrowserTree().getLastSelectedPathComponent() instanceof DestinationConfigTreeNode) {
            final DestinationConfigTreeNode treeNode = (DestinationConfigTreeNode) getBrowserTree().getSelectionPath().getLastPathComponent();

            setEnabled(treeNode.isQueue() || (treeNode.getConfig().isDurable()));
View Full Code Here

    putValue(Action.SHORT_DESCRIPTION, "Expand tree.");
    putValue(Action.SMALL_ICON, IconCache.getIcon("hermes.expand.all"));

    setEnabled(false);

    browserTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        ExpandBrowserTreeAction.this.setEnabled(e.getPath() != null);
      }
    });
View Full Code Here

   }

   protected void registerTreeSelection()
   {
      enableOnBrowserTreeSelection(new Class[] { HermesTreeNode.class, DestinationConfigTreeNode.class }, this, new TreeSelectionListener()
      {
         public void valueChanged(TreeSelectionEvent e)
         {
            if (e.getPath() != null)
            {
View Full Code Here

  {
    super(pRootNode);
    mModel = (DefaultTreeModel)getModel();
    mRoot = (DefaultMutableTreeNode) mModel.getRoot();
    setRootVisible(true);
    getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        if ( e.getNewLeadSelectionPath() == null)
        {
          return;
View Full Code Here

        this.tree.setShowsRootHandles(true);
        this.tree.setEditable(false);
        this.tree.getSelectionModel().setSelectionMode(
                TreeSelectionModel.SINGLE_TREE_SELECTION);

        this.tree.addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent event) {
                // Doesn't do anything if deselected, which happens during the
                // update.
                if (event.isAddedPath()) {
                    TreePath path = event.getPath();
View Full Code Here

    mainPanel.add(uploadPanel);
    mainPanel.add(downloadPanel);
    mainPanel.layout(3, 1, 0, GridPanel.WEIGHT_EQUALLY);
   
   
    this.s3Tree.addTreeSelectionListener(new TreeSelectionListener() {     
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        DefaultMutableTreeNode node = AmazonS3UtilsWindow.this.s3Tree.getSelectedNode();

        if (node == null)
View Full Code Here

        }
      }
    });

    detailsTree.addTreeSelectionListener(new TreeSelectionListener() {
      public void valueChanged(TreeSelectionEvent e) {
        if (detailsTree.getLastSelectedPathComponent() instanceof InfoNode) {
          InfoNode node = (InfoNode) detailsTree
              .getLastSelectedPathComponent();
          if (node == null)
View Full Code Here

TOP

Related Classes of javax.swing.event.TreeSelectionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.