Package org.springframework.richclient.command

Examples of org.springframework.richclient.command.CommandGroup


        jlUnusedTypes = getComponentFactory().createList();
        jlUnusedTypes.setCellRenderer(new SchemaElementsRenderer());

        jlUnusedTypes.addListSelectionListener(xsPropertiesSelectionListener);

        final CommandGroup group = getWindowCommandManager().createCommandGroup("unusedTypeUsageCommandGroup", new Object[] { unusedTypeHierarchyCommand, unusedTypeInspectionCommand, "separator", GlobalCommandIds.PROPERTIES});
        final JPopupMenu popup = group.createPopupMenu();
        jlUnusedTypes.addMouseListener(new PopupMenuMouseListener(popup));
    }
View Full Code Here


    private void createUsedTypesTree() {
        jtUsedTypes = new JTree(new DefaultMutableTreeNode(getMessage("usedTypes.tree.noModel")));
        jtUsedTypes.setCellRenderer(new SchemaElementsRenderer());

        final CommandGroup group = getWindowCommandManager().createCommandGroup("usedTypeUsageCommandGroup", new Object[] { usedTypeHierarchyCommand, usedTypeInspectionCommand, "separator", GlobalCommandIds.PROPERTIES});
        final JPopupMenu popup = group.createPopupMenu();
        jtUsedTypes.addMouseListener(new PopupMenuMouseListener(popup));

        jtUsedTypes.addTreeSelectionListener(xsPropertiesSelectionListener);
    }
View Full Code Here

    }
  }

  @NotNull
  private JComponent createButtonBar() {
    CommandGroup group = CommandGroup.createCommandGroup( null, new Object[]{revertCommand, finishCommand} );
    return group.createButtonBar( null, Borders.EMPTY_BORDER );
  }
View Full Code Here

   *
   * @return popup menu to show, or null if none
   */
  @Nullable
  protected JPopupMenu createPopupContextMenu() {
    CommandGroup commandGroup = getPopupCommandGroup();
    if ( commandGroup == null ) {
      return null;
    }
    return commandGroup.createPopupMenu();
  }
View Full Code Here

  public JPopupMenu createPopupMenu( @NotNull P parent, @NotNull C selectedChild, @NotNull MouseEvent e ) {
    if ( popupConfigurers.isEmpty() ) {
      return null;
    }

    CommandGroup group = new CommandGroup();

    for ( Iterator<PopupConfigurer<P, C>> it = popupConfigurers.iterator(); it.hasNext(); ) {
      PopupConfigurer<P, C> popupConfigurer = it.next();
      popupConfigurer.configure( group, parent, selectedChild, ( JTree ) e.getSource() ); //todo use MouseEvent(?)
      if ( it.hasNext() ) {
        group.addSeparator();
      }
    }

    return group.createPopupMenu();
  }
View Full Code Here

    List<? extends ActionCommand> toAdd = getCommands( objectTable );
    if ( toAdd == null || toAdd.isEmpty() ) {
      return;
    }

    CommandGroup group = objectTable.getPopupCommandGroup();
    if ( group == null ) {
      group = new CommandGroup();
    } else {
      group.addSeparator();
    }

    for ( ActionCommand command : toAdd ) {
      RcpSupport.configure( command );
      if ( command instanceof ApplicationWindowAware ) {
        ( ( ApplicationWindowAware ) command ).setApplicationWindow( SpringSupport.INSTANCE.getActiveApplicationWindow() );
      }
      group.add( command );
    }

    objectTable.setPopupCommandGroup( group );
  }
View Full Code Here

  }

  @Override
  @NotNull
  protected CommandGroup createDefaultCommandGroup() {
    CommandGroup commandGroup = getWindowCommandManager().createCommandGroup( getBeanType().getName() + ".commandGroup", new Object[0] );
    commandGroup.add( getWindowCommandManager().configure( getCommandFactory().getNewCommand() ) );
    commandGroup.add( getWindowCommandManager().configure( getCommandFactory().getPropertiesCommand() ) );
    commandGroup.add( getWindowCommandManager().configure( getCommandFactory().getDeleteCommand() ) );
    return commandGroup;
  }
View Full Code Here

  @NotNull
  public BeanPopupMenuCreator<T> getBeanPopupMenuCreator() {
    if ( beanPopupMenuCreator == null ) {
      beanPopupMenuCreator = new BeanPopupMenuCreator<T>() {
        public JPopupMenu createMenu( @NotNull BeanListView<T> beanListView ) {
          CommandGroup commandGroup = getWindowCommandManager().createCommandGroup( getBeanType().getName() + ".tablePopupGroup", new Object[0] );
          commandGroup.add( getWindowCommandManager().configure( getCommandFactory().getNewCommand() ) );
          if ( isSelectionNotEmpty() ) {
            commandGroup.add( getWindowCommandManager().configure( getCommandFactory().getPropertiesCommand() ) );
            commandGroup.add( getWindowCommandManager().configure( getCommandFactory().getDeleteCommand() ) );
          }
          return commandGroup.createPopupMenu();
        }
      };
    }
    return beanPopupMenuCreator;
  }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.command.CommandGroup

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.