ActionPropertyEditorMockup

the Action Property Editor

This screen would be accessed by selecting a component in the form builder which has actions, such as a JButton, and then editing the action property on that component. Below is a mockup of this screen. Note that it needs serious cleanup to be smaller and look pretty.

http://wiki.netbeans.info/wiki/attach/ActionSupport/mediaplayer.MainScreenSnapz002.png


From this screen the user can select an action from the list of actions already available in the application (including standard prefab actions), as well as edit the properties of any action or create a new one.

  • the Select Mode dropdown is part of the standard property editor. Other options besides the Action Editor might be the property editor that allows the user to choose a method or property on the form which returns an =Action= object.
  • the Scope dropdown selects the scope of actions. It has two values: =Application Wide= and =Current Form=, indicating if actions should be pulled from the central =Application= class or from the current form. =Current Form= could be replaced by the name of the actual form. There could also be an =< All >= option which shows the merge of application and current form, with the current form overriding the application. This mirrors how it works in the app framework API.
  • the Available Actions dropdown lists the actual actions available in the currently selected scope. The actions are listed by action name, meaning their key in the action map. We could also list them by text, command name, or some combination. When an action is selected in this dropdown the rest of the fields below will be updated to reflect the settings of the action.
  • the New Action button will create a new action in the action map, clearing the fields below and providing good defaults.
  • the Locale dropdown selects the current locale for this action. When changed the text, tooltip, mnemonic, accellerator, and icon fields will update to reflect the current locale. The fields below the the line separator (enabled, selected, etc) will not be updated as they are not locale specific. Thought: there should be some sort of indicator if a given field is specified for this locale or simply inherited from the default locale.
  • the Text field sets the text displayed in componets which use this action. A JButton, for example, would use this value for it's text property. This field maps to the =Action.NAME= property.
  • the Tool Tip field sets the tooltip of the action. This tooltip will be used for components which support tooltips, namely buttons.
  • the Mnemonic Index field sets the numeric index of the character in the Text field to be used as a mnemonic. This field can probably be eliminated by supporting the ampersand notation or underscore notation in the Text field.
  • the Accelerator field lets the developer set the accelerator (hotkey) of this action. This field shoudl support a notation that is intuitive, which is not necessarily what is supported by =KeyStroke=. There should be a way to set this by platform in addition to locale.
  • the Small Icon panel contains the small icon to be used for menus and toolbars. When the user clicks on this icon a small file browser or other icon selector will be displayed, allowing the user to choose an icon. Note: there should be some notion of icon sets so that developers can simply install an icon pack that matches their preferred look and feel or platform.
  • the Large Icon panel contains the large icon to be used for toolbars and buttons. It will not be used for menus. When the user clicks on the icon a small browser will pop up, allowing the user to select an icon.

Below the horizontal divider are properties which are not locale specific. They are more 'code related' so I have grouped them together.

  • The Enabled field selects whether this action is enabled by default. It maps to the =Action.isEnabled()= property.
  • The Selected field selects whether this action is selected by default. It maps to the =Action.SELECTED_KEY= property.
  • The Asynchronous field selects whether this action should be run on an asynchronous thread or on the EDT. Changing this property will change the annotation on the action method.
  • The command string field sets the command string which will set on =!ActionEvents= produced by this action.
  • The method name field sets the actual method name on the form which will be converted into an action at runtime. I don't see a way to validate this field, or change it during refactoring.
  • The Jump to Code button will close this dialog, switch the editor to code view, then jump to the method for this action.
  • The ? will provide help about how to use this dialog.


I think what I have designed here is functional, but it's not pretty and it seems overly complicated. There are several levels of hierarchy which require nested panels. It feels confusing.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo