|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AddOnPresenter
Implementations of this interface are responsible for the presentation of add-on components
within the context of jadice viewer. Examples for add-on components are the PageSorter
or
the SearchPanel if the module addon-search is available on the classpath.
In most implementations of jadice viewer only one instance of a certain add-on component is
visible at a time. However, AddOnPresenters may also decide to associate a different instance of
an add-on component per ViewComponent
. Therefore implementations may or may not make use
of the supplied context
view component.
There can only be one AddOnPresenter at a time. AddOnPresenter implementations are usually
registered early-on during application startup via the
AddOns.setPresenter(AddOnPresenter)
API, although some applications may offer a
runtime-changeable presentation style.
Please note that most add-ons expect certain items to be contained in their Context
, e.g.
the PageView
or the ThumbnailView
. However, it is outside the scope of this
interface to define how exactly those items end up in the Context.
Method Summary | ||
---|---|---|
void |
activateAddOn(Class<? extends JComponent> addOnComponentClass,
ViewComponent context)
Activate an existing add-on component of the given class within the context of the given view component. |
|
void |
deactivateAddOn(Class<? extends JComponent> addOnComponentClass,
ViewComponent context)
Deactivate an existing add-on component of the given class within the context of the given view component. |
|
void |
disposeAddOn(Class<? extends JComponent> addOnComponentClass,
ViewComponent context)
Deactivate and dispose an existing add-on component of the given class within the context of the given view component. |
|
|
getAddOn(Class<T> addOnComponentClass,
ViewComponent context)
Return the add-on component of the given class within the context of the given view component. |
|
HashMap<ViewComponent,List<JComponent>> |
getAddOns()
Return a map of currently managed add-ons, indexed by context. |
|
boolean |
isAddOnActive(Class<? extends JComponent> addOnComponentClass,
ViewComponent context)
Determine whether there is a registered and active (visible) add-on component of the given class within the context of the given view component. |
|
boolean |
isAddOnRegistered(Class<? extends JComponent> addOnComponentClass,
ViewComponent context)
Determine whether there is a registered (displayable) add-on component of the given class within the context of the given view component. |
|
void |
manageAddOn(JComponent addOn,
ViewComponent context)
Register an add-on component of the given class within the context of the given view component. |
Method Detail |
---|
boolean isAddOnRegistered(Class<? extends JComponent> addOnComponentClass, ViewComponent context)
addOnComponentClass
- the add-on classcontext
- the view component
true
if there is a matching add-on, false
otherwiseboolean isAddOnActive(Class<? extends JComponent> addOnComponentClass, ViewComponent context)
addOnComponentClass
- the add-on classcontext
- the view component
true
if there is a matching add-on, false
otherwise<T extends JComponent> T getAddOn(Class<T> addOnComponentClass, ViewComponent context)
null
if there is no such add-on component.
T
- the type of add-onaddOnComponentClass
- the add-on classcontext
- the view component
null
void activateAddOn(Class<? extends JComponent> addOnComponentClass, ViewComponent context)
addOnComponentClass
- the add-on classcontext
- the view componentvoid deactivateAddOn(Class<? extends JComponent> addOnComponentClass, ViewComponent context)
addOnComponentClass
- the add-on classcontext
- the view componentvoid manageAddOn(JComponent addOn, ViewComponent context)
addOn
- the add-on classcontext
- the view component
IllegalArgumentException
- if there is already an instance of this add-on class
registered within the given context.void disposeAddOn(Class<? extends JComponent> addOnComponentClass, ViewComponent context)
addOnComponentClass
- the add-on classcontext
- the view componentHashMap<ViewComponent,List<JComponent>> getAddOns()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |