|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.gui.AbstractApplication
public abstract class AbstractApplication
An abstract implementation of the Application interface. This class implements the common elements of the Application abstraction, and takes care of listener notification for documents and properties. Concrete subclasses will generally override a number of these methods to add their own behavior. Most importantly, this abstract class does not provide any support for creating documents, or managing the views of those documents. For an example of one way of managing the view associated with a document, see MDIApplication.
Constructor Summary | |
---|---|
AbstractApplication(AppContext context)
Create an abstract application that resides in the given context (e.g. |
Method Summary | |
---|---|
Iterator |
actions()
Get an iterator over the names of the actions that are contained by this application. |
void |
addAction(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(ListDataListener listener)
Add a document listener to this application. |
JMenuItem |
addMenuItem(JMenu menu,
Action action,
int mnemonic,
String tooltip)
Deprecated. Use method in GUIUtilities instead. |
JMenuItem |
addMenuItem(JMenu menu,
String label,
Action action,
int mnemonic,
String tooltip,
boolean isEnabled)
Deprecated. Use method in GUIUtilities instead. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this application. |
JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
Icon icon)
Deprecated. Use method in GUIUtilities instead. |
JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
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(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. |
List |
documentList()
Get list of all document objects known by this application. |
Action |
getAction(String name)
Get an action by name. |
AppContext |
getAppContext()
Get the frame that this application draws itself in. |
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 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(ListDataListener listener)
Remove a document list listener from this application. |
void |
removePropertyChangeListener(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(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(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(String op,
Exception e)
Show an error in a dialog box with stack trace. |
List |
viewList()
Get a list of all view objects known by this application. |
List |
viewList(Document d)
Get a list of all view objects known by this application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractApplication(AppContext context)
Method Detail |
---|
public Iterator actions()
actions
in interface Application
public void addAction(Action action)
addAction
in interface Application
public JMenuItem addMenuItem(JMenu menu, Action action, int mnemonic, String tooltip)
public JMenuItem addMenuItem(JMenu menu, String label, Action action, int mnemonic, String tooltip, boolean isEnabled)
public JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, Icon icon)
public JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, Icon icon, boolean isEnabled)
public void addPropertyChangeListener(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(ListDataListener listener)
addDocumentListener
in interface Application
public void addViewListener(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 List documentList()
documentList
in interface Application
public Action getAction(String name)
getAction
in interface Application
public AppContext getAppContext()
getAppContext
in interface Application
public 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 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(ListDataListener listener)
removeDocumentListener
in interface Application
public void removeViewListener(ListDataListener listener)
removeViewListener
in interface Application
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface Application
public void setClipboard(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(String op, Exception e)
showError
in interface Application
protected void setAppContext(AppContext ac)
public List viewList()
viewList
in interface Application
public List viewList(Document d)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |