Extension SDK 10.1.2


oracle.jdeveloper.model
Class CategoryFilter

java.lang.Object
  extended byoracle.ide.model.DefaultFilter
      extended byoracle.ide.model.FilelistFilter
          extended byoracle.jdeveloper.model.CategoryFilter

All Implemented Interfaces:
ChildFilter, Displayable
Direct Known Subclasses:
ApplicationFilter, JProjectFilter

public class CategoryFilter
extends FilelistFilter

The CategoryFilter class organizes the children of a project into a predefined structure. Children of the project that implement the Category interface are grouped based on the registered categories.


Nested Class Summary
protected static class CategoryFilter.CategoryRegistry
static class CategoryFilter.CatInfo
protected static class CategoryFilter.JProjectComparator
Comparator class used to sort children of the CategoryFilter.

Nested classes inherited from class oracle.ide.model.DefaultFilter
DefaultFilter.SortedComparator, DefaultFilter.SortedFolderFirstComparator

Field Summary
static int LAST_CATEGORY_SHIFT
Deprecated. Category ID constants should be generated with newCategory().
static int OPTION_VIEW_AS_LIST
static int PROJECT_REBUILT
Internal use only

Fields inherited from class oracle.ide.model.DefaultFilter
folderFirstComparator, folderFirstComparator2, sortedComparator

Fields inherited from interface oracle.ide.explorer.ChildFilter
NO_OPTIONS

Constructor Summary
CategoryFilter()
CategoryFilter(JProject project)
Constructor.

Method Summary
void cache(TNode node)
This method will be called when the UI creates a TNode that is a descendant of a filtered node.
boolean canRefresh(TNode[] nodes)
This method will be called when the UI needs to determine the sensitivity of the Refresh menu item.
boolean canSupportFilter(int category, int filter)
boolean canUpdate(TNode node, UpdateMessage change)
Call to determine if an update should be done due a property set notification.
TNode childrenAdded(java.util.List added, TNode subject, TreeExplorer tree)
The childrenAdded method is called when the UI is notified that an element has been added to the node that owns this filter.
TNode childrenRemoved(java.util.List removed, TNode subject, TreeExplorer tree)
The childrenRemoved method is called when the UI is notified that an element has been added to the node that owns this filter.
void closeChildren()
This method is called when a parent node is closed.
protected CategoryFolder findCategoryFolder(Element element)
protected TNode getCategoryNode(CategoryFolder folder, TreeExplorer tree)
protected CategoryFilter.CategoryRegistry getCategoryRegistry()
Subclass must override this method and return a registry containing valid categories.
java.util.Iterator getChildren()
Get the children.
java.util.Comparator getComparator()
Returns the Comparator that is used to sort the children of the owner TNode.
int getOptions()
Accessors to filter options.
protected java.util.Iterator getProjectChildren()
int getType()
This method should return bitfield specifying the filter type.
protected boolean handleAdd(Element element, CategoryFolder folder, java.util.List childrenToAdd, ChildFilter folderFilter, Element subject, boolean checkOwner)
protected boolean handleRemove(Element element, CategoryFolder folder, java.util.List childrenToRemove, ChildFilter folderFilter, Element subject)
protected boolean isListView()
static int newCategory()
Returns a new unique category ID.
void refresh(TNode[] nodes)
This method will be called when the UI is requested to refresh.
protected static void registerCategories(CategoryFilter.CategoryRegistry registry, CategoryFilter.CatInfo[] categories)
protected void setListView(boolean listView)
void setOptions(int options)
void setOwner(TNode owner)
Sets the node that owns this filter.
void uncache(TNode node)
TNode update(TNode node, UpdateMessage change)
This method will be called when the UI needs to tell a filter that a property set notification has happened.

Methods inherited from class oracle.ide.model.FilelistFilter
getProject, setProject

Methods inherited from class oracle.ide.model.DefaultFilter
checkElementAttributes, getIcon, getLongLabel, getOwner, getShortLabel, getToolTipText, getURLFilter, refreshExplorerNode, setURLFilter, toString

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

LAST_CATEGORY_SHIFT

public static int LAST_CATEGORY_SHIFT
Deprecated. Category ID constants should be generated with newCategory().
Predefined categories. Use LAST_CATEGORY_SHIFT to create a new category constant as follows:
 final int MY_CATEGORY = 1 << LAST_CATEGORY_SHIFT++;
 

OPTION_VIEW_AS_LIST

public static final int OPTION_VIEW_AS_LIST
See Also:
Constant Field Values

PROJECT_REBUILT

public static final int PROJECT_REBUILT
Internal use only

Constructor Detail

CategoryFilter

public CategoryFilter()

CategoryFilter

public CategoryFilter(JProject project)
Constructor.
Parameters:
project - the project whose children are to be filtered.

Method Detail

newCategory

public static int newCategory()
Returns a new unique category ID.

getChildren

public java.util.Iterator getChildren()
Description copied from class: FilelistFilter
Get the children. This filter makes sures that when its owner is a project, we don't return children of the project that are owned by other folders contained in the project. This avoids seeing these children more than once in the navigator.
Specified by:
getChildren in interface ChildFilter
Overrides:
getChildren in class FilelistFilter

setOwner

public void setOwner(TNode owner)
Description copied from interface: ChildFilter
Sets the node that owns this filter.
Specified by:
setOwner in interface ChildFilter
Overrides:
setOwner in class FilelistFilter

childrenAdded

public TNode childrenAdded(java.util.List added,
                           TNode subject,
                           TreeExplorer tree)
Description copied from interface: ChildFilter
The childrenAdded method is called when the UI is notified that an element has been added to the node that owns this filter. This method should return the tnode to be selected in the tree.
Specified by:
childrenAdded in interface ChildFilter
Overrides:
childrenAdded in class FilelistFilter

childrenRemoved

public TNode childrenRemoved(java.util.List removed,
                             TNode subject,
                             TreeExplorer tree)
Description copied from interface: ChildFilter
The childrenRemoved method is called when the UI is notified that an element has been added to the node that owns this filter. This method should return the tnode to be selected in the tree.
Specified by:
childrenRemoved in interface ChildFilter
Overrides:
childrenRemoved in class FilelistFilter

cache

public void cache(TNode node)
Description copied from interface: ChildFilter
This method will be called when the UI creates a TNode that is a descendant of a filtered node.
Specified by:
cache in interface ChildFilter
Overrides:
cache in class DefaultFilter

uncache

public void uncache(TNode node)
Specified by:
uncache in interface ChildFilter
Overrides:
uncache in class DefaultFilter

getOptions

public int getOptions()
Description copied from interface: ChildFilter
Accessors to filter options. In general, options are meaninful only to the filter. Options should be stored as bits. Filters that define no options should return NO_OPTIONS.
Specified by:
getOptions in interface ChildFilter
Overrides:
getOptions in class DefaultFilter

setOptions

public void setOptions(int options)
Specified by:
setOptions in interface ChildFilter
Overrides:
setOptions in class DefaultFilter

getType

public int getType()
Description copied from interface: ChildFilter
This method should return bitfield specifying the filter type. Filters types are created by calling FilterTypes.newType().
Specified by:
getType in interface ChildFilter
Overrides:
getType in class FilelistFilter

getComparator

public java.util.Comparator getComparator()
Description copied from interface: ChildFilter
Returns the Comparator that is used to sort the children of the owner TNode.
Specified by:
getComparator in interface ChildFilter
Overrides:
getComparator in class DefaultFilter

canRefresh

public boolean canRefresh(TNode[] nodes)
Description copied from interface: ChildFilter
This method will be called when the UI needs to determine the sensitivity of the Refresh menu item.
Specified by:
canRefresh in interface ChildFilter
Overrides:
canRefresh in class DefaultFilter

refresh

public void refresh(TNode[] nodes)
Description copied from interface: ChildFilter
This method will be called when the UI is requested to refresh.
Specified by:
refresh in interface ChildFilter
Overrides:
refresh in class DefaultFilter

closeChildren

public void closeChildren()
Description copied from interface: ChildFilter
This method is called when a parent node is closed. The method should make sure that all elements created by the filter are properly closed.
Specified by:
closeChildren in interface ChildFilter
Overrides:
closeChildren in class DefaultFilter

canUpdate

public boolean canUpdate(TNode node,
                         UpdateMessage change)
Description copied from interface: ChildFilter
Call to determine if an update should be done due a property set notification.
Specified by:
canUpdate in interface ChildFilter
Overrides:
canUpdate in class DefaultFilter

update

public TNode update(TNode node,
                    UpdateMessage change)
Description copied from interface: ChildFilter
This method will be called when the UI needs to tell a filter that a property set notification has happened.
Specified by:
update in interface ChildFilter
Overrides:
update in class DefaultFilter

canSupportFilter

public boolean canSupportFilter(int category,
                                int filter)

isListView

protected boolean isListView()

setListView

protected void setListView(boolean listView)

getCategoryRegistry

protected CategoryFilter.CategoryRegistry getCategoryRegistry()
Subclass must override this method and return a registry containing valid categories.

getProjectChildren

protected java.util.Iterator getProjectChildren()

handleAdd

protected boolean handleAdd(Element element,
                            CategoryFolder folder,
                            java.util.List childrenToAdd,
                            ChildFilter folderFilter,
                            Element subject,
                            boolean checkOwner)

handleRemove

protected boolean handleRemove(Element element,
                               CategoryFolder folder,
                               java.util.List childrenToRemove,
                               ChildFilter folderFilter,
                               Element subject)

registerCategories

protected static void registerCategories(CategoryFilter.CategoryRegistry registry,
                                         CategoryFilter.CatInfo[] categories)

findCategoryFolder

protected CategoryFolder findCategoryFolder(Element element)

getCategoryNode

protected TNode getCategoryNode(CategoryFolder folder,
                                TreeExplorer tree)

Extension SDK


Copyright © 1997, 2004, Oracle. All rights reserved.