The methods createButton, createMenuItem, ... are actually convenience methods :). You can create JButton without them too:
So we could omit those methods, but as I said, they're there for the convenience of the developer. The above method is even more elaborate when hooking an ActionCommand to a Button.Code:public static AbstractButton createAButton(AbstractCommand command)
{
ButtonFactory factory = (ButtonFactory) ApplicationServicesLocator.instance().getApplicationServices().getService(ButtonFactory.class);
CommandButtonConfigurer configurer = new DefaultCommandButtonConfigurer();
AbstractButton button = factory.createButton();
new CommandFaceButtonManager(command, command.getDefaultFaceDescriptorId()).attachAndConfigure(button, configurer);
button.setEnabled(command.isEnabled());
button.setVisible(command.isVisible());
return button;
}
