net.sf.doolin.gui.window
Interface GUIWindow<B>

Type Parameters:
B - Type of data for the window
All Superinterfaces:
PropertyContainer
All Known Implementing Classes:
AbstractDialogWindow, AbstractGUIWindow, AbstractRootPaneGUIWindow, DialogGUIWindow, FrameGUIWindow, WizardWindow

public interface GUIWindow<B>
extends PropertyContainer

This interface defines a main application window.


Method Summary
 void addGUIWindowListener(GUIWindowListener<B> listener)
          Adds a listener for the window
 void addView(GUIView<?> view)
          Registers a new view in this window
 void build(GUIApplication application, GUIWindowDescriptor<B> windowDescriptor, B windowData)
          Builds and initializes the window.
 boolean canClose()
          Checks if the window can be closed
 void close()
          Closes the window.
 void display()
          Displays the window on the screen.
 ActionContext getActionContext()
          Gets the action context for this window
 GUIApplication getApplication()
          Gets the application.
 String getId()
          Gets the ID for this window
 Collection<? extends GUIView<?>> getOpenViews()
          List of open views
<V> GUIView<V>
getView(String viewId)
          Gets an already opened view
 B getWindowData()
          Returns the window data
 GUIWindowDescriptor<B> getWindowDescriptor()
          Gets the window descriptor.
 JPanel getWindowPanel()
          Content panel.
 void installMenuBar(String id, ActionBarContext menuBar)
          Installs a menu bar in the window for a given context (which can be different form the window's one)
 void installToolBar(ToolBar toolBar, ActionContext actionContext)
          Installs a tool bar in the window
 boolean isClosed()
          Checks if the window is closed
 void onPostCreate()
          This method is called when the window has been fully created
 void removeView(GUIView<?> view)
          Hides a view
 void setWindowIcon(Icon icon)
          Sets the icon for the window
 void setWindowTitle(String value)
          Sets the window title.
 void showView(GUIView<?> view)
          Activates a view
 void uninstallMenuBar(String id)
          Uninstalls a menu bar with the given id
 void uninstallToolBar(String id)
          Uninstalls a tool bar with the given id
 
Methods inherited from interface net.sf.doolin.gui.util.PropertyContainer
getProperty, setProperty
 

Method Detail

addGUIWindowListener

void addGUIWindowListener(GUIWindowListener<B> listener)
Adds a listener for the window

Parameters:
listener - Window listener

addView

void addView(GUIView<?> view)
Registers a new view in this window

Parameters:
view - View to register

build

void build(GUIApplication application,
           GUIWindowDescriptor<B> windowDescriptor,
           B windowData)
Builds and initializes the window.

Parameters:
application - Owning application
windowDescriptor - The window descriptor
windowData - Associated data

canClose

boolean canClose()
Checks if the window can be closed

Returns:
true if the window can be closed

close

void close()
Closes the window.


display

void display()
Displays the window on the screen.


getActionContext

ActionContext getActionContext()
Gets the action context for this window

Returns:
Action context

getApplication

GUIApplication getApplication()
Gets the application.

Returns:
the application

getId

String getId()
Gets the ID for this window

Returns:
ID

getOpenViews

Collection<? extends GUIView<?>> getOpenViews()
List of open views

Returns:
List of open views

getView

<V> GUIView<V> getView(String viewId)
Gets an already opened view

Type Parameters:
V - Type of data for the view
Parameters:
viewId - View ID
Returns:
Already opened view or null.

getWindowData

B getWindowData()
Returns the window data

Returns:
Window data

getWindowDescriptor

GUIWindowDescriptor<B> getWindowDescriptor()
Gets the window descriptor.

Returns:
the window descriptor

getWindowPanel

JPanel getWindowPanel()
Content panel.

Returns:
Content panel for this window

removeView

void removeView(GUIView<?> view)
Hides a view

Parameters:
view - View to hide

installMenuBar

void installMenuBar(String id,
                    ActionBarContext menuBar)
Installs a menu bar in the window for a given context (which can be different form the window's one)

Parameters:
id - ID of the menu bar
menuBar - Action bar context

installToolBar

void installToolBar(ToolBar toolBar,
                    ActionContext actionContext)
Installs a tool bar in the window

Parameters:
toolBar - Tool bar to install
actionContext - Action context

isClosed

boolean isClosed()
Checks if the window is closed

Returns:
true if the window is closed

onPostCreate

void onPostCreate()
This method is called when the window has been fully created


setWindowIcon

void setWindowIcon(Icon icon)
Sets the icon for the window

Parameters:
icon - Icon to set

setWindowTitle

void setWindowTitle(String value)
Sets the window title.

Parameters:
value - Window title

showView

void showView(GUIView<?> view)
Activates a view

Parameters:
view - View to activate

uninstallMenuBar

void uninstallMenuBar(String id)
Uninstalls a menu bar with the given id

Parameters:
id - ID of the menu bar to uninstall

uninstallToolBar

void uninstallToolBar(String id)
Uninstalls a tool bar with the given id

Parameters:
id - ID of the tool bar to uninstall


Copyright © 2011. All Rights Reserved.