Extension SDK

oracle.jdeveloper.model
Class JProjectFilter

java.lang.Object
  extended byoracle.ide.model.DefaultFilter
      extended byoracle.ide.model.FilelistFilter
          extended byoracle.jdeveloper.model.JProjectFilter
All Implemented Interfaces:
ChildFilter, Displayable

public class JProjectFilter
extends FilelistFilter

The JProjectFilter 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
static class JProjectFilter.CatInfo
           
 
Nested classes inherited from class oracle.ide.model.DefaultFilter
DefaultFilter.SortedComparator, DefaultFilter.SortedFolderFirstComparator
 
Field Summary
static int COMPONENT
           
static int DB_RESOURCE
           
static int DEPLOYMENT
           
static int EJB
           
static int JAVA_SOURCE
           
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
static int UML_DIAGRAM
           
static int WEB_SERVICE
           
static int WWW_SOURCE
           
 
Fields inherited from class oracle.ide.model.DefaultFilter
folderFirstComparator, sortedComparator
 
Fields inherited from interface oracle.ide.explorer.ChildFilter
NO_OPTIONS
 
Constructor Summary
JProjectFilter()
           
JProjectFilter(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 navigator is needs to determine the sensitivity of the Refresh menu item.
 TNode childrenAdded(java.util.List added, TNode par, 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 par, 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.
protected static JProjectFilter.CatInfo findCategoryInfo(int category)
           
static ChildFilter findFilter(TNode tnode, int filterType)
          Deprecated. Replace with JProjectStructureController.findFilter(TNode,int).
 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  JProject getProject()
           
 int getType()
          This method should return bitfield specifying the filter type.
static boolean isFilteredBy(TNode tnode, int filterType)
          Deprecated. Replace with JProjectStructureController.isFilteredBy(TNode,int).
static boolean isFilterSupported(int category, int filter)
          Returns whether the category with the specified ID supports the specified filter.
static boolean isFilterSupported(TNode tnode, int filter)
          Deprecated. Replace with JProjectStructureController.isFilterSupported(TNode,int).
static boolean isInProject(TNode tnode)
          Deprecated. Replace with JProjectStructureController.isInProject(TNode).
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.
static void registerCategory(int category, java.lang.Class cls)
          Deprecated. Replace with registerCategory(int,Class,String,Icon,int).
static void registerCategory(int category, java.lang.Class cls, int filtersSupported)
          Deprecated. Replace with registerCategory(int,Class,String,Icon,int).
static void registerCategory(int category, java.lang.Class cls, java.lang.String label)
          Deprecated. Replace with registerCategory(int,Class,String,Icon,int).
static void registerCategory(int category, java.lang.Class cls, java.lang.String label, javax.swing.Icon icon, int filtersSupported)
          Registers a new project category with the specified attributes.
static void registerCategory(int category, java.lang.Class cls, java.lang.String label, int filtersSupported)
          Deprecated. Replace with registerCategory(int,Class,String,Icon,int).
protected  void setListView(boolean listView)
           
 void setOptions(int options)
           
 void setOwner(TNode owner)
          Sets the node that owns this filter.
protected  void setProject(JProject project)
           
 void uncache(TNode node)
           
 TNode update(TNode node, UpdateMessage change)
          This method will be called when the navigator is needs to tell a filter that a property set notification has happened.
 
Methods inherited from class oracle.ide.model.DefaultFilter
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++;
 


JAVA_SOURCE

public static final int JAVA_SOURCE

WWW_SOURCE

public static final int WWW_SOURCE

DB_RESOURCE

public static final int DB_RESOURCE

EJB

public static final int EJB

COMPONENT

public static final int COMPONENT

UML_DIAGRAM

public static final int UML_DIAGRAM

DEPLOYMENT

public static final int DEPLOYMENT

WEB_SERVICE

public static final int WEB_SERVICE

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

JProjectFilter

public JProjectFilter()

JProjectFilter

public JProjectFilter(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.


registerCategory

public static void registerCategory(int category,
                                    java.lang.Class cls,
                                    java.lang.String label,
                                    javax.swing.Icon icon,
                                    int filtersSupported)
Registers a new project category with the specified attributes.

Parameters:
category - The ID for this category. See newCategory().
cls - The CategoryFolder subclass that represents this category; use null to specify a default CategoryFolder.
label - The display name used to represent this category.
icon - The display icon used to represent this category; use null to specify the default folder icon.
filtersSupported - The bit mask of FilterTypes supported by this category; specify FilterTypes.NONE if no filters are supported.

isFilterSupported

public static boolean isFilterSupported(int category,
                                        int filter)
Returns whether the category with the specified ID supports the specified filter.

Parameters:
category - the ID of the category.
filter - the ID of the filter to be supported, as specified by one of the constants in FilterTypes.

registerCategory

public static void registerCategory(int category,
                                    java.lang.Class cls,
                                    java.lang.String label,
                                    int filtersSupported)
Deprecated. Replace with registerCategory(int,Class,String,Icon,int).


registerCategory

public static void registerCategory(int category,
                                    java.lang.Class cls,
                                    java.lang.String label)
Deprecated. Replace with registerCategory(int,Class,String,Icon,int).


registerCategory

public static void registerCategory(int category,
                                    java.lang.Class cls,
                                    int filtersSupported)
Deprecated. Replace with registerCategory(int,Class,String,Icon,int).


registerCategory

public static void registerCategory(int category,
                                    java.lang.Class cls)
Deprecated. Replace with registerCategory(int,Class,String,Icon,int).


isFilterSupported

public static boolean isFilterSupported(TNode tnode,
                                        int filter)
Deprecated. Replace with JProjectStructureController.isFilterSupported(TNode,int).


findFilter

public static ChildFilter findFilter(TNode tnode,
                                     int filterType)
Deprecated. Replace with JProjectStructureController.findFilter(TNode,int).


isFilteredBy

public static boolean isFilteredBy(TNode tnode,
                                   int filterType)
Deprecated. Replace with JProjectStructureController.isFilteredBy(TNode,int).


isInProject

public static boolean isInProject(TNode tnode)
Deprecated. Replace with JProjectStructureController.isInProject(TNode).


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 par,
                           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 par,
                             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 class: DefaultFilter
This method will be called when the navigator is 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

update

public TNode update(TNode node,
                    UpdateMessage change)
Description copied from class: DefaultFilter
This method will be called when the navigator is needs to tell a filter that a property set notification has happened.

Specified by:
update in interface ChildFilter
Overrides:
update in class DefaultFilter

setProject

protected void setProject(JProject project)

getProject

protected JProject getProject()

isListView

protected boolean isListView()

setListView

protected void setListView(boolean listView)

findCategoryInfo

protected static JProjectFilter.CatInfo findCategoryInfo(int category)

Extension SDK

 

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