|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GUIApplication
An interface for a generic GUI application. Your Swing application can
override AbstractGUIApplication
to have some of its
basic code already implemented.
This class provides the framework for a GUI application having the following features:
Exceptions
and report them to
the user.
AbstractGUIApplication
,
AbstractPluggableGUIApplication
Nested Class Summary | |
---|---|
static class |
GUIApplication.AboutAction
The action that displays the application's About dialog. |
static class |
GUIApplication.ExitAction
Action that attempts to close the application. |
static class |
GUIApplication.HelpAction
The action that displays the application's Help dialog. |
static class |
GUIApplication.ToggleStatusBarAction
Action to toggle a GUIApplication 's status bar. |
static class |
GUIApplication.ToggleToolBarAction
Action to toggle a GUIApplication 's toolbar. |
Field Summary |
---|
Fields inherited from interface org.fife.ui.app.GUIApplicationConstants |
---|
OS_LINUX, OS_MAC_OSX, OS_OTHER, OS_WINDOWS |
Fields inherited from interface org.fife.ui.dockablewindows.DockableWindowConstants |
---|
BOTTOM, FLOATING, LEFT, RIGHT, TOP |
Method Summary | |
---|---|
void |
addAction(java.lang.String key,
javax.swing.Action action)
Adds an action to this application's action map. |
void |
displayException(java.awt.Dialog dialog,
java.lang.Throwable t)
This method should be overridden to convey to the user that an Exception occurred in some way, for example, in a dialog box. |
void |
displayException(java.awt.Frame frame,
java.lang.Throwable t)
This method should be overridden to convey to the user that an Exception occurred in some way, for example, in a dialog box. |
void |
displayException(java.lang.Throwable t)
This method should be overridden to convey to the user that an Exception occurred in some way, for example, in a dialog box. |
void |
doExit()
Called when the user attempts to close the application, whether from an "Exit" menu item, closing the main application window, or any other means. |
javax.swing.JDialog |
getAboutDialog()
Returns the About dialog for this application. |
javax.swing.Action |
getAction(java.lang.String key)
Returns one of this application's actions. |
java.util.SortedSet<java.lang.String> |
getActionKeys()
Returns the keys of all actions known to this application. |
javax.swing.Action[] |
getActions()
Returns the actions of this GUI application as an array. |
HelpDialog |
getHelpDialog()
Returns the Help dialog for this application, or null
if this application does not have a Help dialog. |
java.awt.Image |
getIconImage()
Return the image used for the icon of this GUI application. |
java.lang.String |
getInstallLocation()
Returns the directory in which this GUI application is installed (running). |
javax.swing.JMenuBar |
getJMenuBar()
Returns the menu bar this application is using. |
java.lang.String |
getLanguage()
Returns the language used by this GUI application, in a Locale -friendly language string; e.g., en
or es . |
int |
getOS()
Returns an integer constant representing the OS. |
java.util.ResourceBundle |
getResourceBundle()
Returns the resource bundle associated with this application. |
StatusBar |
getStatusBar()
Returns the status bar this application is using. |
boolean |
getStatusBarVisible()
Returns whether the status bar is visible. |
CustomizableToolBar |
getToolBar()
Returns the toolbar this application is using. |
boolean |
getToolBarVisible()
Returns whether the toolbar is visible in this application. |
java.lang.String |
getVersionString()
Returns the version string for this application. |
boolean |
isMaximized()
Returns true if this application's main window is maximized. |
GUIApplicationPreferences |
loadPreferences()
Loads the preferences for this GUI application. |
void |
pack()
Repacks the GUI application's main window. |
void |
setJMenuBar(javax.swing.JMenuBar menuBar)
Sets the menu bar to use in this application. |
void |
setLanguage(java.lang.String language)
Sets the language for this GUI application and all of its dialogs, UI widgets, etc. |
void |
setStatusBar(StatusBar statusBar)
Sets the status bar to use in this application. |
void |
setStatusBarVisible(boolean visible)
Sets whether the status bar is visible. |
void |
setToolBar(CustomizableToolBar toolBar)
Sets the toolbar used by this GUI application. |
void |
setToolBarVisible(boolean visible)
Sets whether the toolbar used by this GUI application is visible. |
Method Detail |
---|
void addAction(java.lang.String key, javax.swing.Action action)
key
- The key with which to fetch the action via
getAction
.action
- The action to add.getAction(String)
void displayException(java.lang.Throwable t)
t
- The exception/throwable that occurred.void displayException(java.awt.Dialog dialog, java.lang.Throwable t)
dialog
- The child dialog that threw the Exception.t
- The exception/throwable that occurred.void displayException(java.awt.Frame frame, java.lang.Throwable t)
frame
- The child frame that threw the Exception.t
- The exception/throwable that occurred.void doExit()
javax.swing.JDialog getAboutDialog()
AboutDialog
javax.swing.Action getAction(java.lang.String key)
null
if no action exists for the
specified key.addAction(String, Action)
,
getActions()
java.util.SortedSet<java.lang.String> getActionKeys()
getAction(String)
javax.swing.Action[] getActions()
getAction(String)
HelpDialog getHelpDialog()
null
if this application does not have a Help dialog.
java.awt.Image getIconImage()
java.lang.String getInstallLocation()
javax.swing.JMenuBar getJMenuBar()
setJMenuBar(javax.swing.JMenuBar)
java.lang.String getLanguage()
Locale
-friendly language string; e.g., en
or es
.
int getOS()
java.util.ResourceBundle getResourceBundle()
StatusBar getStatusBar()
setStatusBar(org.fife.ui.StatusBar)
boolean getStatusBarVisible()
setStatusBarVisible(boolean)
CustomizableToolBar getToolBar()
setToolBar(org.fife.ui.CustomizableToolBar)
boolean getToolBarVisible()
setToolBarVisible(boolean)
java.lang.String getVersionString()
boolean isMaximized()
true
if this applicaiton's window is maximized, or
false
if it isn't.GUIApplicationPreferences loadPreferences()
null
is
goes wrong, null
is returned.
void pack()
void setJMenuBar(javax.swing.JMenuBar menuBar)
menuBar
- The menu bar.getJMenuBar()
void setLanguage(java.lang.String language)
language
- The language to use. If null
,
English will be used.void setStatusBar(StatusBar statusBar)
statusBar
- The status bar to use.getStatusBar()
void setStatusBarVisible(boolean visible)
visible
- Whether the status bar is to be visible.getStatusBarVisible()
void setToolBar(CustomizableToolBar toolBar)
toolBar
- The toolbar to use.getToolBar()
void setToolBarVisible(boolean visible)
visible
- Whether the toolbar should be visible.getToolBarVisible()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |