Package com.jidesoft.swing

Examples of com.jidesoft.swing.JideMenu


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

   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)
                  {
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)) ;  
     

     
    

      recordMenu.addMouseListener(new MouseAdapter()
      {
         @Override
         public void mouseEntered(MouseEvent e)
         {
            recordMenu.removeAll();

            final Collection<MessageStore> stores = HermesBrowser.getBrowser().getBrowserTree().getMessageStores();
            final boolean isEnabled = tree.getSelectionPath() != null && tree.getSelectionPath().getLastPathComponent() instanceof DestinationConfigTreeNode ;
                   
            if (stores.size() > 0)
            {
               for (final MessageStore store : stores)
               {
                  final JMenuItem item = new JMenuItem(store.getId());

                  item.setEnabled(isEnabled);
                  item.addActionListener(new ActionListener()
                  {
                     public void actionPerformed(ActionEvent e)
                     {
                        final Hermes hermes = HermesBrowser.getBrowser().getBrowserTree().getSelectedHermesNode().getHermes();
                        final DestinationConfigTreeNode node = HermesBrowser.getBrowser().getBrowserTree().getFirstSelectedDestinationNode();

                        if (node != null)
                        {
                           HermesBrowser.getBrowser().getThreadPool().invokeLater(new RecordDestinationTask(hermes, node, store));
                        }
                     }
                  });

                  recordMenu.add(item);
               }
            }
            else
            {
               recordMenu.add(new JMenuItem("<no stores>"));
            }
         }

      });
View Full Code Here

  public void setPreferredPopupHorizontalAlignment(int alignment){
    this.preferredPopupHorizontalAlignment = alignment;
  }
 
  public JMenu createMenu() {
    JideMenu menu = new JideMenu();
    menu.setPreferredPopupHorizontalAlignment(preferredPopupHorizontalAlignment);
    return menu;
  }
View Full Code Here

    return new JidePopupMenu();
  }

  @Override
  public JMenu createMenu() {
    JideMenu menu = new JideMenu();
    menu.setPreferredPopupHorizontalAlignment( preferredPopupHorizontalAlignment );
    return menu;
  }
View Full Code Here

TOP

Related Classes of com.jidesoft.swing.JideMenu

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.