com.levigo.jadice.appbase
Class BasicAddOnPresenter

java.lang.Object
  extended by com.levigo.jadice.appbase.BasicAddOnPresenter
All Implemented Interfaces:
AddOnPresenter

public class BasicAddOnPresenter
extends Object
implements AddOnPresenter

The BasicAddOnPresenter manages all add-ons as separate frames. AddOn identity is managed globally, i.e. there is only one instance of an add-on of a certain class at a time.


Constructor Summary
BasicAddOnPresenter()
           
 
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.
<T extends JComponent>
T
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAddOnPresenter

public BasicAddOnPresenter()
Method Detail

isAddOnRegistered

public boolean isAddOnRegistered(Class<? extends JComponent> addOnComponentClass,
                                 ViewComponent context)
Description copied from interface: AddOnPresenter
Determine whether there is a registered (displayable) add-on component of the given class within the context of the given view component.

Specified by:
isAddOnRegistered in interface AddOnPresenter
Parameters:
addOnComponentClass - the add-on class
context - the view component
Returns:
true if there is a matching add-on, false otherwise

isAddOnActive

public boolean isAddOnActive(Class<? extends JComponent> addOnComponentClass,
                             ViewComponent context)
Description copied from interface: AddOnPresenter
Determine whether there is a registered and active (visible) add-on component of the given class within the context of the given view component.

Specified by:
isAddOnActive in interface AddOnPresenter
Parameters:
addOnComponentClass - the add-on class
context - the view component
Returns:
true if there is a matching add-on, false otherwise

getAddOn

public <T extends JComponent> T getAddOn(Class<T> addOnComponentClass,
                                         ViewComponent context)
Description copied from interface: AddOnPresenter
Return the add-on component of the given class within the context of the given view component. Return null if there is no such add-on component.

Specified by:
getAddOn in interface AddOnPresenter
Type Parameters:
T - the type of add-on
Parameters:
addOnComponentClass - the add-on class
context - the view component
Returns:
the add-on component or null

activateAddOn

public void activateAddOn(Class<? extends JComponent> addOnComponentClass,
                          ViewComponent context)
Description copied from interface: AddOnPresenter
Activate an existing add-on component of the given class within the context of the given view component. The exact semantics of add-on activation depends on the type of presenter implementation: in a multi-frame setting, activation will show the add-on frame and bring it to front, whereas a docking UI will open the corresponding view etc.

Specified by:
activateAddOn in interface AddOnPresenter
Parameters:
addOnComponentClass - the add-on class
context - the view component

deactivateAddOn

public void deactivateAddOn(Class<? extends JComponent> addOnComponentClass,
                            ViewComponent context)
Description copied from interface: AddOnPresenter
Deactivate an existing add-on component of the given class within the context of the given view component. The exact semantics of add-on deactivation depends on the type of presenter implementation: in a multi-frame setting, deactivation will hide the add-on frame, whereas a docking UI will close the corresponding view etc.

Specified by:
deactivateAddOn in interface AddOnPresenter
Parameters:
addOnComponentClass - the add-on class
context - the view component

manageAddOn

public void manageAddOn(JComponent addOn,
                        ViewComponent context)
Description copied from interface: AddOnPresenter
Register an add-on component of the given class within the context of the given view component.

Specified by:
manageAddOn in interface AddOnPresenter
Parameters:
addOn - the add-on class
context - the view component

disposeAddOn

public void disposeAddOn(Class<? extends JComponent> addOnComponentClass,
                         ViewComponent context)
Description copied from interface: AddOnPresenter
Deactivate and dispose an existing add-on component of the given class within the context of the given view component. The exact semantics of add-on deactivation depends on the type of presenter implementation: in a multi-frame setting, deactivation will dispose the add-on frame, whereas a docking UI will destroy the corresponding view etc.

Specified by:
disposeAddOn in interface AddOnPresenter
Parameters:
addOnComponentClass - the add-on class
context - the view component

getAddOns

public HashMap<ViewComponent,List<JComponent>> getAddOns()
Description copied from interface: AddOnPresenter
Return a map of currently managed add-ons, indexed by context.

Specified by:
getAddOns in interface AddOnPresenter
Returns:
a map of context to list-of-add-ons


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.