JGraphpad Pro
v6.0.5.0


com.jgraph.pad.factory
Class JGraphpadOpenRecentMenu

java.lang.Object
  extended bycom.jgraph.editor.factory.JGraphEditorFactoryMethod
      extended bycom.jgraph.pad.factory.JGraphpadOpenRecentMenu

public class JGraphpadOpenRecentMenu
extends JGraphEditorFactoryMethod

Menu to open the files stored under JGraphpad.KEY_RECENTFILES in the editor settings. This implementation is updated once on application start. It requires its list of entries in the settings to be updated by the respective file actions, namely open and save.


Field Summary
protected  JGraphEditor editor
          References the enclosing editor.
static String KEY_MENULABEL
          Specifies the resource key for the menu label.
static int MAX_DISPLAYLENGTH
          Specifies the maximum length of the filename to show.
static String NAME
          Defines the default name for factory methods of this kind.
 
Fields inherited from class com.jgraph.editor.factory.JGraphEditorFactoryMethod
name
 
Constructor Summary
JGraphpadOpenRecentMenu(JGraphEditor editor)
          Constructs a new factory method for the specified enclosing editor using NAME.
 
Method Summary
 Component createInstance(Node configuration)
          Constructs a new menu using the entries in the recent files list.
 
Methods inherited from class com.jgraph.editor.factory.JGraphEditorFactoryMethod
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static String NAME
Defines the default name for factory methods of this kind.


MAX_DISPLAYLENGTH

public static int MAX_DISPLAYLENGTH
Specifies the maximum length of the filename to show. Default is 30.


KEY_MENULABEL

public static String KEY_MENULABEL
Specifies the resource key for the menu label. Default is openRecentMenu.label.


editor

protected JGraphEditor editor
References the enclosing editor.

Constructor Detail

JGraphpadOpenRecentMenu

public JGraphpadOpenRecentMenu(JGraphEditor editor)
Constructs a new factory method for the specified enclosing editor using NAME.

Parameters:
editor - The editor that contains the factory method.
Method Detail

createInstance

public Component createInstance(Node configuration)
Constructs a new menu using the entries in the recent files list. Adds an action listener to each entry that invokes JGraphEditorModel.addFile(String) with the respective filename. The configuration parameter is currently ignored.

Specified by:
createInstance in class JGraphEditorFactoryMethod
Parameters:
configuration - The configuration to configure the menu with.
Returns:
Returns a new component.

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.