Extension SDK 9.0.5

oracle.jdeveloper.model
Class ApplicationFilter

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

public class ApplicationFilter
extends CategoryFilter
implements Observer

The ApplicationFilter class organizes the children of an application into a predefined structure. Children of the application that implement the Category interface are grouped based on the registered categories. An application currently can be structured into four categories: APPLICATION_CODE, WEB_CONTENT, RESOURCES, and DATABASE.


Nested Class Summary
 
Nested classes inherited from class oracle.jdeveloper.model.CategoryFilter
CategoryFilter.CategoryRegistry, CategoryFilter.CatInfo, CategoryFilter.JProjectComparator
 
Nested classes inherited from class oracle.ide.model.DefaultFilter
DefaultFilter.SortedComparator, DefaultFilter.SortedFolderFirstComparator
 
Field Summary
static int APPLICATION_CODE
           
static int DATABASE
           
static int RESOURCES
           
static int WEB_CONTENT
           
 
Fields inherited from class oracle.jdeveloper.model.CategoryFilter
LAST_CATEGORY_SHIFT, OPTION_VIEW_AS_LIST, PROJECT_REBUILT
 
Fields inherited from class oracle.ide.model.DefaultFilter
folderFirstComparator, folderFirstComparator2, sortedComparator
 
Fields inherited from interface oracle.ide.explorer.ChildFilter
NO_OPTIONS
 
Constructor Summary
ApplicationFilter()
           
ApplicationFilter(JProject project)
          Constructor.
 
Method Summary
static void addFilterHelper(ApplicationFilterHelper helper)
          Add an ApplicationFilterHelper.
static void addPackageObserver(Observer observer, Project project)
          Add an Observer to the list of observers to attach to any newly created packages for the given project.
 PackageFolder findPackageFolder(java.net.URL url)
          Finds the package folder associated with the specified url.
static PackageFolder findPackageFolder(java.net.URL url, Project project)
          Finds the package folder associated with the specified url.
protected  CategoryFilter.CategoryRegistry getCategoryRegistry()
          Subclass must override this method and return a registry containing valid categories.
static java.util.List getFilterHelpers(java.lang.Class cls)
          Return the list of ApplicationFilterHelpers that have requested interested in the specified element class.
 JProject getJProject()
          Get the current project.
 PackageFilter.PackageFactory getPackageFactory()
           
static PackageFilter.PackageFactory getPackageFactory(Project project)
           
 PackageFolder getPackageFolder(java.net.URL url)
          Returns the PackageFolder associated with the URL.
static PackageFolder getPackageFolder(java.net.URL url, Project project, PackageFilter filter)
          Returns the PackageFolder associated with the URL.
static java.util.Iterator getPackages(Project project)
           
protected  java.util.Iterator getProjectChildren()
           
 Element getSubject()
          Return the actual subject to which children are being added or removed.
protected  boolean handleAdd(Element element, CategoryFolder folder, java.util.List childrenAdded, ChildFilter folderFilter, Element subject, boolean checkOwner)
           
protected  boolean handleRemove(Element element, CategoryFolder folder, java.util.List childrenRemoved, ChildFilter folderFilter, Element subject)
           
static boolean isFilterSupported(int category, int filter)
          Returns whether the category with the specified ID supports the specified filter.
static void registerCategory(int category, java.lang.Class cls, java.lang.String label, javax.swing.Icon icon, int filtersSupported)
          Registers a new application category with the specified attributes.
static void removeFilterHelper(ApplicationFilterHelper helper)
          Remove the specified helper from the list of registered ApplicationFilterHelpers.
static PackageFolder removePackage(java.net.URL url, Project project)
          Remove the package pointed to by the url from the package cache associated with the given project.
static void removePackageObserver(Observer observer, Project project)
          Remove an Observer from the list of observers to attach to any newly created packages for the given project.
 void update(java.lang.Object observed, UpdateMessage change)
          Notification message.
 
Methods inherited from class oracle.jdeveloper.model.CategoryFilter
cache, canRefresh, canSupportFilter, canUpdate, childrenAdded, childrenRemoved, closeChildren, findCategoryFolder, getCategoryNode, getChildren, getComparator, getOptions, getType, isListView, newCategory, refresh, registerCategories, setListView, setOptions, setOwner, uncache, update
 
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

APPLICATION_CODE

public static final int APPLICATION_CODE

WEB_CONTENT

public static final int WEB_CONTENT

RESOURCES

public static final int RESOURCES

DATABASE

public static final int DATABASE
Constructor Detail

ApplicationFilter

public ApplicationFilter()

ApplicationFilter

public ApplicationFilter(JProject project)
Constructor.

Parameters:
project - the project whose children are to be filtered.
Method Detail

registerCategory

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

Parameters:
category - The ID for this category. See CategoryFilter.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.

addFilterHelper

public static void addFilterHelper(ApplicationFilterHelper helper)
Add an ApplicationFilterHelper. This helper will be called when building the children of an application category. The helper is only called if the helper indicates that is interested in the category and if the helper is interested in the class of node being processed.


removeFilterHelper

public static void removeFilterHelper(ApplicationFilterHelper helper)
Remove the specified helper from the list of registered ApplicationFilterHelpers.


getPackageFactory

public static PackageFilter.PackageFactory getPackageFactory(Project project)
Parameters:
project - the project associated with the sought after factory.
Returns:
the PackageFilter.PackageFactory.

getFilterHelpers

public static java.util.List getFilterHelpers(java.lang.Class cls)
Return the list of ApplicationFilterHelpers that have requested interested in the specified element class.


getPackageFolder

public static PackageFolder getPackageFolder(java.net.URL url,
                                             Project project,
                                             PackageFilter filter)
Returns the PackageFolder associated with the URL. If the PackageFolder does not exist, a new Node is created.

Parameters:
url - unique URL identifying the node.
project - the project associated with the package requested.
filter - the PackageFilter currently in use.
Returns:
an existing node or a newly created one.

findPackageFolder

public static PackageFolder findPackageFolder(java.net.URL url,
                                              Project project)
Finds the package folder associated with the specified url.

Returns:
null if no folder is found.

getPackages

public static java.util.Iterator getPackages(Project project)
Returns:
an Iterator for traversing all PackageFolders in the given project.

removePackage

public static PackageFolder removePackage(java.net.URL url,
                                          Project project)
Remove the package pointed to by the url from the package cache associated with the given project.

Returns:
the package removed or null if no package was found.

addPackageObserver

public static void addPackageObserver(Observer observer,
                                      Project project)
Add an Observer to the list of observers to attach to any newly created packages for the given project.


removePackageObserver

public static void removePackageObserver(Observer observer,
                                         Project project)
Remove an Observer from the list of observers to attach to any newly created packages for the given project. This method does not remove the observer from existing packages already being observed.


getJProject

public JProject getJProject()
Get the current project.


getPackageFactory

public PackageFilter.PackageFactory getPackageFactory()
Returns:
the PackageFilter.PackageFactory.

getPackageFolder

public PackageFolder getPackageFolder(java.net.URL url)
Returns the PackageFolder associated with the URL. If the PackageFolder does not exist, a new Node is created.

Parameters:
url - unique URL identifying the node.
Returns:
an existing node or a newly created one.

findPackageFolder

public PackageFolder findPackageFolder(java.net.URL url)
Finds the package folder associated with the specified url.

Returns:
null if no folder is found.

getSubject

public Element getSubject()
Return the actual subject to which children are being added or removed.


update

public void update(java.lang.Object observed,
                   UpdateMessage change)
Description copied from interface: Observer
Notification message. Subjects call this method when they notify their observers that the subjects state has changed.

Specified by:
update in interface Observer
Parameters:
observed - the subject whose state has changed.
change - what has changed.

getCategoryRegistry

protected CategoryFilter.CategoryRegistry getCategoryRegistry()
Description copied from class: CategoryFilter
Subclass must override this method and return a registry containing valid categories.

Overrides:
getCategoryRegistry in class CategoryFilter

getProjectChildren

protected java.util.Iterator getProjectChildren()
Overrides:
getProjectChildren in class CategoryFilter

handleRemove

protected boolean handleRemove(Element element,
                               CategoryFolder folder,
                               java.util.List childrenRemoved,
                               ChildFilter folderFilter,
                               Element subject)
Overrides:
handleRemove in class CategoryFilter

handleAdd

protected boolean handleAdd(Element element,
                            CategoryFolder folder,
                            java.util.List childrenAdded,
                            ChildFilter folderFilter,
                            Element subject,
                            boolean checkOwner)
Overrides:
handleAdd in class CategoryFilter

Extension SDK

 

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