Examples of ActionCommand


Examples of org.springframework.richclient.command.ActionCommand

     * <li>disable/enable the command --> check if all buttons follow up on the changes</li>
     * </ol>
     */
    public void testMultifacedCommandDisabling()
    {
        ActionCommand command = new ActionCommand(MAIN_ID)
        {

            protected void doExecuteCommand()
            {
                // does nothing during this test anyway
            }
        };

        AbstractButton standardButton = command.createButton();

        // test this dude's enabling
        command.setEnabled(false);
        assertFalse("standard face button didn't follow up on the command's disabling", standardButton
                .isEnabled());
        command.setEnabled(true);
        assertTrue("standard face button didn't follow up on the command's enabling", standardButton
                .isEnabled());

        // register an alternative face to this command
        CommandFaceDescriptor face = new CommandFaceDescriptor();
        command.setFaceDescriptor(ALTERNATE_ID, face);

        // and get us a button with that face
        AbstractButton otherFacedButton = command.createButton(ALTERNATE_ID);

        // test this newly faced dude
        command.setEnabled(false);
        assertFalse("alternative face button didn't follow up on the command's disabling", otherFacedButton
                .isEnabled());
        command.setEnabled(true);
        assertTrue("alternative face button didn't follow up on the command's enabling", otherFacedButton
                .isEnabled());

    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

    }

    @Override
    protected AbstractCommand createAddCommand()
    {
        AbstractCommand addRow = new ActionCommand("addrow")
        {

            @Override
            protected void doExecuteCommand()
            {
                add(viewControllerObject);
            }
        };
        addRow.setSecurityControllerId(getAddCommandSecurityControllerId());
        RcpSupport.configure(addRow);
        return addRow;
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

    }

    @Override
    protected AbstractCommand createRemoveCommand()
    {
        AbstractCommand removeRow = new ActionCommand("removerow")
        {

            @Override
            protected void doExecuteCommand()
            {
                remove(viewControllerObject, table.getSelectedRows());
            }
        };
        removeRow.setSecurityControllerId(getRemoveCommandSecurityControllerId());
        RcpSupport.configure(removeRow);
        return removeRow;
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

    }

    @Override
    protected AbstractCommand createDetailCommand()
    {
        AbstractCommand detail = new ActionCommand("detailrow")
        {

            @Override
            protected void doExecuteCommand()
            {
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

    }

    @Override
    protected AbstractCommand createEditCommand()
    {
        ActionCommand editRow = new ActionCommand("editrow")
        {

            @Override
            protected void doExecuteCommand()
            {
                edit(table.getSelectedRows());
            }
        };
        editRow.setSecurityControllerId(getEditCommandSecurityControllerId());
        RcpSupport.configure(editRow);
        return editRow;
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

            sharedCommands = Collections.EMPTY_LIST;
        }
        else {
            this.sharedCommands = new ArrayList(sharedCommandIds.length);
            for (int i = 0; i < sharedCommandIds.length; i++) {
                ActionCommand globalCommand = createTargetableActionCommand(sharedCommandIds[i], null);
                sharedCommands.add(globalCommand);
            }
        }
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

      panel.add(createValidateCommand().createButton());
      return panel;
    }

    private ActionCommand createValidateCommand() {
      ActionCommand validateCommand = new ActionCommand("validateCommand") {

        protected void doExecuteCommand() {
          getFormModel().validate();
        }
      };
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

  /**
   * Returns an actionCommand that adds a column if possible. Maximum number
   * of rows is the number of headers as defined in constructor.
   */
  private ActionCommand createAddCommand() {
    ActionCommand addCommand = new ActionCommand("addCommand") {

      @Override
      protected void doExecuteCommand() {
        int columnCount = columnModel.getColumnCount();
        if (columnCount < (headers.size())) {
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

  /**
   * Returns an actionCommand removing a column.
   */
  private ActionCommand createRemoveCommand() {
    ActionCommand removeCommand = new ActionCommand("removeCommand") {

      @Override
      protected void doExecuteCommand() {
        int columnCount = columnModel.getColumnCount();
        if (columnCount > 0) {
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

      panel.add(createValidateCommand().createButton());
      return panel;
    }

    private ActionCommand createValidateCommand() {
      ActionCommand validateCommand = new ActionCommand("validateCommand") {

        protected void doExecuteCommand() {
          getFormModel().validate();
        }
      };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.