void createActions(){
....
actionsMap.put(CREATE_PROJECT., new BrowserCreateProjectAction(model));
}
public class BrowserCreateProjectAction
extends BrowserAction
{
/** Description of the action. */
private static final String DESCRIPTION = "Create a project";
/**
* Creates a new instance.
*
* @param model Reference to the Model. Mustn't be <code>null</code>.
*/
public BrowserCreateProjectAction(Browser model)
{
super(model);
setEnabled(true);
putValue(Action.SHORT_DESCRIPTION,
UIUtilities.formatToolTipText(DESCRIPTION));
IconManager im = IconManager.getInstance();
putValue(Action.SMALL_ICON, im.getIcon(IconManager.CREATE)); //or other icons
}
/**
* Displays the list of supported file formats.
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
public void actionPerformed(ActionEvent e)
{
model.createProject() // code you will have to be implement in Browser
}
}
Return to Developer Discussion
Users browsing this forum: No registered users and 0 guests