|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.application.support.ApplicationServicesAccessor
org.springframework.richclient.factory.AbstractControlFactory
public abstract class AbstractControlFactory
A skeleton implementation of the ControlFactory
interface that only
creates it's control when requested.
The factory may operate in singleton mode, which is the default. In this case, the control will be created the first time it is requested and the same instance will be returned for each subsequent request. When operating in non-singleton mode, a new control instance is created each time it is requested.
Field Summary |
---|
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor |
---|
logger |
Constructor Summary | |
---|---|
protected |
AbstractControlFactory()
Creates a new uninitialized AbstractControlFactory . |
Method Summary | |
---|---|
protected abstract JComponent |
createControl()
Subclasses must override this method to create a new instance of the control that this factory produces. |
protected void |
createControlIfNecessary()
Creates an instance of the control produced by this factory if operating in singleton mode and the control instance has not already been created. |
JComponent |
getControl()
Returns an instance of the control that this factory produces. |
boolean |
isControlCreated()
Returns true if the control for this factory has been created. |
protected boolean |
isSingleton()
Returns true (the default) if this factory is to create a single instance of its control. |
protected void |
setSingleton(boolean singleton)
Sets the flag that determines if this factory is to create a single instance of its control. |
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor |
---|
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractControlFactory()
AbstractControlFactory
.
Method Detail |
---|
protected final boolean isSingleton()
true
if this factory returns a singleton instance
of its control.protected final void setSingleton(boolean singleton)
singleton
- The singleton flag.public final JComponent getControl()
This implementation is a template method, calling the abstract
createControl()
method if operating in non-singleton mode or if
the control has not yet been created when operating in singleton mode.
getControl
in interface ControlFactory
null
.public final boolean isControlCreated()
true
if operating in singleton mode and an instance of the
control has already been created, false otherwise.protected void createControlIfNecessary()
protected abstract JComponent createControl()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |