public abstract class AbstractApplication extends java.lang.Object implements Application
Red |
Constructor and Description |
---|
AbstractApplication(AppContext context)
Create an abstract application that resides
in the given context (e.g. a frame or an applet).
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
actions()
Get an iterator over the names of the actions that are
contained by this application.
|
void |
addAction(javax.swing.Action action)
Add an action to the table of actions.
|
void |
addDocument(Document d)
Add a document to the list of documents currently known by
this application.
|
void |
addDocumentListener(javax.swing.event.ListDataListener listener)
Add a document listener to this application.
|
javax.swing.JMenuItem |
addMenuItem(javax.swing.JMenu menu,
javax.swing.Action action,
int mnemonic,
java.lang.String tooltip)
Deprecated.
Use method in GUIUtilities instead.
|
javax.swing.JMenuItem |
addMenuItem(javax.swing.JMenu menu,
java.lang.String label,
javax.swing.Action action,
int mnemonic,
java.lang.String tooltip,
boolean isEnabled)
Deprecated.
Use method in GUIUtilities instead.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this application.
|
javax.swing.JButton |
addToolBarButton(javax.swing.JToolBar toolbar,
javax.swing.Action action,
java.lang.String tooltip,
javax.swing.Icon icon)
Deprecated.
Use method in GUIUtilities instead.
|
javax.swing.JButton |
addToolBarButton(javax.swing.JToolBar toolbar,
javax.swing.Action action,
java.lang.String tooltip,
javax.swing.Icon icon,
boolean isEnabled)
Deprecated.
Use method in GUIUtilities instead.
|
void |
addView(View v)
Add a view to the list of views currently known by
this application.
|
void |
addViewListener(javax.swing.event.ListDataListener listener)
Add a view listener to this application.
|
boolean |
closeDocument(Document d)
Try to close the given document using the
storage policy.
|
boolean |
closeView(View v)
Try to close the given view using the storage policy.
|
abstract View |
createView(Document d)
Create a view to display the given document.
|
java.util.List |
documentList()
Get list of all document objects known by this
application.
|
javax.swing.Action |
getAction(java.lang.String name)
Get an action by name.
|
AppContext |
getAppContext()
Get the frame that this application draws itself in.
|
java.awt.datatransfer.Clipboard |
getClipboard()
Get the clipboard object for this application.
|
View |
getCurrentView()
Get the current view.
|
DocumentFactory |
getDocumentFactory()
Get the factory that creates new documents
|
RelativeBundle |
getResources()
Get the resources object.
|
StoragePolicy |
getStoragePolicy()
Get the storage policy of this application.
|
abstract java.lang.String |
getTitle()
Get the title of this application
|
boolean |
isVisible()
Test whether the application frame is visible.
|
void |
removeDocument(Document d)
Remove a document from the list of documents currently known
by this application, and remove all of the views associated with
this document.
|
void |
removeDocumentListener(javax.swing.event.ListDataListener listener)
Remove a document list listener from this application.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this application.
|
void |
removeView(View v)
Remove a view from the list of views currently known by this
application.
|
void |
removeViewListener(javax.swing.event.ListDataListener listener)
Remove a view list listener from this application.
|
protected void |
setAppContext(AppContext ac)
Set the app context that this application draws itself in.
|
void |
setClipboard(java.awt.datatransfer.Clipboard clipboard)
Set the clipboard that is used by this application.
|
void |
setCurrentView(View v)
Set the given view to be the current view.
|
protected void |
setDocumentFactory(DocumentFactory df)
Set the factory that creates new documents for use by subclasses
constructors only.
|
void |
setStoragePolicy(StoragePolicy sp)
Set the storage policy of this application, for use by subclass
constructors only
|
void |
setVisible(boolean visible)
Set the visibility of the application's frame
|
void |
showError(java.lang.String op,
java.lang.Exception e)
Show an error in a dialog box with stack trace.
|
java.util.List |
viewList()
Get a list of all view objects known by this
application.
|
java.util.List |
viewList(Document d)
Get a list of all view objects known by this
application.
|
public AbstractApplication(AppContext context)
public java.util.Iterator actions()
actions
in interface Application
public void addAction(javax.swing.Action action)
addAction
in interface Application
@Deprecated public javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, javax.swing.Action action, int mnemonic, java.lang.String tooltip)
@Deprecated public javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, java.lang.String label, javax.swing.Action action, int mnemonic, java.lang.String tooltip, boolean isEnabled)
@Deprecated public javax.swing.JButton addToolBarButton(javax.swing.JToolBar toolbar, javax.swing.Action action, java.lang.String tooltip, javax.swing.Icon icon)
@Deprecated public javax.swing.JButton addToolBarButton(javax.swing.JToolBar toolbar, javax.swing.Action action, java.lang.String tooltip, javax.swing.Icon icon, boolean isEnabled)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface Application
public void addDocument(Document d)
addDocument
in interface Application
public void addView(View v)
addView
in interface Application
public void addDocumentListener(javax.swing.event.ListDataListener listener)
addDocumentListener
in interface Application
public void addViewListener(javax.swing.event.ListDataListener listener)
addViewListener
in interface Application
public boolean closeDocument(Document d)
closeDocument
in interface Application
public boolean closeView(View v)
closeView
in interface Application
public abstract View createView(Document d)
createView
in interface Application
public java.util.List documentList()
documentList
in interface Application
public javax.swing.Action getAction(java.lang.String name)
getAction
in interface Application
public AppContext getAppContext()
getAppContext
in interface Application
public java.awt.datatransfer.Clipboard getClipboard()
getClipboard
in interface Application
public View getCurrentView()
getCurrentView
in interface Application
public DocumentFactory getDocumentFactory()
getDocumentFactory
in interface Application
public RelativeBundle getResources()
public StoragePolicy getStoragePolicy()
getStoragePolicy
in interface Application
public abstract java.lang.String getTitle()
getTitle
in interface Application
public boolean isVisible()
isVisible
in interface Application
public void removeDocument(Document d)
removeDocument
in interface Application
public void removeView(View v)
removeView
in interface Application
public void removeDocumentListener(javax.swing.event.ListDataListener listener)
removeDocumentListener
in interface Application
public void removeViewListener(javax.swing.event.ListDataListener listener)
removeViewListener
in interface Application
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Application
public void setClipboard(java.awt.datatransfer.Clipboard clipboard)
setClipboard(Toolkit.getDefaultToolkit().getSystemClipboard())
public void setCurrentView(View v)
setCurrentView
in interface Application
protected void setDocumentFactory(DocumentFactory df)
public void setStoragePolicy(StoragePolicy sp)
public void setVisible(boolean visible)
setVisible
in interface Application
public void showError(java.lang.String op, java.lang.Exception e)
showError
in interface Application
protected void setAppContext(AppContext ac)
public java.util.List viewList()
viewList
in interface Application
public java.util.List viewList(Document d)