Package org.springframework.richclient.command

Examples of org.springframework.richclient.command.CommandGroup


  /**
   * Create a desktop pane context menu CommandGroup.
   * @return the context menu CommandGroup
   */
  public CommandGroup createContextMenuCommandGroup(CommandManager commandManager, JDesktopPane desktop) {
    CommandGroup commandGroup = new CommandGroup();

    TileCommand tileCommand = new TileCommand(desktop);
    CascadeCommand cascadeCommand = new CascadeCommand(desktop, cascadeOffset, cascadeResizesFrames);
    MinimizeAllCommand minimizeAllCommand = new MinimizeAllCommand(desktop);

    commandManager.configure(tileCommand);
    commandManager.configure(cascadeCommand);
    commandManager.configure(minimizeAllCommand);

    commandGroup.add(tileCommand);
    commandGroup.add(cascadeCommand);
    commandGroup.add(minimizeAllCommand);

    if (desktop.getAllFrames().length > 0) {
      commandGroup.addSeparator();
      // TODO try to get the frames in the order they've been added to the
      // desktop
      // pane instead of the current z-order.
      for (int i = 0; i < desktop.getAllFrames().length; i++) {
        JInternalFrame frame = desktop.getAllFrames()[i];

        ShowFrameCommand showFrameCommand = new ShowFrameCommand(frame);
        showFrameCommand.setIcon(frame.getFrameIcon());
        showFrameCommand.setCaption("" + frame.getTitle());

        String label = i + " " + frame.getTitle();
        if (i < 10) {
          label = "&" + label;
        }
        showFrameCommand.setLabel(label);

        commandGroup.add(showFrameCommand);
      }
    }
    return commandGroup;
  }
View Full Code Here


 
  public CommandGroup getCommandGroup(String name){
    JideApplicationLifecycleAdvisor advisor =
      ((JideApplicationLifecycleAdvisor)getApplication().getLifecycleAdvisor());
    CommandGroup commandGroup = advisor.getSpecificCommandGroup(name);
    return commandGroup;
  }
View Full Code Here

   *
   * @return
   */
  public JMenuBar getViewMenuBar(){

    CommandGroup commandGroup = getCommandGroup(getMenuBarCommandGroupName());
    if(commandGroup == null){
      return null;
    }
    return commandGroup.createMenuBar();
  }
View Full Code Here

   *
   * @return
   */
  public JComponent getViewToolBar(){

    CommandGroup commandGroup = getCommandGroup(getToolBarCommandGroupName());
    if(commandGroup == null){
      return null;
    }
    return commandGroup.createToolBar();
  }
View Full Code Here

    panel.add(reporter.getControl(), cc.xy(1, 1));
    AbstractCommand[] reporterCommands = reporter.getReporterCommands();
    AbstractCommand[] commandStack = new AbstractCommand[reporterCommands.length + 1];
    System.arraycopy(reporterCommands, 0, commandStack, 0, reporterCommands.length);
    commandStack[reporterCommands.length] = getClearTextAreaCommand();
    CommandGroup commandGroup = CommandGroup.createCommandGroup(commandStack);
    panel.add(commandGroup.createButtonStack(), cc.xy(3, 1));
    JScrollPane scrollPane = new JScrollPane(messageArea,
        ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panel, scrollPane);
    scrollPane.setPreferredSize(new Dimension(200, 100));
    return splitPane;
View Full Code Here

        return treeCellRenderer;
    }

    private JPopupMenu createOwnerPopupContextMenu() {
        // rename, separator, delete, addPet separator, properties
        CommandGroup group = getWindowCommandManager().createCommandGroup(
                "ownerViewTableOwnerCommandGroup",
                new Object[] {"renameCommand", "separator", "deleteCommand", "separator", newPetCommand, "separator",
                        "propertiesCommand"});
        return group.createPopupMenu();
    }
View Full Code Here

        return group.createPopupMenu();
    }

    private JPopupMenu createPetPopupContextMenu() {
        // rename, separator, delete, separator, properties
        CommandGroup group = getWindowCommandManager().createCommandGroup("ownerViewTablePetCommandGroup",
                new Object[] {"renameCommand", "separator", "deleteCommand", "separator", "propertiesCommand"});
        return group.createPopupMenu();
    }
View Full Code Here

        return newCommand;
    }

    public CommandGroup createCommandGroup(String groupId, Object[] members) {
        Assert.notNull(groupId, "Registered command groups must have an id.");
        CommandGroup newGroup = new CommandGroupFactoryBean(groupId, this.commandRegistry, this, members)
                .getCommandGroup();
        registerCommand(newGroup);
        return newGroup;
    }
View Full Code Here

   * layouts them on the panel.
   *
   * @return panel containing "Restore defaults" and "Apply" commands
   */
  protected JComponent createButtons() {
    CommandGroup commandGroup = CommandGroup.createCommandGroup(null,
        getCommands());
    JComponent buttonBar = commandGroup.createButtonBar();
    GuiStandardUtils.attachDialogBorder(buttonBar);

    return buttonBar;
  }
View Full Code Here

       
      }
     
      protected JPopupMenu getPopupMenu(MouseEvent e) {

      CommandGroup group =
          CommandGroup.createCommandGroup("searchResultsCommandGroup",
                  new Object[] {
              openBrowserCommand});
          JPopupMenu menu = group.createPopupMenu();    
          return menu;
      }
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.