public abstract class AbstractMDIApplication extends AbstractApplication implements TabbedApplication
MDIApplication
implementation, which have a GUI. It provides:
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractMDIApplication.MDIFrame |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<MDIApplicationListener> |
appListeners
The list of application listeners registeed in the Application.
|
protected SwingMessageArea |
message
The MDIApplication associated Message Area.
|
protected MDIMenuFactory |
mfactory
The MDIApplication associated Menu Factory.
|
protected java.util.Map<java.lang.String,java.lang.String> |
nameToTab
This Maps the real name of the element in the tab to the tab name.
|
protected java.util.Map<java.lang.String,SwingFileProperties> |
properties
The properties Map.
|
protected StatusBar |
statusBar
The MDIApplication associated Status bar.
|
protected javax.swing.JTabbedPane |
tab
Tabbed pane containing the panels imported or created by the application
|
protected java.util.Map<java.lang.String,javax.swing.JComponent> |
tablist
The tab list.
|
protected java.util.Map<java.lang.String,java.lang.String> |
tabToName
This Maps the tab name to the real name of the element in the tab.
|
additionalPluginTypes, allowedPluginTypes, appDesc, argsMap, commandLineHandler, conf, confmanager, customActions, errorLogger, plugins, pluginsConfiguration, pluginsDefInFile, pluginsDir, pluginsManager, pluginsMap, queue, time
Constructor and Description |
---|
AbstractMDIApplication()
Constructor, with a default title.
|
AbstractMDIApplication(java.lang.String title)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptRemoveTab(java.lang.String name)
Return true if the tab of the specified name can be removed.
|
void |
addApplicationListener(MDIApplicationListener listener)
Add an application listener.
|
SwingFileProperties |
addTab(javax.swing.JComponent comp,
javax.swing.Icon icon,
java.lang.Object obj,
java.lang.String name,
java.lang.String tooltip)
Add an undefined tab.
|
SwingFileProperties |
addTab(javax.swing.JComponent comp,
javax.swing.Icon icon,
SwingFileProperties prop,
java.lang.String tooltip)
Add a tab with a specified name and panel.
|
void |
applyDialog(MDIDialog dialog)
Apply a dialog.
|
void |
cancelDialog(MDIDialog dialog)
Cancel a dialog.
|
void |
closeAllTabs()
Close all tabs.
|
void |
closeAllTabs(boolean forceClose)
Close all tabs.
|
void |
closeCurrentTab()
Close the currently opened Tab.
|
void |
closeCurrentTab(boolean forceClose)
Close the currently opened Tab.
|
void |
closeOtherTabs()
Close all Tabs except the current one.
|
protected ThreadQueue |
createThreadQueue()
Create the ThreadQueue.
|
void |
dispose()
Provided for convenience.
|
void |
endAction(MDIAction action)
Ends a generic action.
|
void |
executeAction(MDIAction action,
short blockingType)
Execute a generic Action.
|
void |
executeAction(MDIAction action,
short blockingType,
java.lang.ClassLoader loader)
Execute a generic Action, using a specific Classloader.
|
protected void |
fireTabChanged(SwingFileProperties prop)
Fired when the current selected Tab change.
|
protected void |
fireTabRemoved(SwingFileProperties prop)
Fired when a tab is removed.
|
java.util.List<MDIApplicationListener> |
getApplicationListeners()
Return the list of application listeners.
|
javax.swing.JFrame |
getApplicationWindow()
Return the frame.
|
java.util.Map<java.lang.String,SwingFileProperties> |
getCompatibleTabs(MetaData properties,
boolean excludeSelected)
Return all the panels that are compatible with the given properties Map.
|
javax.swing.JComponent |
getComponent(java.lang.Object object)
Return the Tab component for the specified object.
|
javax.swing.JComponent |
getComponent(java.lang.String name)
Return the panel of the specified name, or null if there is no panel with this name.
|
MDIDialogType |
getDefaultDialogOpenType()
Return the default dialog opening type.
|
MDIDialogHelper |
getDialogHelper()
Return the dialog helper.
|
SwingFileProperties |
getFileProperties(java.lang.Object object)
Return the FileProperties for the specified object.
|
javax.swing.JMenuBar |
getMenuBar()
Return the menu bar.
|
MDIMenuFactory |
getMenuFactory()
Return the associated menu factory.
|
SwingMessageArea |
getMessageArea()
Return the MDIApplication Message Area.
|
PluginsEDTSupport |
getPluginsEDTSupport(PluginsManager manager)
Return the Swing support class for the GUI initialization of Plugins.
|
SwingFileProperties |
getProperties(java.lang.String name)
Return the FileProperties for a tab of a specified name.
|
java.lang.String |
getRealNameForTab(java.lang.String tabName)
Return the real name corresponding with a tab name.
|
javax.swing.JComponent |
getSelectedComponent()
Return the selected component.
|
SwingFileProperties |
getSelectedProperties()
Return the FileProperties for the selected tab.
|
StatusBar |
getStatusBar()
Return the Statusbar associated with the main window, and create it before if it does not exist.
|
javax.swing.JTabbedPane |
getTabbedPane()
Return the tabbed pane used by the MDI Application.
|
int |
getTabCount()
Return the number of tabs.
|
java.lang.String |
getTabDisplayedName(java.lang.String name)
Return the displayed tab name corresponding with a name.
|
java.util.Map<java.lang.String,javax.swing.JComponent> |
getTabList()
Return the list of tabs as a Map, associating the tabs names with their Component.
|
java.util.Map<java.lang.String,SwingFileProperties> |
getTabPropertiesList()
Return the list of tabs properties as a Map.
|
java.lang.String |
getTitle()
Return the GUI frame title
|
javax.swing.JPanel |
getToolBarPanel()
Return the panel containing the toolbars.
|
protected java.lang.String |
getUnusedName(java.lang.String name)
Return an unused name beginning with the name String.
|
boolean |
hasClosableTab(boolean hasClosableTab)
Try to define this application as having closable tabs.
|
boolean |
hasSelectedTab()
Return true if there is a selected tab.
|
boolean |
hasTab(java.lang.String name)
Return true if the application has a tab of a specified name.
|
protected boolean |
isChangeTabsAllowed()
Return true if future changes in tabs must be listened to trigger Application actions.
|
boolean |
isClosableTab()
Return true if this applications use tabs closable with a button on the tabs header.
|
boolean |
isDialogOpened(MDIDialog dialog)
Return true if a dialog is currently opened.
|
boolean |
isModified(java.lang.String name)
Return true if the tab is modified.
|
protected void |
manageTabs(java.awt.event.MouseEvent e) |
void |
noTimeMessages()
Avoid to write time in messages for the current MDIAction.
|
void |
noWriteMessages()
Avoid to write messages for the current MDIAction.
|
protected void |
preparePanels()
The last method called for preparing the panels of the application.
|
protected void |
preparePanels(boolean hasStatusbar,
boolean hasToolBar,
MDIMenuFactory mfactory)
Prepare the various panels of the MDIApplication, wihtout any Message Area.
|
protected void |
preparePanels(int messageAreaSize,
boolean hasStatusbar,
boolean hasToolBar,
MDIMenuFactory mfactory)
Prepare the various panels of the MDIApplication.
|
protected void |
preparePanels(int messageAreaSize,
MDIMenuFactory mfactory)
Prepare the various panels of the MDIApplication, with a message area, a toolbar, and a status bar.
|
protected void |
preparePanels(SwingMessageArea area,
boolean hasStatusbar,
boolean hasToolBar,
MDIMenuFactory mfactory)
Prepare the various panels of the MDIApplication.
|
boolean |
removeApplicationListener(MDIApplicationListener listener)
Remove an application listener.
|
SwingFileProperties |
removeSelectedTab()
Remove the currently selected tab.
|
SwingFileProperties |
removeTab(java.lang.String name)
Remove a tab of the specified name.
|
void |
renameTab(java.lang.String oldName,
java.lang.String newName)
Rename a tab of the specified name.
|
protected void |
setChangeTabsAllowed(boolean changeTabsAllowed)
Set if future changes in tabs must be listened to trigger Application actions.
|
boolean |
setCloseBackground(java.awt.Color color)
Set the close button background color when the close button is focused.
|
boolean |
setCloseIcon(javax.swing.Icon icon)
Set the close Icon for the tabs header, and try to define this application as having a closable tab.
|
boolean |
setCloseIcon(java.net.URL icon)
Set the close Icon for the tabs header, and try to define this application as having a closable tab.
|
boolean |
setComponenAt(java.lang.String name,
javax.swing.JComponent comp)
Set the component to use for a selected Tab name.
|
void |
setCurrentTabModified(boolean isModified)
Set the modified state of the currently selected tab.
|
boolean |
setDefaultCloseIcon()
Use the default icon for the close button.
|
void |
setDefaultDialogOpenType(MDIDialogType openType)
Set the default dialog opening type.
|
void |
setDialogHelper(MDIDialogHelper helper)
Set the dialog helper.
|
void |
setMenuFactory(MDIMenuFactory mfactory)
Set the associated menu factory.
|
protected void |
setMessageArea(SwingMessageArea message)
Set the MDIApplication Message Area.
|
void |
setModified(java.lang.String name,
boolean isModified)
Set the modified state of a tab.
|
SwingFileProperties |
setSelectedTab(java.lang.String name)
Set the selected tab.
|
void |
setSize(int width,
int height)
Provided for convenience.
|
void |
setTitle(java.lang.String title)
Set the GUI frame title.
|
void |
setVisible(boolean visible)
Provided for convenience.
|
void |
showActionException(java.lang.String message,
java.lang.Exception e)
Show the Exception stackTrace by default.
|
int |
showDialog(MDIDialog dialog)
Show a dialog, with the default dialog opening type.
|
int |
showDialog(MDIDialog dialog,
javax.swing.AbstractAction action)
Show a dialog, with the default dialog opening type.
|
int |
showDialog(MDIDialog dialog,
javax.swing.AbstractAction action,
MDIDialogType openType)
Show a dialog.
|
int |
showDialog(MDIDialogBuilder builder)
Show a dialog.
|
int |
showDialog(MDIDialogBuilder builder,
MDIDialogType openType)
Show a dialog.
|
int |
showDialog(MDIDialog dialog,
MDIDialogType openType)
Show a dialog.
|
int |
showMessageDialog(java.lang.String title,
int messageType,
boolean isModal,
boolean isResizable,
java.lang.String... messages)
Show a message dialog, with an OK button.
|
void |
startTime(MDIAction action)
Start to count the time for the last operation, and show the statusBar progress.
|
long |
stopTime(MDIAction action)
Return the time after the last operation and stop the progress bar if there is any.
|
void |
updateUI()
Update the UI of the application content
|
addAdditionalPluginType, addCustomAction, addPluginDirectory, applyCommandLineArguments, disposeApplication, executeCustomAction, executeCustomAction, getAdditionalPluginTypes, getAllowedPluginTypes, getApplicationDesc, getCommandLineArguments, getCommandLineHandler, getConfigurationManager, getErrorLogger, getPlugin, getPluginForName, getPlugins, getPluginsManager, getPluginsMap, getThreadQueue, getTime, hasPlugin, hasPluginsDirectories, hasPluginsDirectoryList, hasSinglePluginsDirectory, initConfiguration, initConfiguration, initConfiguration, initConfiguration, initConfiguration, initProcessFromRegister, isDefaultBlockingActions, loadResources, pluginsActionPerformed, registerPlugins, serializeConfiguration, setAllowedPluginTypes, setCommandLineArguments, setCommandLineArguments, setCommandLineArguments, setCommandLineHandler, setConfiguration, setDefaultBlockingActions, setErrorLogger, setPluginsConfiguration, setPluginsConfiguration, setPluginsConfigurationFile
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTab, addTab, addTab, addTab
showMessageDialog, showMessageDialog, updateMenus
disposeApplication, executeAction, executeAction, getAdditionalPluginTypes, getAllowedPluginTypes, getApplicationDesc, getApplicationID, getCommandLineArguments, getConfigurationManager, getErrorLogger, getPlugin, getPluginForName, getPlugins, getPluginsManager, getPluginsMap, getStartDirectory, getTime, hasPlugin, isDefaultBlockingActions, setDefaultBlockingActions
getCommandLineConfiguration, handleCommandLineArguments, handleCommandLineArguments, handleCommandLineException
protected MDIMenuFactory mfactory
protected javax.swing.JTabbedPane tab
protected java.util.Map<java.lang.String,javax.swing.JComponent> tablist
protected java.util.Map<java.lang.String,java.lang.String> nameToTab
protected java.util.Map<java.lang.String,java.lang.String> tabToName
protected java.util.Map<java.lang.String,SwingFileProperties> properties
protected StatusBar statusBar
protected SwingMessageArea message
protected final java.util.List<MDIApplicationListener> appListeners
public AbstractMDIApplication()
public AbstractMDIApplication(java.lang.String title)
title
- the GUI frame titlepublic void setTitle(java.lang.String title)
title
- the titlepublic java.lang.String getTitle()
protected ThreadQueue createThreadQueue()
createThreadQueue
in class AbstractApplication
public PluginsEDTSupport getPluginsEDTSupport(PluginsManager manager)
getPluginsEDTSupport
in interface MDIApplication
getPluginsEDTSupport
in interface GUIApplication
manager
- the PluginsManagerpublic boolean hasClosableTab(boolean hasClosableTab)
preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
)hasClosableTab
- true if this application should have closable tabsisClosableTab()
,
preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
public boolean setCloseIcon(javax.swing.Icon icon)
preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
)icon
- the close iconpreparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
public boolean setCloseIcon(java.net.URL icon)
preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
)icon
- the close icon URLpreparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
public boolean setCloseBackground(java.awt.Color color)
preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
)color
- the background colorpreparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
public boolean setDefaultCloseIcon()
preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
)preparePanels(boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
public boolean isClosableTab()
isClosableTab
in interface TabbedApplication
public final void setMenuFactory(MDIMenuFactory mfactory)
mfactory
- the menu factorypublic final MDIMenuFactory getMenuFactory()
getMenuFactory
in interface GUIApplication
public final javax.swing.JFrame getApplicationWindow()
getApplicationWindow
in interface GUIApplication
protected void setChangeTabsAllowed(boolean changeTabsAllowed)
changeTabsAllowed
- true if future changes in tabs must be listened to trigger Application actionsprotected boolean isChangeTabsAllowed()
protected void preparePanels(boolean hasStatusbar, boolean hasToolBar, MDIMenuFactory mfactory)
hasStatusbar
- true if there is a StatusbarhasToolBar
- true if there is a ToolBarmfactory
- theAbstractMDIMenuFactory used with this MDIApplicationprotected void fireTabChanged(SwingFileProperties prop)
MDIApplicationListener
s registered
in the Application.prop
- the selected tab FilePropertiesprotected void fireTabRemoved(SwingFileProperties prop)
MDIApplicationListener
s registered in the
Application.prop
- the FileProperties that is under the tab that was removedpublic void addApplicationListener(MDIApplicationListener listener)
addApplicationListener
in interface TabbedApplication
listener
- the application listenerpublic boolean removeApplicationListener(MDIApplicationListener listener)
removeApplicationListener
in interface TabbedApplication
listener
- the application listenerpublic java.util.List<MDIApplicationListener> getApplicationListeners()
getApplicationListeners
in interface TabbedApplication
public void executeAction(MDIAction action, short blockingType)
BlockingType.DEFAULT
: use the default blocking type of the applicationBlockingType.BLOCKING
: if the action should be blockingBlockingType.NOT_BLOCKING
: if the action should not be blockingBlockingType.UI_NOT_BLOCKING
:The UI not blocking type, the action must be performed in the UI ThreadBlockingType.UI_BLOCKING
:The UI blocking type, the action must be performed in the UI ThreadexecuteAction
in interface MDIApplication
executeAction
in class AbstractApplication
action
- the ActionblockingType
- the enumeration specifying if the action should be blockingpublic void executeAction(MDIAction action, short blockingType, java.lang.ClassLoader loader)
BlockingType.DEFAULT
: use the default blocking type of the applicationBlockingType.BLOCKING
: if the action should be blockingBlockingType.NOT_BLOCKING
: if the action should not be blockingBlockingType.UI_NOT_BLOCKING
:The UI not blocking type, the action must be performed in the UI ThreadBlockingType.UI_BLOCKING
:The UI blocking type, the action must be performed in the UI ThreadexecuteAction
in interface MDIApplication
executeAction
in class AbstractApplication
action
- the ActionblockingType
- the enumeration specifying if the action should be blockingloader
- the ClassLoader to execute the actionprotected void preparePanels()
protected void preparePanels(SwingMessageArea area, boolean hasStatusbar, boolean hasToolBar, MDIMenuFactory mfactory)
area
- the Message Area (can be null if there is no Message Area)hasStatusbar
- true if there is a Status barhasToolBar
- true if there is a ToolBarmfactory
- theAbstractMDIMenuFactoryy used with this MDIApplicationprotected void preparePanels(int messageAreaSize, MDIMenuFactory mfactory)
messageAreaSize
- the number of rows of the Message Area, or 0 or less if there is no Message Areamfactory
- the MDIMenuFactory used with this MDIApplicationpreparePanels(int, boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
protected void preparePanels(int messageAreaSize, boolean hasStatusbar, boolean hasToolBar, MDIMenuFactory mfactory)
DefaultMessageArea
), but that any specific message area implementation can be provided (see
SwingMessageArea
).messageAreaSize
- the number of rows of the Message Area, or 0 or less if there is no Message AreahasStatusbar
- true if there is a Status barhasToolBar
- true if there is a ToolBarmfactory
- the MDIMenuFactory used with this MDIApplicationpublic final SwingMessageArea getMessageArea()
getMessageArea
in interface GUIApplication
protected final void setMessageArea(SwingMessageArea message)
preparePanels(int, boolean, boolean, org.mdi.bootstrap.swing.MDIMenuFactory)
.message
- the MDIApplication Message Areapublic final void setDialogHelper(MDIDialogHelper helper)
setDialogHelper
in interface GUIApplication
helper
- the dialog helperpublic final MDIDialogHelper getDialogHelper()
getDialogHelper
in interface GUIApplication
public void setDefaultDialogOpenType(MDIDialogType openType)
setDefaultDialogOpenType
in interface GUIApplication
openType
- the default dialog opening typepublic MDIDialogType getDefaultDialogOpenType()
getDefaultDialogOpenType
in interface GUIApplication
public int showDialog(MDIDialog dialog)
showDialog
in interface GUIApplication
dialog
- the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public int showDialog(MDIDialog dialog, javax.swing.AbstractAction action)
showDialog
in interface GUIApplication
dialog
- the dialogaction
- the associated ActionJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public int showDialog(MDIDialog dialog, MDIDialogType openType)
showDialog
in interface GUIApplication
dialog
- the dialogopenType
- the opening type of the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public int showDialog(MDIDialogBuilder builder, MDIDialogType openType)
showDialog
in interface GUIApplication
builder
- the dialog builderopenType
- the opening type of the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public int showDialog(MDIDialogBuilder builder)
showDialog
in interface GUIApplication
builder
- the dialog builderJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public int showMessageDialog(java.lang.String title, int messageType, boolean isModal, boolean isResizable, java.lang.String... messages)
showMessageDialog
in interface GUIApplication
title
- the dialog titlemessageType
- the message typeisModal
- true if the dialog is modalisResizable
- true if the dialog is resizablemessages
- the list of messages, which will be shown in a vertical gridJFileChooser.APPROVE_OPTION
public void cancelDialog(MDIDialog dialog)
cancelDialog
in interface GUIApplication
dialog
- the dialogpublic void applyDialog(MDIDialog dialog)
applyDialog
in interface GUIApplication
dialog
- the dialogpublic int showDialog(MDIDialog dialog, javax.swing.AbstractAction action, MDIDialogType openType)
showDialog
in interface GUIApplication
dialog
- the dialogaction
- the associated ActionopenType
- the opening type of the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public boolean isDialogOpened(MDIDialog dialog)
isDialogOpened
in interface GUIApplication
dialog
- the dialogpublic void startTime(MDIAction action)
startTime
in interface MDIApplication
startTime
in class AbstractApplication
action
- the Actionpublic long stopTime(MDIAction action)
stopTime
in interface MDIApplication
stopTime
in class AbstractApplication
action
- the Actionprotected java.lang.String getUnusedName(java.lang.String name)
name
- the tab namepublic boolean setComponenAt(java.lang.String name, javax.swing.JComponent comp)
setComponenAt
in interface TabbedApplication
name
- the tab namecomp
- the componentpublic SwingFileProperties addTab(javax.swing.JComponent comp, javax.swing.Icon icon, SwingFileProperties prop, java.lang.String tooltip)
addTab
in interface TabbedApplication
comp
- the component to addicon
- the iconprop
- the properties of the panel, advertising the type of the tab, and what can be done with ittooltip
- the tooltippublic SwingFileProperties addTab(javax.swing.JComponent comp, javax.swing.Icon icon, java.lang.Object obj, java.lang.String name, java.lang.String tooltip)
FileProperties
will be created.addTab
in interface TabbedApplication
comp
- the component to addicon
- the iconobj
- the associated objectname
- the name of the tabtooltip
- the tooltippublic void closeAllTabs()
closeAllTabs(boolean)
with false for the forceClose
argument. This means that the
application will check for the result of acceptRemoveTab(java.lang.String)
before closing for each modified tabcloseAllTabs
in interface TabbedApplication
public void closeAllTabs(boolean forceClose)
closeAllTabs
in interface TabbedApplication
forceClose
- true if the application should not check for the result of acceptRemoveTab(java.lang.String)
before closing
if the current tab content has been modifiedpublic void closeOtherTabs()
closeOtherTabs
in interface TabbedApplication
public void closeCurrentTab(boolean forceClose)
closeCurrentTab
in interface TabbedApplication
forceClose
- true if the application should not check for the result of acceptRemoveTab(java.lang.String)
before closing
if the current tab content has been modifiedpublic void closeCurrentTab()
closeCurrentTab(boolean)
with false for the forceClose
argument. This
means that the application will check for the result of acceptRemoveTab(java.lang.String)
before closing if the current tab
content has been modified.closeCurrentTab
in interface TabbedApplication
public javax.swing.JTabbedPane getTabbedPane()
getTabbedPane
in interface TabbedApplication
public int getTabCount()
getTabCount
in interface TabbedApplication
public void setCurrentTabModified(boolean isModified)
setCurrentTabModified
in interface TabbedApplication
isModified
- true if the current tab is modifiedsetModified(java.lang.String, boolean)
public void setModified(java.lang.String name, boolean isModified)
setModified
in interface TabbedApplication
name
- thr tab nameisModified
- true if the tab is modifiedpublic java.lang.String getRealNameForTab(java.lang.String tabName)
getRealNameForTab
in interface TabbedApplication
tabName
- the tab displayed namepublic java.lang.String getTabDisplayedName(java.lang.String name)
getTabDisplayedName
in interface TabbedApplication
name
- the tab namepublic boolean isModified(java.lang.String name)
isModified
in interface TabbedApplication
name
- the tab namesetModified(java.lang.String, boolean)
public void renameTab(java.lang.String oldName, java.lang.String newName)
oldName
- the old tab namenewName
- the new tab namepublic boolean acceptRemoveTab(java.lang.String name)
public boolean acceptRemoveTab(String name) { if (tabToName.containsKey(name)) { name = tabToName.get(name); if (isModified(name)) { FileProperties prop = properties.get(name); Object o = prop.getObject(); // here save the associated object, the code will depend on the application } } return true; }
acceptRemoveTab
in interface TabbedApplication
name
- the tab namepublic SwingFileProperties removeTab(java.lang.String name)
removeTab
in interface TabbedApplication
name
- the tab nameprotected void manageTabs(java.awt.event.MouseEvent e)
public SwingFileProperties setSelectedTab(java.lang.String name)
setSelectedTab
in interface TabbedApplication
name
- the tab namepublic SwingFileProperties removeSelectedTab()
removeSelectedTab
in interface TabbedApplication
public java.util.Map<java.lang.String,javax.swing.JComponent> getTabList()
getTabList
in interface TabbedApplication
public boolean hasTab(java.lang.String name)
name
- the tab namepublic java.util.Map<java.lang.String,SwingFileProperties> getTabPropertiesList()
getTabPropertiesList
in interface TabbedApplication
public java.util.Map<java.lang.String,SwingFileProperties> getCompatibleTabs(MetaData properties, boolean excludeSelected)
The compatible panels are the Panels :
getCompatibleTabs
in interface TabbedApplication
properties
- the properties MetaData whose panels properties must be compatibleexcludeSelected
- true if the selected tab must be excludedpublic final javax.swing.JComponent getComponent(java.lang.String name)
getComponent
in interface GUIApplication
name
- the tab namepublic javax.swing.JComponent getComponent(java.lang.Object object)
FileProperties.getObject()
. Note that it is
guaranteed that even if two objects for which the Object.equals(java.lang.Object)
methods returns true, and they are
associated with different tabs, the respective correct tabs will be returned for reach object.getComponent
in interface GUIApplication
object
- the objectpublic SwingFileProperties getFileProperties(java.lang.Object object)
FileProperties.getObject()
. Note that it is
guaranteed that even if two objects for which the Object.equals(java.lang.Object)
methods returns true, and they are
associated with different tabs, the respective correct FileProperties will be returned for reach object.getFileProperties
in interface GUIApplication
object
- the objectpublic final SwingFileProperties getProperties(java.lang.String name)
getProperties
in interface GUIApplication
name
- the tab namepublic final javax.swing.JComponent getSelectedComponent()
getSelectedComponent
in interface GUIApplication
public boolean hasSelectedTab()
hasSelectedTab
in interface GUIApplication
public final SwingFileProperties getSelectedProperties()
getSelectedProperties
in interface GUIApplication
public StatusBar getStatusBar()
If (and only if) the Status bar is null it will be created beforehand. Since this method is used at creation, it can be therefore used to specialize the status bar.
getStatusBar
in interface GUIApplication
public final javax.swing.JPanel getToolBarPanel()
getToolBarPanel
in interface GUIApplication
public javax.swing.JMenuBar getMenuBar()
getMenuBar
in interface GUIApplication
public void showActionException(java.lang.String message, java.lang.Exception e)
showActionException
in interface MDIApplication
showActionException
in class AbstractApplication
message
- the message to showe
- the Exceptionpublic void noWriteMessages()
noWriteMessages
in interface MDIApplication
noWriteMessages
in class AbstractApplication
public void noTimeMessages()
noTimeMessages
in interface MDIApplication
noTimeMessages
in class AbstractApplication
public void endAction(MDIAction action)
endAction
in interface MDIApplication
endAction
in class AbstractApplication
action
- the actionpublic void updateUI()
updateUI
in interface GUIApplication
public void dispose()
AbstractApplication.disposeApplication()
.public void setSize(int width, int height)
width
- the frame widthheight
- the frame heightpublic void setVisible(boolean visible)
visible
- true if the underlying Frame should be visible