TOC PREV NEXT INDEX



Modifying existing actions


In addition to creating new classes extending the Action class, users can easily change existing classes by extending them. In this example, the Refresh menu item (under the Edit menu) will be modified. First a new class will be created which extends RefreshAction, then the modifications to the IDEmenu.config file will be shown.

First the BeepAndRefreshAction class must be created and compiled:

import java.awt.event*;
import datarep.ide.config.RefreshAction;
public class BeepAndRefreshAction extends RefreshAction {
public void actionPerformed(ActionEvent event) {
getToolkit().beep();
super.actionPerformed(event);
}
}

Next the following change must be made to the IDEmenu.config file. The tag which reads

<action class=datarep.ide.config.RefreshAction>

should be replaced with

<action class=BeepAndRefreshAction>

Now whenever the Refresh item is chosen from the Edit menu, the user will hear a beep before the refresh occurs. Although this example was simple, more complex classes could be created.


Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX