Examples of HermesTreeNode


Examples of hermes.browser.model.tree.HermesTreeNode

     
      for (DestinationConfigTreeNode destination : destinations)
      {
         if (!visitedHermes.contains(destination.getHermesTreeNode()))
         {
            HermesTreeNode hermesNode = (HermesTreeNode) destination.getHermesTreeNode() ;
            onHermesConfig(writer, hermesNode) ;
         }
      }
   }
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

   }

   private void doDelete(DestinationConfigTreeNode destinationNode) throws JMSException
   {
      final HermesConfig config = HermesBrowser.getBrowser().getConfig();
      final HermesTreeNode hermesNode = (HermesTreeNode) destinationNode.getHermesTreeNode();
      final String type = destinationNode.isQueue() ? "queue" : "topic";

      HermesBrowser.getConfigDAO().removeDestination(config, hermesNode.getHermes().getId(), destinationNode.getDestinationName());
      hermesNode.getHermes().removeDestinationConfig(destinationNode.getConfig());

      HermesBrowser.getBrowser().saveConfig();
      Hermes.ui.getDefaultMessageSink().add(destinationNode.getDestinationName() + " removed");

      if (destinationNode.getParent() == hermesNode)
      {
         final int[] index = { destinationNode.getHermesTreeNode().getIndex(destinationNode) };
         final Object[] objects = { destinationNode };
         hermesNode.remove(destinationNode);

         HermesBrowser.getBrowser().getBrowserTree().getBrowserModel().nodesWereRemoved(hermesNode, index, objects);
      }
      else
      {
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

  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

Examples of hermes.browser.model.tree.HermesTreeNode

            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) } ) ;
                    
                     try
                     {
                        HermesBrowser.getBrowser().saveConfig() ;                    
                     }
                     catch (Exception ex)
                     {
                        HermesBrowser.getBrowser().showErrorDialog(ex) ;
                     }
                  }              
               }));
            }
            else if (component instanceof HermesTreeNode)
            {
               final HermesTreeNode hermesNode = (HermesTreeNode) component;
               final PreferencesDialog dialog = new PreferencesDialog(HermesBrowser.getBrowser());

               dialog.init();
               dialog.refocus(hermesNode.getHermes().getId());
               JideSwingUtilities.centerWindow(dialog);
               dialog.setVisible(true) ;
            }
            else if (component instanceof NamingConfigTreeNode)
            {
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

         {
            final TreeNode node = (TreeNode) HermesBrowser.getBrowser().getBrowserTree().getSelectionPath().getLastPathComponent();

            if (node instanceof HermesTreeNode)
            {
               final HermesTreeNode hermesNode = (HermesTreeNode) node;

               HermesBrowser.getBrowser().getActionFactory().createDiscoverDestinationAction(
                     (BrowserTreeModel) HermesBrowser.getBrowser().getBrowserTree().getModel(), hermesNode);
            }
         }
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

  
   public void actionPerformed(ActionEvent arg0)
   {
      try
      {
         final HermesTreeNode hermesNode = HermesBrowser.getBrowser().getBrowserTree().getSelectedHermesNode();
         final DestinationConfig config = createDestinationConfig() ;

         config.setDomain(domain.getId());

         final DestinationConfigDialog dialog = new DestinationConfigDialog(HermesBrowser.getBrowser(), hermesNode.getHermes().getId(), null, config);

         dialog.addOKAction(new Runnable()
         {
            public void run()
            {
               try
               {
                  if (config.getName() != null)
                  {
                     HermesBrowser.getBrowser().addDestinationConfig(hermesNode.getHermes(), config);
                     HermesBrowser.getBrowser().saveConfig();                   
                  }
               }
               catch (Exception e)
               {
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

    enableOnBrowserTreeSelection(new Class[] { DestinationConfigTreeNode.class }, this, true);
  }

  public void actionPerformed(ActionEvent arg0) {
    final DestinationConfigTreeNode dNode = getBrowserTree().getSelectedDestinationNodes().get(0);
    final HermesTreeNode hNode = getBrowserTree().getSelectedHermesNode();

    try {
      MessageEditorDialog dialog = new MessageEditorDialog(null, dNode.getDestinationName(), dNode.getDomain(), new AbstractEditedMessageHandler(
          hNode.getHermes()) {
        @Override
        public void onMessage(Message message) {
          HermesBrowser
              .getBrowser()
              .getActionFactory()
              .createMessageCopyAction(hNode.getHermes(), dNode.getDestinationName(), dNode.getDomain(),
                  new ArrayList<Message>(Arrays.asList(message)), false, false);
        }
      });
      dialog.setLocationRelativeTo(HermesBrowser.getBrowser());
      dialog.setVisible(true);
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

      {
         for (int j = 0; j < path.getPathCount(); j++)
         {
            if (path.getPath()[j] instanceof HermesTreeNode)
            {
               HermesTreeNode node = (HermesTreeNode) path.getPath()[j];
               node.setCascadeNamespace(!node.isCascadeNamespace());

               TreePath cascadeFrom = path;

               while (!(cascadeFrom.getLastPathComponent() instanceof HermesTreeNode))
               {
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

         if (node instanceof DestinationConfigTreeNode)
         {
            try
            {
               final DestinationConfigTreeNode tNode = (DestinationConfigTreeNode) node;
               final HermesTreeNode hNode = (HermesTreeNode) tNode.getHermesTreeNode();
               final DestinationConfig dConfig = tNode.getConfig();

               if (dConfig.isDurable())
               {
                  if (JOptionPane.showConfirmDialog(HermesBrowser.getBrowser(), "Would you like to unsubscribe from durable subscription clientID="
                        + dConfig.getClientID() + " on " + tNode.getDestinationName(), "Please confirm", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
                  {
                     Hermes.ui.getThreadPool().invokeLater(new Runnable()
                     {
                        public void run()
                        {
                           try
                           {
                              hNode.getHermes().unsubscribe(dConfig.getClientID());
                              Hermes.ui.getDefaultMessageSink().add("Unsubscribed");
                           }
                           catch (Throwable e)
                           {
                              HermesBrowser.getBrowser().showErrorDialog("Unable to unsubscribe", e);
                           }
                           finally
                           {
                              try
                              {
                                 hNode.getHermes().close();
                              }
                              catch (Throwable t)
                              {
                                 log.error(t.getMessage(), t);
                              }
View Full Code Here

Examples of hermes.browser.model.tree.HermesTreeNode

  public void actionPerformed(ActionEvent arg0) {
    final BrowserTree browserTree = HermesBrowser.getBrowser().getBrowserTree();
    try {
      if (browserTree.getSelectionPath().getLastPathComponent() instanceof DestinationConfigTreeNode) {
        final DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) browserTree.getSelectionPath().getLastPathComponent();
        final HermesTreeNode hermesNode = (HermesTreeNode) destinationNode.getHermesTreeNode();
        final BrowserAction browserAction = (BrowserAction) HermesBrowser.getBrowser().getDocumentPane().getActiveDocument();
        if (browserAction != null) {
          final Collection<Message> messages = browserAction.getSelectedMessages();
          if (messages.size() > 0) {
            final StringWriter selector = new StringWriter();
            for (Iterator<Message> iter = messages.iterator(); iter.hasNext();) {
              Message message = iter.next();
              selector.append("JMSMessageID = '" + message.getJMSMessageID() + "' ");
              selector.append("OR JMSCorrelationID = '" + message.getJMSMessageID() + "' ");
              if (message.getJMSCorrelationID() != null) {
                selector.append("OR JMSMessageID = '" + message.getJMSCorrelationID() + "' ");
                selector.append("OR JMSCorrelationID = '" + message.getJMSCorrelationID() + "' ");

              }

              if (iter.hasNext()) {
                selector.append(" OR ");
              }
            }

            final DestinationConfig dConfig = HermesBrowser.getConfigDAO().duplicate(destinationNode.getConfig());
            dConfig.setSelector(selector.toString());

            HermesBrowser.getBrowser().getActionFactory().createQueueBrowseAction(hermesNode.getHermes(), dConfig);
          }
        }
      }
    } catch (Exception ex) {
      HermesBrowser.getBrowser().showErrorDialog(ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.