org.openbp.guiclient.model.item.itemfilter
Class AbstractItemFilter

java.lang.Object
  extended by org.openbp.common.generic.description.DescriptionObjectImpl
      extended by org.openbp.common.generic.description.DisplayObjectImpl
          extended by org.openbp.guiclient.model.item.itemfilter.AbstractItemFilter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, Copyable, DescriptionObject, Displayable, DisplayObject, Validatable, ItemFilter
Direct Known Subclasses:
ItemTextFilter, ItemTypeFilter

public abstract class AbstractItemFilter
extends DisplayObjectImpl
implements ItemFilter

Basic implementation of an item filter. This class expects the item filter resources in itemfilter/'name'.xml
'name' is the abbreviated filter name, i. e. the class name with 'org.openbp.' removed.

Author:
Heiko Erhardt
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.openbp.common.generic.Copyable
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW
 
Constructor Summary
AbstractItemFilter()
          Default constructor.
 
Method Summary
protected  void apply()
          Applies the filter to the filter manager it belongs to.
 javax.swing.JComponent getConfigurationComponent()
          Gets the user interface component that can be used to configure this filter.
 ItemFilterHolder getFilterManager()
          Gets the item filter holder this filter belongs to.
 MultiIcon getIcon()
          Gets the icon representing this filter.
 ResourceCollection getItemFilterResource()
          Gets the resource of this filter.
 Plugin getPlugin()
          Gets the plugin this filter belongs to.
 boolean isActive()
          Checks if the filter is active.
 void setActive(boolean active)
          Activates or deactivates the filter.
 void setFilterHolder(ItemFilterHolder filterHolder)
          Sets the item filter holder this filter belongs to.
 void setPlugin(Plugin plugin)
          Sets the plugin this filter belongs to.
 
Methods inherited from class org.openbp.common.generic.description.DisplayObjectImpl
copyFrom, getDisplayName, getDisplayText, setDisplayName
 
Methods inherited from class org.openbp.common.generic.description.DescriptionObjectImpl
clone, compareTo, getDescription, getDescriptionEscape, getDescriptionText, getName, setDescription, setDescriptionEscape, setName, toString, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openbp.guiclient.model.item.itemfilter.ItemFilter
acceptsItem
 
Methods inherited from interface org.openbp.common.generic.description.DisplayObject
getDisplayName, setDisplayName
 
Methods inherited from interface org.openbp.common.generic.description.DescriptionObject
clone, getDescription, getDescriptionText, getDisplayText, getName, setDescription, setName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractItemFilter

public AbstractItemFilter()
Default constructor.

Method Detail

apply

protected void apply()
Applies the filter to the filter manager it belongs to. Should be called if the user has changed a filter configuration component.


getItemFilterResource

public ResourceCollection getItemFilterResource()
Gets the resource of this filter.


getIcon

public MultiIcon getIcon()
Gets the icon representing this filter.

Specified by:
getIcon in interface ItemFilter

getConfigurationComponent

public javax.swing.JComponent getConfigurationComponent()
Gets the user interface component that can be used to configure this filter.

Specified by:
getConfigurationComponent in interface ItemFilter
Returns:
The component or null if the filter cannot be configured
The component should be a JPanel, which should also contain something like an 'Apply' button if necessary (otherwise the actions the user performs on the sub components of the panel should have a direct effect on the filter).

isActive

public boolean isActive()
Checks if the filter is active.

Specified by:
isActive in interface ItemFilter

setActive

public void setActive(boolean active)
Activates or deactivates the filter.

Specified by:
setActive in interface ItemFilter

getPlugin

public Plugin getPlugin()
Gets the plugin this filter belongs to.

Specified by:
getPlugin in interface ItemFilter

setPlugin

public void setPlugin(Plugin plugin)
Sets the plugin this filter belongs to.

Specified by:
setPlugin in interface ItemFilter

getFilterManager

public ItemFilterHolder getFilterManager()
Gets the item filter holder this filter belongs to.

Specified by:
getFilterManager in interface ItemFilter

setFilterHolder

public void setFilterHolder(ItemFilterHolder filterHolder)
Sets the item filter holder this filter belongs to.

Specified by:
setFilterHolder in interface ItemFilter


Copyright © 2011. All Rights Reserved.