Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.model
Class ContentLevelFilter

java.lang.Object
  extended by oracle.ide.model.ContentLevelFilter
Direct Known Subclasses:
AsynchronousContentLevelFilter

public abstract class ContentLevelFilter
extends java.lang.Object

This class is responsible for filtering the breadth-first traversal implemented by the ContentLevel class to provide a virtual representation of each level that differs from its physical representation. A ContentLevelFilter may:

A ContentLevelFilter is registered statically via ContentLevel.addContentLevelFilter(oracle.ide.model.ContentLevelFilter). The filters are called during a ContentLevel traversal when the ContentLevel is used in a Context where ContentLevelFilter behavior is enabled. For example, the IDE's System Navigator disables the filtering, but the Application Navigator enables the filtering.


Constructor Summary
protected ContentLevelFilter(java.lang.String[] contentSetKeys)
          Creates a ContentLevelFilter that works on the content sets with the specified keys.
 
Method Summary
abstract  void updateDir(URLPath srcRoots, java.lang.String dirRelPath, java.util.List elementList, java.util.List subdirList, Context context)
          This method is called whenever a level is expanded during the breadth-first traversal of the project content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentLevelFilter

protected ContentLevelFilter(java.lang.String[] contentSetKeys)
Creates a ContentLevelFilter that works on the content sets with the specified keys.

Parameters:
contentSetKeys - A non-null, non-empty array of content set keys for which this ContentLevelFilter will apply. All of the keys must be a value returned by some ContentSetProvider.getKey() method.
Throws:
java.lang.IllegalArgumentException - if contentSetKeys is null or empty or if any item in the contentSetKeys array is null.
Method Detail

updateDir

public abstract void updateDir(URLPath srcRoots,
                               java.lang.String dirRelPath,
                               java.util.List elementList,
                               java.util.List subdirList,
                               Context context)
This method is called whenever a level is expanded during the breadth-first traversal of the project content. Implementations of this method have the opportunity to modify the lists of Elements and subdirectories for each level before they are displayed. Whenever there are multiple ContentLevelFilter applying changes to the same level, later filters will see the effect of earlier filters and could possibly perform further filtering on them.

Filtering at the file level is done by adding/removing Elements to/from the given elementList.

Filering subdirectories involves first removing the Element representing the subdirectory from the given subdirList. If no further action is taken, the subdirectory will not be displayed. However if the removed subdirectory is then added to the elementList, the subdirectory will be displayed, even if it's empty (unless a later ContentLevelFilter removes it). Nothing can be added to the subdirList; a runtime exception will be thrown on any attempt to add or modify an item to subdirList.

Parameters:
srcRoots - The list of source root directories that underly the current content level being expanded.

dirRelPath - The relative path within the srcRoots where the content level expansion is occurring. When expanding the very first level, dirRelPath is "" (i.e. the empty string).

elementList - This is a List of Elements that initially contains Node instances for all files in the dirRelPath. If an item is removed from elementList, it will not be displayed. If an Element is added to the elementList, it will be displayed. An attempt to add a non-Element type to the elementList will cause a runtime exception to be thrown. When multiple filters modify the elementList for the same dirRelPath, later filters will see the effect of earlier filters.

subdirList - This is a List of RelativeDirectoryContextFolder instances that initially contains all the subdirectories under the dirRelPath, accounting for the flat level currently being used by the ContentLevel. (This means that when expanding the root-level "" dirRelPath, the subdirList will contain all subdirectories up to the flat level. So if the flat level is 3, the subdirList at dirRelPath "" will contain the first 3 levels of subdirectories.) The filter implementation may take one of three actions for each item in subdirList:
  • Remove the item. This results in the corresponding folder not being displayed at all.
  • Move the item to elementList. This forces the corresponding folder to be displayed, even if it is empty.
  • Leave the item in subdirList. This means that the decision to show or hide the folder is left to later filters and/or the IDE. After all filters have been called, any remaining items in the subdirList will be processed as follows:
    • If the subdirectory contains files, the folder is displayed.
    • Else
      • If the subdirectory also has no subdirectories, the folder is not displayed.
      • Else if the dirRelPath is ""
        • If the folder's depth is less than the navigator's flat-level setting, the folder is not displayed (because deeper levels are also flattened).
        • Else the folder is displayed.
      • Else the folder is displayed.

context - The context in which the level expansion is occurring.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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