org.jtheque.core.managers.view
Class ViewManager

java.lang.Object
  extended by org.jtheque.core.managers.AbstractManager
      extended by org.jtheque.core.managers.view.ViewManager
All Implemented Interfaces:
IManager, IViewManager

public final class ViewManager
extends AbstractManager
implements IViewManager

A view manager implementation.

Author:
Baptiste Wicht

Constructor Summary
ViewManager()
          Construct a new ViewManager.
 
Method Summary
 void addConfigTabComponent(ConfigTabComponent component)
          Add config tab component.
 void addConfigTabListener(ConfigTabListener listener)
          Add a ConfigTabListener.
 void addStateBarComponent(StateBarComponent component)
          Add a statebar component.
 void addStateBarListener(StateBarListener listener)
          Add a statebar listener.
 void addTabComponent(TabComponent component)
          Add a tab component.
 void addTabListener(TabListener listener)
          Add a TabListener.
 boolean askI18nUserForConfirmation(java.lang.String textKey, java.lang.String titleKey)
          Ask the user for confirmation with internationalized message.
 boolean askUserForConfirmation(java.lang.String text, java.lang.String title)
          Ask user for confirmation.
 java.lang.String askUserForText(java.lang.String text)
          Ask the user for a text.
 java.lang.String chooseDirectory()
          Choose a directory.
 java.lang.String chooseFile(org.jtheque.utils.io.SimpleFilter filter)
          Choose a file.
 void close()
          Close the manager.
 void closeAboutView()
          Close the about view.
 void closeCollectionView()
          Close the collection view.
 void closeSplashScreen()
          Close the splashscreen.
 void configureView(IView view, java.lang.String name, int defaultWidth, int defaultHeight)
          Configure a view.
 void displayAboutView()
          Display the about view.
 void displayChooseCollectionView()
          Display the choose collection view.
 void displayError(JThequeError error)
          Display an error.
 void displayI18nText(java.lang.String key)
          Display a internationalized.
 void displayMainView()
          Display the main view.
 void displayPrimaryModuleList()
          Display the primary module list.
 void displaySplashScreen()
          Display the splashscreen.
 void displayText(java.lang.String text)
          Display a text.
 void execute(SimpleTask task)
          Execute a task in the EDT.
<T> T
execute(Task<T> task)
          Execute a task in the EDT.
 ICollectionView getCollectionView()
          Return the collection view.
 java.util.List<ConfigTabComponent> getConfigTabComponents()
          Return all the config tab components.
 WindowsConfiguration getConfigurations()
          Return all window configuration.
 java.lang.Object getMainComponent()
          Return the main component.
 java.util.List<StateBarComponent> getStateBarComponents()
          Return all the statebar components.
 java.util.List<TabComponent> getTabComponents()
          Return all the tab components.
 ViewDefaults getViewDefaults()
          Return the view defaults.
 ViewDelegate getViewDelegate()
          Return the delegate view manager.
 Views getViews()
          Return the Views.
 void init()
          Init the manager.
 boolean isTabMainComponent()
          Indicate if the tab is the main component or not.
 void preInit()
          Pre-init the manager.
 void refresh(java.lang.Object c)
          Refresh the component.
 void removeConfigTabComponent(ConfigTabComponent component)
          Remove the specified config tab component.
 void removeConfigTabListener(ConfigTabListener listener)
          Remove the specified ConfigTabListener.
 void removeMainComponent(java.lang.Object component)
          Remove the main component of the main view.
 void removeStateBarComponent(StateBarComponent component)
          Remove the specified statebar component.
 void removeStateBarListener(StateBarListener listener)
          Remove a statebar listener.
 void removeTabComponent(TabComponent component)
          Remove a tab component.
 void removeTabListener(TabListener listener)
          Remove the specified TabListener.
 void saveState(IView window, java.lang.String name)
          Save the current state of the window.
 void setConfigPanels(java.util.Collection<ConfigTabComponent> configPanels)
          Set the config panels.
 void setMainComponent(java.lang.Object component)
          Set the main component of the main view.
 void setViewDefaults(ViewDefaults viewDefaults)
          Set the view defaults.
 void setViewDelegate(ViewDelegate viewDelegate)
          Set the view delegate.
 
Methods inherited from class org.jtheque.core.managers.AbstractManager
getErrors, getListeners, getLogger, getMessage, getMessage, getStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewManager

public ViewManager()
Construct a new ViewManager.

Method Detail

preInit

public void preInit()
Description copied from interface: IManager
Pre-init the manager. This operation is called before modules preplug.

Specified by:
preInit in interface IManager

displaySplashScreen

public void displaySplashScreen()
Description copied from interface: IViewManager
Display the splashscreen.

Specified by:
displaySplashScreen in interface IViewManager

displayPrimaryModuleList

public void displayPrimaryModuleList()
Description copied from interface: IViewManager
Display the primary module list.

Specified by:
displayPrimaryModuleList in interface IViewManager

displayAboutView

public void displayAboutView()
Description copied from interface: IViewManager
Display the about view.

Specified by:
displayAboutView in interface IViewManager

saveState

public void saveState(IView window,
                      java.lang.String name)
Description copied from interface: IViewManager
Save the current state of the window.

Specified by:
saveState in interface IViewManager
Parameters:
window - The window.
name - The name of the view.

configureView

public void configureView(IView view,
                          java.lang.String name,
                          int defaultWidth,
                          int defaultHeight)
Description copied from interface: IViewManager
Configure a view. It seems sets the size and location of the view.

Specified by:
configureView in interface IViewManager
Parameters:
view - The window to configure.
name - The name of the view.
defaultWidth - The default width of the view.
defaultHeight - The default height of the view.

closeAboutView

public void closeAboutView()
Description copied from interface: IViewManager
Close the about view.

Specified by:
closeAboutView in interface IViewManager

displayChooseCollectionView

public void displayChooseCollectionView()
Description copied from interface: IViewManager
Display the choose collection view.

Specified by:
displayChooseCollectionView in interface IViewManager

closeCollectionView

public void closeCollectionView()
Description copied from interface: IViewManager
Close the collection view.

Specified by:
closeCollectionView in interface IViewManager

closeSplashScreen

public void closeSplashScreen()
Description copied from interface: IViewManager
Close the splashscreen.

Specified by:
closeSplashScreen in interface IViewManager

setMainComponent

public void setMainComponent(java.lang.Object component)
Description copied from interface: IViewManager
Set the main component of the main view.

Specified by:
setMainComponent in interface IViewManager
Parameters:
component - The main component of the main view.

removeMainComponent

public void removeMainComponent(java.lang.Object component)
Description copied from interface: IViewManager
Remove the main component of the main view.

Specified by:
removeMainComponent in interface IViewManager
Parameters:
component - The main component to remove.

isTabMainComponent

public boolean isTabMainComponent()
Description copied from interface: IViewManager
Indicate if the tab is the main component or not.

Specified by:
isTabMainComponent in interface IViewManager
Returns:
true if the tab is the main component else false.

getMainComponent

public java.lang.Object getMainComponent()
Description copied from interface: IViewManager
Return the main component.

Specified by:
getMainComponent in interface IViewManager
Returns:
The main component.

close

public void close()
Description copied from interface: IManager
Close the manager.

Specified by:
close in interface IManager

init

public void init()
Description copied from interface: IManager
Init the manager. This operation is called after modules preplug but before module plug.

Specified by:
init in interface IManager

getConfigurations

public WindowsConfiguration getConfigurations()
Description copied from interface: IViewManager
Return all window configuration.

Specified by:
getConfigurations in interface IViewManager
Returns:
A onfiguration who encapsulate the configuration of differents views.

getViews

public Views getViews()
Description copied from interface: IViewManager
Return the Views. It seems the class responsible for managing the different views.

Specified by:
getViews in interface IViewManager
Returns:
The Views object.

addStateBarComponent

public void addStateBarComponent(StateBarComponent component)
Description copied from interface: IViewManager
Add a statebar component.

Specified by:
addStateBarComponent in interface IViewManager
Parameters:
component - The component to add to the statebar.

removeStateBarComponent

public void removeStateBarComponent(StateBarComponent component)
Description copied from interface: IViewManager
Remove the specified statebar component.

Specified by:
removeStateBarComponent in interface IViewManager
Parameters:
component - The component to remove of to the statebar.

getStateBarComponents

public java.util.List<StateBarComponent> getStateBarComponents()
Description copied from interface: IViewManager
Return all the statebar components.

Specified by:
getStateBarComponents in interface IViewManager
Returns:
A List containing all the statebar components.

addTabComponent

public void addTabComponent(TabComponent component)
Description copied from interface: IViewManager
Add a tab component.

Specified by:
addTabComponent in interface IViewManager
Parameters:
component - The tab to add.

removeTabComponent

public void removeTabComponent(TabComponent component)
Description copied from interface: IViewManager
Remove a tab component.

Specified by:
removeTabComponent in interface IViewManager
Parameters:
component - The tab to remove.

getTabComponents

public java.util.List<TabComponent> getTabComponents()
Description copied from interface: IViewManager
Return all the tab components.

Specified by:
getTabComponents in interface IViewManager
Returns:
A List containing all the tab components.

addConfigTabComponent

public void addConfigTabComponent(ConfigTabComponent component)
Description copied from interface: IViewManager
Add config tab component.

Specified by:
addConfigTabComponent in interface IViewManager
Parameters:
component - The config tab component to add.

removeConfigTabComponent

public void removeConfigTabComponent(ConfigTabComponent component)
Description copied from interface: IViewManager
Remove the specified config tab component.

Specified by:
removeConfigTabComponent in interface IViewManager
Parameters:
component - The config tab component to remove.

getConfigTabComponents

public java.util.List<ConfigTabComponent> getConfigTabComponents()
Description copied from interface: IViewManager
Return all the config tab components.

Specified by:
getConfigTabComponents in interface IViewManager
Returns:
A List containing all the config tab components.

askUserForConfirmation

public boolean askUserForConfirmation(java.lang.String text,
                                      java.lang.String title)
Description copied from interface: IViewManager
Ask user for confirmation.

Specified by:
askUserForConfirmation in interface IViewManager
Parameters:
text - The question.
title - The title.
Returns:
true if the user has accepted else false.

askI18nUserForConfirmation

public boolean askI18nUserForConfirmation(java.lang.String textKey,
                                          java.lang.String titleKey)
Description copied from interface: IViewManager
Ask the user for confirmation with internationalized message.

Specified by:
askI18nUserForConfirmation in interface IViewManager
Parameters:
textKey - The question key.
titleKey - The title key.
Returns:
true if the user has accepted else false.

askUserForText

public java.lang.String askUserForText(java.lang.String text)
Description copied from interface: IViewManager
Ask the user for a text.

Specified by:
askUserForText in interface IViewManager
Parameters:
text - The text prompt.
Returns:
The text of the user.

displayText

public void displayText(java.lang.String text)
Description copied from interface: IViewManager
Display a text.

Specified by:
displayText in interface IViewManager
Parameters:
text - The text to display.

chooseFile

public java.lang.String chooseFile(org.jtheque.utils.io.SimpleFilter filter)
Description copied from interface: IViewManager
Choose a file.

Specified by:
chooseFile in interface IViewManager
Parameters:
filter - A file filter.
Returns:
The choosed file.

chooseDirectory

public java.lang.String chooseDirectory()
Description copied from interface: IViewManager
Choose a directory.

Specified by:
chooseDirectory in interface IViewManager
Returns:
The choosed directory.

displayI18nText

public void displayI18nText(java.lang.String key)
Description copied from interface: IViewManager
Display a internationalized.

Specified by:
displayI18nText in interface IViewManager
Parameters:
key - The internationalization key.

addStateBarListener

public void addStateBarListener(StateBarListener listener)
Description copied from interface: IViewManager
Add a statebar listener.

Specified by:
addStateBarListener in interface IViewManager
Parameters:
listener - The listener to add.

removeStateBarListener

public void removeStateBarListener(StateBarListener listener)
Description copied from interface: IViewManager
Remove a statebar listener.

Specified by:
removeStateBarListener in interface IViewManager
Parameters:
listener - The listener to remove.

addConfigTabListener

public void addConfigTabListener(ConfigTabListener listener)
Description copied from interface: IViewManager
Add a ConfigTabListener.

Specified by:
addConfigTabListener in interface IViewManager
Parameters:
listener - The listener to add.

removeConfigTabListener

public void removeConfigTabListener(ConfigTabListener listener)
Description copied from interface: IViewManager
Remove the specified ConfigTabListener.

Specified by:
removeConfigTabListener in interface IViewManager
Parameters:
listener - The listener to remove.

addTabListener

public void addTabListener(TabListener listener)
Description copied from interface: IViewManager
Add a TabListener.

Specified by:
addTabListener in interface IViewManager
Parameters:
listener - The listener to add.

removeTabListener

public void removeTabListener(TabListener listener)
Description copied from interface: IViewManager
Remove the specified TabListener.

Specified by:
removeTabListener in interface IViewManager
Parameters:
listener - The listener to remove.

displayError

public void displayError(JThequeError error)
Description copied from interface: IViewManager
Display an error.

Specified by:
displayError in interface IViewManager
Parameters:
error - The error to display.

displayMainView

public void displayMainView()
Description copied from interface: IViewManager
Display the main view.

Specified by:
displayMainView in interface IViewManager

getViewDelegate

public ViewDelegate getViewDelegate()
Description copied from interface: IViewManager
Return the delegate view manager.

Specified by:
getViewDelegate in interface IViewManager
Returns:
The delegate view manager.

execute

public void execute(SimpleTask task)
Description copied from interface: IViewManager
Execute a task in the EDT.

Specified by:
execute in interface IViewManager
Parameters:
task - The task to execute.

execute

public <T> T execute(Task<T> task)
Description copied from interface: IViewManager
Execute a task in the EDT.

Specified by:
execute in interface IViewManager
Type Parameters:
T - The type of return.
Parameters:
task - The task to execute.
Returns:
The result of the task.

refresh

public void refresh(java.lang.Object c)
Description copied from interface: IViewManager
Refresh the component.

Specified by:
refresh in interface IViewManager
Parameters:
c - The component to refresh.

getCollectionView

public ICollectionView getCollectionView()
Description copied from interface: IViewManager
Return the collection view.

Specified by:
getCollectionView in interface IViewManager
Returns:
The collection view.

getViewDefaults

public ViewDefaults getViewDefaults()
Description copied from interface: IViewManager
Return the view defaults.

Specified by:
getViewDefaults in interface IViewManager
Returns:
The view defaults.

setConfigPanels

public void setConfigPanels(java.util.Collection<ConfigTabComponent> configPanels)
Set the config panels. This is not for use, this is only for Spring Injection.

Parameters:
configPanels - A collection containing all the config tab components.

setViewDelegate

public void setViewDelegate(ViewDelegate viewDelegate)
Set the view delegate. This is not for use, this is only for Spring Injection.

Parameters:
viewDelegate - The view delegate implementation.

setViewDefaults

public void setViewDefaults(ViewDefaults viewDefaults)
Set the view defaults. This is not for use, this is only for Spring Injection.

Parameters:
viewDefaults - The view defaults.


Copyright © 2009 JTheque. All Rights Reserved.