Package com.jidesoft.swing

Examples of com.jidesoft.swing.JidePopupMenu


{
   private static final Logger log = Logger.getLogger(PopupMenuFactory.class);

   public static JidePopupMenu createFIXMessageTablePopup(final FIXMessageTable table)
   {
      final JidePopupMenu popup = new JidePopupMenu() ;
      final JideMenu editMenu = new JideMenu("Edit...") ;
      final JideMenu chainMenu = new JideMenu("Chain...") ;
      final JCheckBoxMenuItem autoScroll = new JCheckBoxMenuItem("Autoscroll") ;
     
      chainMenu.add(new JMenuItem(new ChainByClOrdIDAction(chainMenu, table))) ;
      editMenu.add(new JMenuItem(ActionRegistry.getAction(CopyMessagesToClipboardAction.class)));
     
      popup.add(editMenu) ;
      popup.add(chainMenu) ;
      // popup.add(autoScroll) ;
     
      autoScroll.setSelected(table.isAutoScroll()) ;
      autoScroll.addActionListener(new ActionListener()
      {     
View Full Code Here


     
      return popup ;
   }
   public static JidePopupMenu createBrowseActionPopup()
   {
      final JidePopupMenu popup = new JidePopupMenu();
      final JideMenu editMenu = new JideMenu("Edit...");
      final JideMenu saveMenu = new JideMenu("Save...");

      editMenu.add(new JMenuItem(ActionRegistry.getAction(CutMessagesToClipboardAction.class)));
      editMenu.add(new JMenuItem(ActionRegistry.getAction(CopyMessagesToClipboardAction.class)));
      editMenu.add(new JMenuItem(ActionRegistry.getAction(PasteMessagesFromClipboardAction.class)));

      saveMenu.add(new JMenuItem(ActionRegistry.getAction(SaveMessagesAsTextAction.class)));
      saveMenu.add(new JMenuItem(ActionRegistry.getAction(SaveMessagesAsXMLAction.class)));
      saveMenu.add(new JMenuItem(ActionRegistry.getAction(SaveMessagesIndividuallyAsXMLAction.class)));

      popup.add(new JMenuItem(ActionRegistry.getAction(CorrelateMessagesAction.class))) ;
      popup.add(editMenu);
      popup.add(saveMenu);
      popup.add(new JPopupMenu.Separator());
      popup.add(new JMenuItem(ActionRegistry.getAction(DeleteMessagesAction.class)));

      return popup;
   }
View Full Code Here

      return popup;
   }

   public static JidePopupMenu createContextTreePopup(final ContextTree contextTree)
   {
      final JidePopupMenu popupMenu = new JidePopupMenu();

      final JMenuItem newSessionItem = new JMenuItem(ActionRegistry.getAction(CreateNewSessionFromJNDIAction.class));
      final JideMenu addToSessionItem = new JideMenu("Add to");
      final JMenuItem createContextItem = new JMenuItem(ActionRegistry.getAction(CreateNewJNDIContextAction.class));
      final JMenuItem renameBindingItem = new JMenuItem(ActionRegistry.getAction(RenameJNDIBindingAction.class));
      final JMenuItem unbindItem = new JMenuItem(ActionRegistry.getAction(JNDIUnbindAction.class));

      contextTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener()
      {
         public void valueChanged(TreeSelectionEvent e)
         {
            if (e.getNewLeadSelectionPath() == null)
            {
               addToSessionItem.setEnabled(false);
            }
            else
            {
               final TreeNode node = (TreeNode) e.getNewLeadSelectionPath().getLastPathComponent();

               addToSessionItem.setEnabled(node instanceof QueueTreeNode || node instanceof TopicTreeNode || node instanceof QueueTopicTreeNode);
            }
         }
      });

      addToSessionItem.addMouseListener(new MouseAdapter()
      {
         public void mouseEntered(MouseEvent e)
         {
            addToSessionItem.removeAll();

            for (final String sessionId : HermesBrowser.getBrowser().getBrowserTree().getAllHermesIds())
            {
               final JMenuItem menuItem = new JMenuItem(sessionId);

               // Cascade the enabled state down to the menu items from the
               // addToSessionItem...

               addToSessionItem.addPropertyChangeListener("enabled", new PropertyChangeListener()
               {
                  public void propertyChange(PropertyChangeEvent evt)
                  {
                     menuItem.setEnabled((Boolean) evt.getNewValue());
                  }
               });

               addToSessionItem.add(menuItem);

               menuItem.addActionListener(new ActionListener()
               {
                  public void actionPerformed(ActionEvent e)
                  {
                     HermesBrowser.getBrowser().getBrowserTree().doTransfer(
                           new JMSAdministeredObjectTransferable(new HermesConfigGroup(sessionId, contextTree.getSelectedDestinations(), contextTree
                                 .getSelectedConnectionFactories())), TransferHandler.COPY);
                  }
               });

               contextTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener()
               {
                  public void valueChanged(TreeSelectionEvent e)
                  {
                     if (e.getNewLeadSelectionPath() != null)
                     {
                        final TreeNode node = (TreeNode) e.getNewLeadSelectionPath().getLastPathComponent();

                        menuItem.setEnabled(node instanceof QueueTreeNode || node instanceof TopicTreeNode || node instanceof QueueTopicTreeNode);
                     }
                  }
               });
            }
         }
      });

      popupMenu.add(newSessionItem);
      popupMenu.add(addToSessionItem);

      popupMenu.add(createContextItem);
      popupMenu.add(renameBindingItem);
      popupMenu.add(unbindItem);

      return popupMenu;

   }
View Full Code Here

   }

   public static JidePopupMenu createBrowserTreePopup(final BrowserTree tree)
   {
      final JidePopupMenu popupMenu = new JidePopupMenu();
      final JideMenu watchMenu = new JideMenu("Watch");
      final JideMenu newMenu = new JideMenu("New");
      final JideMenu recordMenu = new JideMenu("Record to");

      final JMenuItem browseItem = new JMenuItem(ActionRegistry.getAction(BrowseDestinationOrContextAction.class));
      final JMenuItem browseWithSelectorItem = new JMenuItem(ActionRegistry.getAction(BrowseDestinationWithSelectorAction.class)) ;
      final JMenuItem searchItem = new JMenuItem(ActionRegistry.getAction(SearchDestinationOrContextAction.class));
      final JMenuItem truncateItem = new JMenuItem(ActionRegistry.getAction(TruncateAction.class));
      final JMenuItem editItem = new JMenuItem(ActionRegistry.getAction(EditObjectAction.class));
      final JMenuItem unsubscribe = new JMenuItem(ActionRegistry.getAction(DurableUnsubscribeAction.class));
      final JMenuItem addSession = new JMenuItem(ActionRegistry.getAction(CreateNewSessionAction.class));
      final JMenuItem addContext = new JMenuItem(ActionRegistry.getAction(CreateNewContextAction.class));
      final JMenuItem addStore = new JMenuItem(ActionRegistry.getAction(CreateNewMessageStoreAction.class));
      final JMenuItem copySession = new JMenuItem(ActionRegistry.getAction(CopyBrowserNodeAction.class));
      final JMenuItem addQueue = new JMenuItem(ActionRegistry.getAction(AddQueueAction.class));
      final JMenuItem addTopic = new JMenuItem(ActionRegistry.getAction(AddTopicAction.class));
      final JMenuItem addDurableTopic = new JMenuItem(ActionRegistry.getAction(AddDurableTopicAction.class));     
      final JMenuItem delete = new JMenuItem(ActionRegistry.getAction(DeleteBrowserTreeNodeAction.class));
      final JMenuItem discover = new JMenuItem(ActionRegistry.getAction(DiscoverDestinationsAction.class));
      final JMenuItem statistics = new JMenuItem(ActionRegistry.getAction(GetDestinationStatisticsAction.class));
      final JMenuItem newWatch = new JMenuItem(ActionRegistry.getAction(CreateNewWatchAction.class));

      watchMenu.setIcon(IconCache.getIcon("hermes.watch"));
      watchMenu.setEnabled(false);

      newMenu.add(new JMenuItem(ActionRegistry.getAction(SendNewMessageAction.class))) ;
      newMenu.add(addSession);
      newMenu.add(addContext);
      newMenu.add(addQueue);
      newMenu.add(addTopic);
      newMenu.add(addDurableTopic) ;
      // newMenu.add(new JMenuItem(ActionRegistry.getAction(CreateNewJDBCAction.class))) ;
      newMenu.add(addStore);

      newWatch.addPropertyChangeListener("enabled", new PropertyChangeListener()
      {
         public void propertyChange(PropertyChangeEvent evt)
         {
            watchMenu.setEnabled((Boolean) evt.getNewValue());
         }
      });

      popupMenu.add(newMenu);
      popupMenu.add(editItem);
      popupMenu.add(statistics);
      popupMenu.add(copySession);
      popupMenu.add(discover);
      popupMenu.add(delete);
      popupMenu.addSeparator() ;
      popupMenu.add(browseItem);
      popupMenu.add(browseWithSelectorItem) ;
      popupMenu.add(searchItem);
      popupMenu.add(truncateItem);
      popupMenu.add(watchMenu);
      popupMenu.add(recordMenu);
      popupMenu.add(new JMenuItem(ActionRegistry.getAction(SaveAllMessagesAsXMLAction.class))) ;
      popupMenu.add(ActionRegistry.getAction(ReplayAction.class));
    
      popupMenu.add(unsubscribe);
      popupMenu.addSeparator() ;
      popupMenu.add(new CascadeBrowserTreeAction(tree)) ;
      popupMenu.add(new ExpandBrowserTreeAction(tree)) ;
      popupMenu.add(new CollapseBrowserTreeAction(tree)) ;  
     

     
    
View Full Code Here

   public JPopupMenu getPopupMenu()
   {
      if (popupMenu == null)
      {
         popupMenu = new JidePopupMenu();
         stopItem = new JMenuItem("Remove");
         stopAllItem = new JMenuItem("Remove all");
         browseItem = new JMenuItem("Browse", IconCache.getIcon("hermes.browse"));
         truncateItem = new JMenuItem("Truncate", IconCache.getIcon("hermes.queue.truncate"));
         saveItem = new JMenuItem("Save", IconCache.getIcon("hermes.save"));
View Full Code Here

    this.preferredPopupHorizontalAlignment = alignment;
  }

  @Override
  public JPopupMenu createPopupMenu() {
    return new JidePopupMenu();
  }
View Full Code Here

TOP

Related Classes of com.jidesoft.swing.JidePopupMenu

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.