Package org.springframework.richclient.command.config

Examples of org.springframework.richclient.command.config.CommandFaceDescriptor


     * Updates this instance according to the properties provided by the
     * underlying command.
     */
    protected void update() {
        putValue(Action.ACTION_COMMAND_KEY, command.getActionCommand());
        CommandFaceDescriptor face = command.getFaceDescriptor();
        if (face != null) {
            face.configure(this);
        }
        setEnabled(command.isEnabled());
    }
View Full Code Here


    protected void configure(AbstractButton button, CommandButtonConfigurer strategy) {
        if (this.faceDescriptor == null) {
            if (command.getFaceDescriptorRegistry() != null) {
                setFaceDescriptor(command.getFaceDescriptorRegistry().getFaceDescriptor(command, faceDescriptorId));
            } else {
                setFaceDescriptor(new CommandFaceDescriptor());
            }
        }

        getFaceDescriptor().configure(button, command, strategy);
    }
View Full Code Here

   * @param id
   * @param encodedLabel label to use when creating the default
   * {@link CommandFaceDescriptor}.
   */
  protected AbstractCommand(String id, String encodedLabel) {
    this(id, new CommandFaceDescriptor(encodedLabel));
  }
View Full Code Here

   * @param encodedLabel label for the default {@link CommandFaceDescriptor}.
   * @param icon icon for the default {@link CommandFaceDescriptor}.
   * @param caption caption for the default {@link CommandFaceDescriptor}.
   */
  protected AbstractCommand(String id, String encodedLabel, Icon icon, String caption) {
    this(id, new CommandFaceDescriptor(encodedLabel, icon, caption));
  }
View Full Code Here

    Assert.notNull(faceDescriptors);
    Iterator it = faceDescriptors.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry entry = (Map.Entry) it.next();
      String faceDescriptorId = (String) entry.getKey();
      CommandFaceDescriptor faceDescriptor = (CommandFaceDescriptor) entry.getValue();
      setFaceDescriptor(faceDescriptorId, faceDescriptor);
    }
  }
View Full Code Here

    if (!isFaceConfigured()) {
      if (logger.isInfoEnabled()) {
        logger.info("Lazily instantiating default face descriptor on behalf of caller to prevent npe; "
            + "command is being configured manually, right?");
      }
      setFaceDescriptor(new CommandFaceDescriptor());
    }
    return getFaceDescriptor();
  }
View Full Code Here

        enableTests(testCommand, new Object[]{face1button, face2button, face3button});
    }
   
    private void registerCommandFaceDescriptor(String faceId, AbstractCommand command)
    {
        CommandFaceDescriptor face = new CommandFaceDescriptor();
        ApplicationObjectConfigurer configurer = (ApplicationObjectConfigurer)ApplicationServicesLocator.services().getService(ApplicationObjectConfigurer.class);
        configurer.configure(face, faceId);
        command.setFaceDescriptor(faceId, face);       
    }
View Full Code Here

    for ( Iterator<Collection<? extends ActionCommand>> it = commands.iterator(); it.hasNext(); ) {
      Collection<? extends ActionCommand> commandsCollection = it.next();
      for ( ActionCommand command : commandsCollection ) {
        commandConfigurer.configure( command );

        CommandFaceDescriptor face = new CommandFaceDescriptor();
        configurer.configure( face, command.getId() + '.' + COMMANDS_FACE_ID );
        command.setFaceDescriptor( COMMANDS_FACE_ID, face );

        buttonPanel.add( command.createButton( COMMANDS_FACE_ID, bf, commandsBarButtonConfigurer ) );
      }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.command.config.CommandFaceDescriptor

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.