Package hermes.browser.model.tree

Examples of hermes.browser.model.tree.HermesTreeNode


    lastDndAction = TransferHandler.COPY;

    if (nodes.size() > 0 && messages.size() > 0) {
      final DestinationConfigTreeNode destinationNode = nodes.get(0);
      final HermesTreeNode hermesNode = getSelectedHermesNode();

      if (hermesNode != null && destinationNode != null) {
        HermesBrowser
            .getBrowser()
            .getActionFactory()
            .createMessageCopyAction(hermesNode.getHermes(), destinationNode.getDestinationName(), destinationNode.getDomain(), messages, true,
                true);
      }
    }

    return true;
View Full Code Here


    lastDndAction = TransferHandler.COPY;

    if (nodes.size() > 0 && messages.size() > 0) {
      final DestinationConfigTreeNode destinationNode = nodes.get(0);
      final HermesTreeNode hermesNode = getSelectedHermesNode();

      if (hermesNode != null && destinationNode != null) {
        HermesBrowser
            .getBrowser()
            .getActionFactory()
            .createMessageCopyAction(hermesNode.getHermes(), destinationNode.getDestinationName(), destinationNode.getDomain(), messages, true,
                true);
      }
    }

    return true;
View Full Code Here

    List<DestinationConfigTreeNode> nodes = getSelectedDestinationNodes();

    if (nodes.size() > 0) {
      final DestinationConfigTreeNode destinationNode = nodes.get(0);

      final HermesTreeNode hermesNode = getSelectedHermesNode();

      if (hermesNode != null && destinationNode != null) {
        Collection<Message> selected = messages.getSelectedMessages();
        Message[] messagesArray = messages.getSelectedMessages().toArray(new Message[selected.size()]);

        if (selected.size() == 1 && action == TransferHandler.COPY && MessageEditorDialog.canEdit(messagesArray[0])) {
          try {
            Message message = selected.iterator().next();
            MessageEditorDialog dialog = new MessageEditorDialog(message, destinationNode.getDestinationName(), destinationNode.getDomain(),
                new AbstractEditedMessageHandler(hermesNode.getHermes()) {
                  @Override
                  public void onMessage(Message message) {
                    HermesBrowser
                        .getBrowser()
                        .getActionFactory()
                        .createMessageCopyAction(hermesNode.getHermes(), destinationNode.getDestinationName(),
                            destinationNode.getDomain(), new ArrayList(Arrays.asList(message)), false, true);
                  }
                });
            dialog.setLocationRelativeTo(HermesBrowser.getBrowser());
            dialog.setVisible(true);
          } catch (JMSException ex) {
            HermesBrowser.getBrowser().showErrorDialog(ex);
          }

        } else {

          if (action == TransferHandler.COPY) {
            HermesBrowser
                .getBrowser()
                .getActionFactory()
                .createMessageCopyAction(hermesNode.getHermes(), destinationNode.getDestinationName(), destinationNode.getDomain(), selected,
                    true, true);
          } else {
            HermesBrowser.getBrowser().getActionFactory()
                .createMessageMoveAction(hermesNode.getHermes(), destinationNode.getDestinationName(), destinationNode.getDomain(), selected);
          }
        }
      }
    } else {
      if (getSelectionPath() != null) {
View Full Code Here

        if (path.getLastPathComponent() instanceof DestinationConfigTreeNode) {
          DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) path.getLastPathComponent();
          rval.add(destinationNode);
        } else if (path.getLastPathComponent() instanceof HermesTreeNode) {
          HermesTreeNode hermesNode = (HermesTreeNode) path.getLastPathComponent();
          rval.add(hermesNode);
        }
      }
    }
View Full Code Here

    try {
      if (treePath != null) {
        for (int i = 0; i < treePath.getPathCount(); i++) {
          if (treePath.getPathComponent(i) instanceof HermesTreeNode) {
            final HermesTreeNode node = (HermesTreeNode) treePath.getPathComponent(i);
            lastSelectedHermesTreeNode = node;

            setToolTipText(node.getHermes().getMetaData().getToolTipText());
          } else if (treePath.getPathComponent(i) instanceof DestinationConfigTreeNode) {
            final DestinationConfigTreeNode node = (DestinationConfigTreeNode) treePath.getPathComponent(i);
            setToolTipText(node.getDestinationName());

            maybeRefocusDocument(node);

          } else if (treePath.getPathComponent(i) instanceof RepositoryTreeNode) {
            final RepositoryTreeNode node = (RepositoryTreeNode) treePath.getPathComponent(i);
            setToolTipText(node.getRepository().getId());
          } else if (treePath.getPathComponent(i) instanceof MessageStoreTreeNode) {
            final MessageStoreTreeNode node = (MessageStoreTreeNode) treePath.getPathComponent(i);
            setToolTipText(node.getMessageStore().getTooltipText());
            maybeRefocusDocument(node);

          } else if (treePath.getPathComponent(i) instanceof MessageStoreURLTreeNode) {
            final MessageStoreURLTreeNode node = (MessageStoreURLTreeNode) treePath.getPathComponent(i);

            setToolTipText(node.getURL());
          }
        }
      }
    } catch (JMSException ex) {
      Hermes.ui.getDefaultMessageSink().add(ex.getMessage());
View Full Code Here

    }
  }

  public void doSendAFile(int isXML, boolean preserveDestination) {
    final DestinationConfigTreeNode destinationNode = (DestinationConfigTreeNode) HermesBrowser.getBrowser().getBrowserTree().getLastSelectedPathComponent();
    final HermesTreeNode hermesNode = (HermesTreeNode) destinationNode.getHermesTreeNode();
    final String text = ((isXML == SendMessageTask.IS_XML) ? "Send XML to " : "Send file to ") + destinationNode.getDestinationName();

    JFileChooser chooser = null;

    if (DirectoryCache.lastUploadDirectory == null) {
      chooser = new JFileChooser(System.getProperty("user.dir"));
    } else {
      chooser = new JFileChooser(DirectoryCache.lastUploadDirectory);
    }
    chooser.setMultiSelectionEnabled(true) ;

    if (chooser.showDialog(HermesBrowser.getBrowser(), text) == JFileChooser.APPROVE_OPTION) {
      DirectoryCache.lastUploadDirectory = chooser.getSelectedFile().getParentFile();
      HermesBrowser.getBrowser().getActionFactory()
          .createSimpleSendMessageAction(hermesNode.getHermes(), destinationNode.getDestinationName(), destinationNode.getDomain(), chooser.getSelectedFiles(), isXML, preserveDestination);
    } else {
      Hermes.ui.getDefaultMessageSink().add("File upload cancelled");
    }
  }
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()
                          {
View Full Code Here

   public void actionPerformed(ActionEvent arg0)
   {
      try
      {
         JFileChooser chooser = null;
         HermesTreeNode hermesNode = null;

         if (HermesBrowser.getBrowser().getBrowserTree().getSelectionPath().getLastPathComponent() instanceof HermesTreeNode)
         {
            hermesNode = (HermesTreeNode) HermesBrowser.getBrowser().getBrowserTree().getSelectionPath().getLastPathComponent();
         }
         else if (HermesBrowser.getBrowser().getBrowserTree().getSelectionPath().getLastPathComponent() instanceof DestinationConfigTreeNode)
         {
            hermesNode = (HermesTreeNode) ((DestinationConfigTreeNode) HermesBrowser.getBrowser().getBrowserTree().getSelectionPath().getLastPathComponent())
                  .getHermesTreeNode();

         }
         else
         {
            return;
         }

         if (DirectoryCache.lastUploadDirectory == null)
         {
            chooser = new JFileChooser(System.getProperty("user.dir"));
         }
         else
         {
            chooser = new JFileChooser(DirectoryCache.lastUploadDirectory);
         }
        
         if (chooser.showDialog(HermesBrowser.getBrowser(), "Open") == JFileChooser.APPROVE_OPTION)
         {
            DirectoryCache.lastUploadDirectory = chooser.getSelectedFile().getParentFile();

            HermesBrowser.getBrowser().getActionFactory().createRepositoryBrowseAction(new FileRepository(chooser.getSelectedFile()), hermesNode.getHermes());
         }
         else
         {
            Hermes.ui.getDefaultMessageSink().add("File open cancelled");
         }
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();

      final QueueSearchDialog dialog = new QueueSearchDialog(HermesBrowser.getBrowser(), hermesNode.getHermes());

      JideSwingUtilities.centerWindow(dialog);
      dialog.show();
    }
View Full Code Here

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

            if (node instanceof HermesTreeNode)
            {
               final HermesTreeNode hermesNode = (HermesTreeNode) node;
               final String newName = JOptionPane.showInputDialog(HermesBrowser.getBrowser(), "Enter new name for this session:", "Copy of "
                     + hermesNode.getHermes().getId());

               if (newName != null && !newName.equals("") && !newName.equals(hermesNode.getHermes().getId()))
               {
                  HermesBrowser.getConfigDAO().duplicateSession(HermesBrowser.getBrowser().getConfig(), hermesNode.getHermes().getId(), newName);

                  HermesBrowser.getBrowser().saveConfig();
                  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

TOP

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

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.