Package hermes.browser.model.tree

Examples of hermes.browser.model.tree.AbstractTreeNode


            {
               Object component = selectionPath.getLastPathComponent();

               if (component instanceof AbstractTreeNode)
               {
                  AbstractTreeNode node = (AbstractTreeNode) component;

                  if (node instanceof ConnectionFactoryTreeNode)
                  {
                     ContextTreeNode ctxNode = (ContextTreeNode) node.getParent();
                     ConnectionFactoryTreeNode cfNode = (ConnectionFactoryTreeNode) node;
                     String binding = getAbsoluteBinding(cfNode);
                     Class clazz = null;

                     if (cfNode.getBean() instanceof QueueConnectionFactory && cfNode.getBean() instanceof TopicConnectionFactory)
                     {
                        clazz = JNDIConnectionFactory.class;
                     }
                     else if (cfNode.getBean() instanceof QueueConnectionFactory)
                     {
                        clazz = JNDIQueueConnectionFactory.class;
                     }
                     else
                     {
                        clazz = JNDITopicConnectionFactory.class;
                     }

                     FactoryConfig factoryConfig = HermesBrowser.getConfigDAO().createJNDIFactoryConfig(ctxNode.getConfig().getClasspathId(), "S:" + System.currentTimeMillis()
                           + ":" + node.getId(), binding, ctxNode.getConfig().getProperties(), clazz.getName());

                     rval.add(factoryConfig);
                  }
               }
            }
View Full Code Here


      final TreeNode[] path = (TreeNode[]) model.getPathToRoot(leaf);
      final StringBuffer rval = new StringBuffer();

      for (int i = 1; i < path.length; i++)
      {
         AbstractTreeNode node = (AbstractTreeNode) path[i];

         rval.append(node.getId());

         if (i != path.length - 1)
         {
            if (!node.getId().endsWith("/"))
            {
               rval.append("/");
            }
         }
      }
View Full Code Here

         {
            Object component = selectionPath.getLastPathComponent();

            if (component instanceof AbstractTreeNode)
            {
               AbstractTreeNode node = (AbstractTreeNode) component;

               if (node instanceof QueueTopicTreeNode || node instanceof QueueTreeNode || node instanceof TopicTreeNode)
               {
                  DestinationConfig config = HermesBrowser.getConfigDAO().createDestinationConfig();
                  String binding = getAbsoluteBinding(node);

                  config.setName(binding);
                  config.setDomain(Domain.getDomain((Destination) node.getBean()).getId());

                  rval.add(config);
               }
            }
         }
View Full Code Here

            HermesBrowser.getBrowser().showErrorDialog(node.getException().getClass().getName() + "\n" + node.getException());
         }
         else if (getSelectionPath().getLastPathComponent() instanceof AbstractTreeNode)
         {
            AbstractTreeNode node = (AbstractTreeNode) getSelectionPath().getLastPathComponent();

            if (node instanceof ContextTreeNode)
            {
               // NOP
            }
            else
            {
               BeanPropertyDialog dialog = new BeanPropertyDialog(HermesBrowser.getBrowser(), node.getBean(), false);
               dialog.pack();
               JideSwingUtilities.centerWindow(dialog);
               dialog.show();
            }
         }
View Full Code Here

   {
      super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);

      if (value instanceof AbstractTreeNode)
      {
         AbstractTreeNode node = (AbstractTreeNode) value;

         if (node.hasOpenIcon() && expanded)
         {
            setIcon(node.getOpenIcon());
         }
         else
         {
            setIcon(node.getIcon());
         }
      }
      else
      {
         if (expanded)
View Full Code Here

         HermesBrowser.getBrowser().getBrowserTree().getBrowserModel().nodesWereRemoved(hermesNode, index, objects);
      }
      else
      {
         AbstractTreeNode cleanup = destinationNode;
         do
         {
            AbstractTreeNode cleanupParent = (AbstractTreeNode) cleanup.getParent();
            int index = cleanupParent.getIndex(cleanup);
            cleanupParent.remove(cleanup);

            HermesBrowser.getBrowser().getBrowserTree().getBrowserModel().nodesWereRemoved(cleanupParent, new int[] { index }, new Object[] { cleanup });
            cleanup = cleanupParent;
         }
         while (cleanup.getChildCount() == 0 && cleanup instanceof DestinationFragmentTreeNode);
View Full Code Here

   public void actionPerformed(ActionEvent e)
   {
      try
      {
         final BrowseContextAction browseContext = (BrowseContextAction) HermesBrowser.getBrowser().getDocumentPane().getActiveDocument();
         final AbstractTreeNode node = (AbstractTreeNode) browseContext.getContextTree().getSelectionPath().getLastPathComponent();
         final String binding = JOptionPane.showInputDialog(HermesBrowser.getBrowser(), "Enter Binding", "");

         if (binding != null && !binding.equals(""))
         {
            if (node.getParent() instanceof ContextTreeNode)
            {
               ContextTreeNode contextNode = (ContextTreeNode) node.getParent();
               Context context = (Context) contextNode.getContextFactory().createContext().lookup(node.getPathFromRoot());
               context.rename(node.getId(), binding);
               context.close();

               Hermes.ui.getDefaultMessageSink().add(node.getId() + " renamed to " + binding);
            }
         }
      }
      catch (Throwable ex)
      {
View Full Code Here

                        cfNode.remove(node);
                        nodesWereRemoved(cfNode, new int[] { index }, new Object[] { node });
                     }
                     else if (node.getParent() instanceof DestinationFragmentTreeNode)
                     {
                        AbstractTreeNode cleanup = node;
                        do
                        {
                           AbstractTreeNode cleanupParent = (AbstractTreeNode) cleanup.getParent();
                           int index = cleanupParent.getIndex(cleanup);
                           cleanupParent.remove(cleanup);

                           nodesWereRemoved(cleanupParent, new int[] { index }, new Object[] { cleanup });
                           cleanup = cleanupParent;
                        }
                        while (cleanup.getChildCount() == 0 && cleanup instanceof DestinationFragmentTreeNode);
View Full Code Here

      return false ;
   }
  
   public static void add(BrowserTreeModel model, Hermes hermes, String path, String delimiter, AbstractTreeNode root, AbstractTreeNode leaf)
   {
      AbstractTreeNode currentNode = root;

      for (StringTokenizer tokens = new StringTokenizer(path, delimiter); tokens.hasMoreTokens();)
      {
         String token = tokens.nextToken();
         boolean found = false;

         for (int i = 0; i < currentNode.getChildCount(); i++)
         {
            AbstractTreeNode node = (AbstractTreeNode) currentNode.getChildAt(i);

            if (node.getId().equals(token))
            {
               if (!tokens.hasMoreTokens())
               {
                  currentNode.remove(node);                
                  currentNode.add(leaf);
View Full Code Here

TOP

Related Classes of hermes.browser.model.tree.AbstractTreeNode

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.