Global Action List Design Document

The Global Action List is a screen where the developer can see and manage all actions throughout their application. From this screen they can add, delete, and edit actions, as well as sort and filter the actions to find the ones they are looking for.


This is a mockup showing the concepts listed in this document. It is only a mockup and does not fully render everything. For example, the icons are represented by letters. In the real implementation the actual icons would be drawn. This mockup also represents underlined characters by prepending them with underscores. Proper drawing will be used in the final implementation.



The global action list is a top compnent. It will be accessible from the the Window menu and dock to the bottom of the screen by default (is there a better side?). It can also be accessed from a context menu in the Project view. The global action list will be filtered by default based on the class or project selected when opening the context menu. The list can also be accessed using a button in the design view's toolbar.

Table columns

At it's heart the global action list is a table of actions with each column representing something about the action. The list is not editable by double clicking in cells. Instead actions must be editing using the Action Property Editor. More below.

The table has the following columns:

  • Name : the name of the action as defined by the @Action annotation on that action. This is the same name used to select actions in the property sheet and the action property editor.
  • Text: the text property of the action. Used for the text in menu items and jbuttons. It will be rendered with the mnemonic characters underlined.
  • Accelerator : (could also be called shortcut?) The accelerator property of the action. Used to define the shortcut key for buttons and menu items. Will be rendered the same way it would be in a menu item. (should we use the mac way with ^X vs the Windows way with ctrl-X?)
  • Icon : the icon property of the action. If the action has both a small and large icon, the large icon will be used. If the icon is larger than the height of the row it will be scaled down linearly. If the action has more than one icon the first one will be drawn and a badge will be drawn over it with a number indicating the total number of icons (can there ever be more than two icons?)
  • Class: the fully qualified classname of the class where the action is defined
  • method the name of the method defining this action
  • Asynchronous a check indicating if the task is asynchronous (rendered as an X in the mockup)
  • Component the fieldname of the component where this action is used. (should we have the FQCN of the class where the component field is defined?) alternative rather than listing the components here we could have a list on the side of the table which shows the components. The table and list would be put in a split pane. This makes it more clear and removes a table column at the expense of more visual clutter.


To add an action the developer must use the New Action button. This will open the Create New Action dialog from the Action Property Editor, modified to include a class selector. The developer will select the class to add the action to, as well as the method name to create and whether the action is asynchronous. If the developer has filtered the Global Action List to show only a single class' actions then the Create New Action dialog will have that class pre-selected. When the user completes the Create New Action dialog the Action Property Editor dialog will open so the user can further edit the action's properties. After pressing okay the user will come back to the action list and the list will be updated to show the new action. If the user cancels the Create New Action dialog then no action will be created and the user will return to the unmodified action list.


Actions can be created and deleted from this screen but not edited. To edit an action the user must use the Action Property Editor dialog. The user can open this dialog by double clicking on an action in the table or by selecing an action and then pressing the Edit Action button. This will open the Action Property Editor dialog where the user can modify any action properties. This is the same dialog the user would see if they were in design mode and edited the action property of a selected component, or used the Edit Action ... context menu on a selected component.

The user can jump to the code that defines the action by clicking on the method cell for that action. It will be rendered as a hyperlink. When the user clicks on it the list view will be hidden and the code buffer for the relevant class will be loaded and opened. The cursor will be positioned on the line of the annotated method.

The user can jump to the components that are using the action by clicking on the field name in the component column of the table. They will be rendered as hyperlinks. Clicking on them will hide the action list then open the relevant GUI form and select the component.


Actions can be deleted by selecting an action in the list and pressing the Delete Action button. This will delete all resources for the action and comment out the annotated method. This will not delete the action's method, since that would be dangerous. It will only comment it out. The action could also be manually removed by deleting the code in the text editor. The action list should update itself to reflect that the action is gone. In this case the resources would still exist unless the developer manually deleted those as well.

Sorting and Filtering

The table of actions can be sorted by clicking on the table headers. Each colum will be sorted alphabetically. This will require having a sortable table implementation since we cannot use the Java 6 JTable (which added sorting).

The table of actions can be filtered by changing the Class combo box. By default it is set to 'All', which will show all classes throughout the entire project which have actions in them. If a particular class is selected then the table will only show the actions defined in that particular class.

The table of actions can also be filtered by using the search field. This will do a realtime fulltext incremental search of all text properties of all actions throughout the entire project. The table will show the results of that search.

more notes

Tomas suggested making a left/right splitpane with the table on the left. On the right would be a list of components the action is attached to.

Joshua suggested making the Global Action List and the Action Property Editor share the same searching/indexing infrastructure. Tomas mentioned that it would be very slow to rescan the entire project, which is necessary when the developer manually adds actions through code. Instead he suggests we keep the infrastructure separate and only rescan the entire project for the global action list when the user presses a rescan button.

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