Package hermes.browser.model.tree

Examples of hermes.browser.model.tree.DestinationConfigTreeNode


          final NamingConfigTreeNode node = (NamingConfigTreeNode) selectionPath.getLastPathComponent();

          HermesBrowser.getBrowser().getActionFactory().createBrowseContextAction(node.getConfig());
         
        } else if (selectionPath.getLastPathComponent() instanceof DestinationConfigTreeNode) {
          final DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) selectionPath.getLastPathComponent();
          final Hermes hermes = ((HermesTreeNode) destinationNode.getHermesTreeNode()).getHermes();
          final QueueBrowseAction qBrowser = HermesBrowser.getBrowser().getOpenQueueBrowser(destinationNode.getConfig()) ;
          if (qBrowser != null) {
            qBrowser.refresh() ;
          } else {
            HermesBrowser.getBrowser().getActionFactory().createQueueBrowseAction(hermes, destinationNode.getConfig());
          }
        } else if (selectionPath.getLastPathComponent() instanceof RepositoryTreeNode) {
          final RepositoryTreeNode repNode = (RepositoryTreeNode) selectionPath.getLastPathComponent();
          final Hermes hermes = HermesBrowser.getBrowser().getBrowserTree().getHermesAsMessageFactory();
View Full Code Here


  public void actionPerformed(ActionEvent arg0) {
    final BrowserTree browserTree = HermesBrowser.getBrowser().getBrowserTree();

    if (browserTree.getSelectionPath().getLastPathComponent() instanceof DestinationConfigTreeNode) {
      final DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) browserTree.getSelectionPath().getLastPathComponent();
      final HermesTreeNode hermesNode = (HermesTreeNode) destinationNode.getHermesTreeNode();
      final QueueSearchDialog dialog = new QueueSearchDialog(HermesBrowser.getBrowser(), hermesNode.getHermes(), (DestinationConfig) destinationNode.getBean(), searchUserHeader);

      dialog.setLocationRelativeTo(null);
      dialog.show();
    } else if (browserTree.getSelectionPath().getLastPathComponent() instanceof HermesTreeNode) {
      final HermesTreeNode hermesNode = (HermesTreeNode) browserTree.getSelectionPath().getLastPathComponent();
View Full Code Here

                  HermesBrowser.getBrowser().loadConfig();
               }
            }
            else if (node instanceof DestinationConfigTreeNode)
            {
               final DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) node;
               final HermesTreeNode hermesNode = (HermesTreeNode) destinationNode.getHermesTreeNode();
               final String newName = JOptionPane.showInputDialog(HermesBrowser.getBrowser(), "Enter new name for this destination:", "Copy of "
                     + destinationNode.getConfig().getName());

               if (newName != null && !newName.equals("") && !newName.equals(destinationNode.getConfig().getName()))
               {
                  hermesNode.getHermes().addDestinationConfig(HermesBrowser.getConfigDAO().duplicate(destinationNode.getConfig()));
                 
                  HermesBrowser.getBrowser().saveConfig();
                  HermesBrowser.getBrowser().loadConfig();
               }
            }
View Full Code Here

      if ( curPath != null)
      {
          if (curPath.getLastPathComponent() instanceof DestinationConfigTreeNode)
          {
              final DestinationConfigTreeNode dNode = (DestinationConfigTreeNode) curPath.getLastPathComponent();
              final HermesTreeNode hNode = (HermesTreeNode) dNode.getHermesTreeNode();

              Hermes.ui.getDefaultMessageSink().add("Getting statistics for " + dNode.getDestinationName());

              Hermes.ui.getThreadPool().invokeLater(new Runnable()
              {
                  public void run()
                  {
                      Hermes hermes = null;

                      try
                      {
                          hermes = hNode.getHermes();
                         
                          final Map statistics = hermes.getStatistics(dNode.getConfig());

                          SwingUtilities.invokeLater(new Runnable()
                          {
                              public void run()
                              {
                                  MapPropertyDialog dialog = new MapPropertyDialog(HermesBrowser.getBrowser(),
                                          "Properties for " + dNode.getDestinationName(), null, statistics, false);
                                  dialog.pack();
                                  JideSwingUtilities.centerWindow(dialog);
                                  dialog.show();
                              }
                          });
                      }
                      catch (Throwable e)
                      {
                          HermesBrowser.getBrowser().showErrorDialog("Can't get properties for " + dNode.getDestinationName(), e);
                      }
                      finally
                      {
                          if ( hermes != null)
                          {
View Full Code Here

    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()));
          }
        }
      }, true);
    }
  }
View Full Code Here

    }
  }

  public void actionPerformed(ActionEvent event) {
    if (getBrowserTree().getSelectionPath().getLastPathComponent() instanceof DestinationConfigTreeNode) {
      final DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) getBrowserTree().getSelectionPath().getLastPathComponent();

      if (destinationNode != null) {
        HermesTreeNode hermesNode = (HermesTreeNode) destinationNode.getHermesTreeNode();

        try {
          BrowserAction browserAction = (BrowserAction) HermesBrowser.getBrowser().getDocumentPane().getActiveDocument();
          HermesBrowser.getBrowser().getActionFactory().createTruncateAction(hermesNode.getHermes(), destinationNode.getConfig(), browserAction);
        } catch (JMSException ex) {
          HermesBrowser.getBrowser().showErrorDialog("Cannot truncate: ", ex);
        }
      }
    } else if (HermesBrowser.getBrowser().getBrowserTree().getSelectionPath().getLastPathComponent() instanceof RepositoryTreeNode) {
View Full Code Here

         {
            Object component = treePath.getLastPathComponent();

            if (component instanceof DestinationConfigTreeNode)
            {
               final DestinationConfigTreeNode node = (DestinationConfigTreeNode) component;
               final HermesTreeNode hermesNode = (HermesTreeNode) node.getHermesTreeNode();

               Hermes.ui.getThreadPool().invokeLater(new EditDestinationPropertiesTask(hermesNode.getHermes(), node.getConfig(), new Runnable()
               {              
                  public void run()
                  {
                     int index = hermesNode.getIndex(node) ;
                     hermesNode.remove(node) ;                    
                     HermesBrowser.getBrowser().getBrowserTree().getBrowserModel().nodesWereRemoved(hermesNode, new int[] { index }, new Object[] { node} ) ;
                    
                     DestinationConfigTreeNode newNode = new DestinationConfigTreeNode(hermesNode, node.getConfig(), false) ;
                   
                    
                     hermesNode.add(newNode) ;
                     HermesBrowser.getBrowser().getBrowserTree().getBrowserModel().nodesWereInserted(hermesNode, new int[] { hermesNode.getIndex(newNode) } ) ;
                    
View Full Code Here

         {
            if (e.getPath() != null)
            {
               if (e.getPath().getLastPathComponent() instanceof DestinationConfigTreeNode)
               {
                  final DestinationConfigTreeNode dNode = (DestinationConfigTreeNode) e.getPath().getLastPathComponent();

                  setEnabled(dNode.getDomain() == Domain.TOPIC);
               }
               else
               {
                  setEnabled(e.getPath().getLastPathComponent() instanceof HermesTreeNode) ;
               }
View Full Code Here

   @Override
   protected DestinationConfig createDestinationConfig()
   {
      final DestinationConfig rval = super.createDestinationConfig();
      final DestinationConfigTreeNode node = HermesBrowser.getBrowser().getBrowserTree().getFirstSelectedDestinationNode() ;
     
      rval.setDomain(Domain.TOPIC.getId());
      rval.setDurable(true);
     
      if (node != null)
      {
         DestinationConfig selectedConfig = node.getConfig();

         if (selectedConfig.getDomain() == Domain.TOPIC.getId())
         {
            rval.setName(selectedConfig.getName());
         }
View Full Code Here

      Hermes h = null;

      TreePath currentPath = HermesBrowser.getBrowser().getBrowserTree().getSelectionModel().getSelectionPath();

      if (currentPath.getLastPathComponent() instanceof DestinationConfigTreeNode) {
        final DestinationConfigTreeNode destinationNode = HermesBrowser.getBrowser().getBrowserTree().getSelectedDestinationNodes().get(0);
        final DestinationConfig destinationConfig = destinationNode.getConfig();
        h = ((HermesTreeNode) destinationNode.getParent()).getHermes();
        task = new BrowseDestinationTask(h, destinationConfig);
        f = destinationConfig.getName();
      } else {
        MessageStore messageStore = HermesBrowser.getBrowser().getBrowserTree().getSelectedMessageStore();
        h = getMyHermes();
View Full Code Here

TOP

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

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.