ch.elca.el4j.services.gui.swing.wrapper
Class AbstractWrapperFactory<T extends ApplicationFrame>

java.lang.Object
  extended by ch.elca.el4j.services.gui.swing.wrapper.AbstractWrapperFactory<T>
Type Parameters:
T - the type of wrapper
Direct Known Subclasses:
ContentWrapperFactory, JFrameWrapperFactory, JInteralFrameWrapperFactory, ToolWindowWrapperFactory

public abstract class AbstractWrapperFactory<T extends ApplicationFrame>
extends Object

This abstract class helps wrapping components into a container like JInternalFrame or JFrame. As the module Swing supports both MDI and docking, this has been introduced to use a single component in both approaches. Depending on the base class of the application (MDIApplication or DockingApplication), forms provided as JComponents are automatically wrapped into the right "container" (see GUIApplication#show(JComponent).

Author:
Stefan Wismer (SWI)
File-location:
AbstractWrapperFactory
Last check-in date:
2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) by swismer for revision 3873

Field Summary
protected static Map<JComponent,WeakReference<ApplicationFrame>> s_componentToWrapper
          A mapping between wrapped component and wrapper.
 
Constructor Summary
AbstractWrapperFactory()
           
 
Method Summary
protected abstract  T createApplicationFrame(String name, String title, JComponent component)
           
static ApplicationFrame getFrame(JComponent component)
           
static void removeWrapper(JComponent component)
          Remove the wrapper from a component.
protected  T wrapComponent(JComponent component)
          Wraps a GUI component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_componentToWrapper

protected static Map<JComponent,WeakReference<ApplicationFrame>> s_componentToWrapper
A mapping between wrapped component and wrapper.

Constructor Detail

AbstractWrapperFactory

public AbstractWrapperFactory()
Method Detail

wrapComponent

protected T wrapComponent(JComponent component)
Wraps a GUI component.

Parameters:
component - the component to wrap
Returns:
the wrapper

createApplicationFrame

protected abstract T createApplicationFrame(String name,
                                            String title,
                                            JComponent component)
Returns:
the concrete wrapper

getFrame

public static ApplicationFrame getFrame(JComponent component)
Parameters:
component - a wrapped component
Returns:
the corresponding wrapper

removeWrapper

public static void removeWrapper(JComponent component)
Remove the wrapper from a component.

Parameters:
component - the component to remove the wrapper


Copyright © 2005-2011 ELCA. All Rights Reserved.