Package org.springframework.richclient.command

Examples of org.springframework.richclient.command.ActionCommand


    return printFormObjectCommand;
  }

  public ActionCommand getPrintFieldsCommand() {
    if (printFieldsCommand == null) {
      printFieldsCommand = new ActionCommand(getPrintFieldsCommandFaceDescriptorId()) {

        protected void doExecuteCommand() {
          getMessageArea().append(getFieldsDetails(new StringBuilder(), getFormModel()).toString());
        }
      };
View Full Code Here


    return printFieldsCommand;
  }

  public ActionCommand getPrintFormModelCommand() {
    if (printFormModelCommand == null) {
      printFormModelCommand = new ActionCommand(getPrintFormModelCommandFaceDescriptorId()) {

        protected void doExecuteCommand() {
          getMessageArea().append(getFormModelDetails(new StringBuilder(), getFormModel()).toString());
        }
      };
View Full Code Here

    /**
     * Create the dataEditorCommand.
     */
    protected ActionCommand createDataEditorCommand()
    {
        ActionCommand selectDialogCommand = new ActionCommand(getSelectDialogCommandId())
        {

            private ApplicationDialog dataEditorDialog;

            @Override
View Full Code Here

     * <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

    }

    @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

    }

    @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

    }

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

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

    }

    @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

            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

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

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

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

TOP

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

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.