|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
ptolemy.vergil.toolbox.FigureAction
ptolemy.vergil.basic.GetDocumentationAction
public class GetDocumentationAction
This is an action that accesses the documentation for a Ptolemy object associated with a figure. Note that this base class does not put this action in a menu, since some derived classes will not want it. But by having it here, it is available to all derived classes. This class provides an action for removing instance-specific documentation.
Red (johnr) |
Red (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.vergil.toolbox.FigureAction |
---|
FigureAction.SourceType |
Field Summary | |
---|---|
protected Configuration |
_configuration
The configuration. |
private int |
_docPreference
Defines a preference for whether to display kepler documentation or ptolemy documentation. |
private Effigy |
_effigy
Defines the effigy to use if the effigy is not apparent from the model |
private static java.lang.String |
_lastClassName
The name of the last class for which we looked. |
Fields inherited from class ptolemy.vergil.toolbox.FigureAction |
---|
CANVAS_TYPE, CONTEXTMENU_TYPE, HOTKEY_TYPE, MENUBAR_TYPE, PASTE_OFFSET, TOOLBAR_TYPE |
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
GetDocumentationAction()
Construct an instance of this action. |
|
GetDocumentationAction(int docPreference)
Construct an instance and give a preference for whether the KeplerDocumentationAttribute or the docAttribute should be displayed if both exist. |
Method Summary | |
---|---|
private static boolean |
_isMultipleDocumentationAllowed()
Allow optional use of multiple documentation windows when the _multipleDocumentationAllowed attribute is found in the Configuration. |
private void |
_showDocAttributeTableau(DocAttribute docAttribute,
NamedObj target)
Find and show the tableau for a given DocAttribute. |
void |
actionPerformed(java.awt.event.ActionEvent e)
Perform the action by opening documentation for the target. |
static void |
getDocumentation(Configuration configuration,
java.lang.String className,
Effigy context)
Get the documentation for a particular class. |
void |
setConfiguration(Configuration configuration)
Set the configuration. |
void |
setEffigy(Effigy effigy)
Set the effigy to be used if the effigy is not evident from the model being edited. |
void |
showDocumentation(NamedObj target)
Show the documentation for a NamedObj. |
Methods inherited from class ptolemy.vergil.toolbox.FigureAction |
---|
getFigure, getFrame, getSourceType, getTarget, getX, getY, offsetFigure |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Configuration _configuration
private int _docPreference
private Effigy _effigy
private static java.lang.String _lastClassName
Constructor Detail |
---|
public GetDocumentationAction(int docPreference)
docPreference
- 0 for docAttribute, 1 for
KeplerDocumentationAttributepublic GetDocumentationAction()
Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent e)
DocBuilderGUI
.
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class FigureAction
e
- The event.public void showDocumentation(NamedObj target)
target
- The NamedObj that will have its documentation shown.public static void getDocumentation(Configuration configuration, java.lang.String className, Effigy context)
If the configuration has a parameter _docApplicationSpecializer and that parameter names a class that that implements the DocApplicationSpecializer interface, then we call docClassNameToURL().
If the documentation is not found, pop up a dialog and ask the
user if they would like to build the documentation, use the
website documentation or cancel. The location of the website
documentation is set by the _remoteDocumentationURLBase attribute
in the configuration. That attribute, if present, should be a
parameter that whose value is a string that represents the URL
where the documentation may be found. If the
_remoteDocumentationURLBase attribute is not set, then the
location of the website documentation defaults to
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII/Major.Version
,
where Major.Version
is the value returned by
VersionAttribute.majorCurrentVersion()
.
configuration
- The configuration.className
- The dot separated fully qualified name of the class.context
- The context.public void setConfiguration(Configuration configuration)
configuration
- The configuration.public void setEffigy(Effigy effigy)
effigy
- the effigy to set.private static boolean _isMultipleDocumentationAllowed()
private void _showDocAttributeTableau(DocAttribute docAttribute, NamedObj target)
docAttribute
- the attribute to showtarget
- the target of the documentation viewing
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |