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

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
              extended by org.openbp.guiclient.model.item.itemfilter.ItemTypeFilter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, Copyable, DescriptionObject, Displayable, DisplayObject, Validatable, ItemFilter

public class ItemTypeFilter
extends AbstractItemFilter

Item type filter. The item type filter filters items according to their item type. The user may select the types to be filtered from the supported types. The filter will provide a toobar button for each supported item type in its configuration component.

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
ItemTypeFilter()
          Default constructor.
ItemTypeFilter(java.lang.String[] supportedItemTypes)
          Constructor.
 
Method Summary
 boolean acceptsItem(Item item)
          Determines if an item is accepted by this filter.
 boolean acceptsItemType(java.lang.String itemType)
          Determines if a particular item type is accepted by this filter.
protected  void addItemType(java.lang.String itemType)
          Adds an item type to the filter.
 boolean containsItemType(java.lang.String itemType)
          Determines if the filter contains the given item type.
 java.util.List getActions()
          Gets the action list.
 javax.swing.JComponent getConfigurationComponent()
          Gets the configuration component that can be used to configure the installed item filters.
 java.lang.String[] getSupportedItemTypeInfos()
          Gets the supported item types.
 JaspiraToolbar getToolbar()
          Gets the item type toolbar.
 boolean isActive()
          Checks if the filter is active.
protected  void removeItemType(java.lang.String itemType)
          Removes an item type from the filter.
 void setActive(boolean active)
          Activates or deactivates the filter.
 void setEnabled(boolean enabled)
          Enables or disables the filter controls.
 void setSupportedItemTypes(java.lang.String[] supportedItemTypes)
          Sets the supported item types.
 
Methods inherited from class org.openbp.guiclient.model.item.itemfilter.AbstractItemFilter
apply, getFilterManager, getIcon, getItemFilterResource, getPlugin, setFilterHolder, setPlugin
 
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.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

ItemTypeFilter

public ItemTypeFilter()
Default constructor. Adds all standard item types to the list of supported item types.


ItemTypeFilter

public ItemTypeFilter(java.lang.String[] supportedItemTypes)
Constructor.

Parameters:
supportedItemTypes - List of supported item types
This this parameter is null, all standard item types will be added.
Method Detail

getActions

public java.util.List getActions()
Gets the action list.

Returns:
A list of JaspiraAction objects or null

getSupportedItemTypeInfos

public java.lang.String[] getSupportedItemTypeInfos()
Gets the supported item types.


setSupportedItemTypes

public void setSupportedItemTypes(java.lang.String[] supportedItemTypes)
Sets the supported item types.


getToolbar

public JaspiraToolbar getToolbar()
Gets the item type toolbar.


acceptsItem

public boolean acceptsItem(Item item)
Determines if an item is accepted by this filter.

Parameters:
item - Item to check
Returns:
true: The item is accepted by the filter
false: The filter rejects this item

acceptsItemType

public boolean acceptsItemType(java.lang.String itemType)
Determines if a particular item type is accepted by this filter.

Parameters:
itemType - Item type to check
Returns:
true: The item type is accepted by the filter
false: The filter rejects this item type

getConfigurationComponent

public javax.swing.JComponent getConfigurationComponent()
Gets the configuration component that can be used to configure the installed item filters.

Specified by:
getConfigurationComponent in interface ItemFilter
Overrides:
getConfigurationComponent in class AbstractItemFilter
Returns:
The component or null if the item filter does not provide one

isActive

public boolean isActive()
Checks if the filter is active. The filter is active if it contains at least one filtered item type.

Specified by:
isActive in interface ItemFilter
Overrides:
isActive in class AbstractItemFilter

setActive

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

Specified by:
setActive in interface ItemFilter
Overrides:
setActive in class AbstractItemFilter

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the filter controls.


containsItemType

public boolean containsItemType(java.lang.String itemType)
Determines if the filter contains the given item type.

Parameters:
itemType - Item type to check
Returns:
true: The item type has been added.
false: The item type filter does not contain the item type.

addItemType

protected void addItemType(java.lang.String itemType)
Adds an item type to the filter.

Parameters:
itemType - Item type to add

removeItemType

protected void removeItemType(java.lang.String itemType)
Removes an item type from the filter.

Parameters:
itemType - Item type to remove


Copyright © 2011. All Rights Reserved.