Skip navigation links

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

E17493-04


oracle.ide.model
Class ContentSetHelper

java.lang.Object
  extended by oracle.ide.model.ContentSetHelper


public class ContentSetHelper
extends java.lang.Object

The ContentSetHelper handles adding, restoring content, and removing content from a content set.

Note: Because ContentSetHelper methods can be called off the UI thread, subclasses must not invoke any UI during method processing.


Field Summary
protected  ApplicationContent _applicationContent
           
protected  ProjectContent _projectContent
           

 

Constructor Summary
ContentSetHelper(java.lang.String key)
          Constructs a new ContentSetHelper.

 

Method Summary
 void addApplicationContent(java.net.URL url, ApplicationContent applicationContent, boolean includeSubFolders, ProgressBar progressBar)
          Adds the URL to the ApplicationContent.
 void addContent(java.net.URL url, ProjectContent projectContent, boolean includeSubFolders, ProgressBar progressBar)
          Adds the URL to the ProjectContent.
protected  void addContentImpl(java.net.URL url, ContentSet contentSet, boolean includeSubFolders, ProgressBar progressBar)
          Adds the URL to the content set.
 boolean canAddApplicationContent(java.net.URL url, ApplicationContent applicationContent)
          Determines whether or not the URL can be added to the application.
 boolean canAddContent(java.net.URL url, ProjectContent projectContent)
          Determines whether or not the URL can be added to the project.
protected  ContentSet getApplicationBaseContentSet(ApplicationContent applicationContent)
          Gets the top-level content set for this application-level ContentSetHelper.
protected  ContentSet getBaseContentSet(ProjectContent projectContent)
          Gets the top-level content set for this ContentSetHelper.
protected  ContentSet newApplicationContentSet()
          Creates a new constituent content set
protected  ContentSet newContentSet()
          Creates a new constituent content set.
 void removeContent(java.net.URL url, ProjectContent projectContent)
          Removes the URL from the project.
protected  void removeContentImpl(java.net.URL url, ContentSet contentSet)
          Creates an exclude filter to exclude the URL from the content set.
 boolean restoreApplicationContent(java.net.URL url, ApplicationContent applicationContent)
          Restores a URL which has been excluded from the project.
 boolean restoreContent(java.net.URL url, ProjectContent projectContent)
          Restores a URL which has been excluded from the project.
protected  boolean restoreContentImpl(java.net.URL url, ContentSet contentSet)
          Restores a URL which has been excluded from a content set.
protected  boolean unExclude(java.lang.String pattern, ContentSet contentSet)
          Adjusts the filters in the supplied content set to include the relative path described by pattern.

 

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

 

Field Detail

_projectContent

protected ProjectContent _projectContent

_applicationContent

protected ApplicationContent _applicationContent

Constructor Detail

ContentSetHelper

public ContentSetHelper(java.lang.String key)
Constructs a new ContentSetHelper.
Parameters:
key - the data key for the content set which is modified by this helper

Method Detail

canAddContent

public boolean canAddContent(java.net.URL url,
                             ProjectContent projectContent)
Determines whether or not the URL can be added to the project. This implementation returns true as long as both the URL and the ProjectContent objects are non-null.

Note: Subclasses that override this method must not invoke any UI during its processing because it may be called off the event thread.

Parameters:
url - the url you want to add
projectContent - the ProjectContent you're adding to
Returns:
true if the url can be added to the project, false otherwise

canAddApplicationContent

public boolean canAddApplicationContent(java.net.URL url,
                                        ApplicationContent applicationContent)
Determines whether or not the URL can be added to the application. This implementation returns true as long as both the URL and the ApplicationContent objects are non-null.

Note: Subclasses that override this method must not invoke any UI during its processing because it may be called off the event thread.

Parameters:
url - the url you want to add
applicationContent - the ApplicationContent you're adding to
Returns:
true if the url can be added to the application, false otherwise

addContent

public final void addContent(java.net.URL url,
                             ProjectContent projectContent,
                             boolean includeSubFolders,
                             ProgressBar progressBar)
Adds the URL to the ProjectContent. When a folder URL is supplied, you can optionally include subfolders too.
Parameters:
url - a file or folder URL
projectContent - the target ProjectContent object
includeSubFolders - indicates whether or not subfolders are added (ignored if the supplied URL is not a directory)
progressBar - when non-null, use the supplied progressBar to show progress during a long-running process. If progressBar is null, this method is being called off the event thread, so no UI should be shown.

addApplicationContent

public final void addApplicationContent(java.net.URL url,
                                        ApplicationContent applicationContent,
                                        boolean includeSubFolders,
                                        ProgressBar progressBar)
Adds the URL to the ApplicationContent. When a folder URL is supplied, you can optionally include subfolders too.
Parameters:
url - a file or folder URL
applicationContent - the target ApplicationContent object
includeSubFolders - indicates whether or not subfolders are added (ignored if the supplied URL is not a directory)
progressBar - when non-null, use the supplied progressBar to show progress during a long-running process. If progressBar is null, this method is being called off the event thread, so no UI should be shown.

addContentImpl

protected void addContentImpl(java.net.URL url,
                              ContentSet contentSet,
                              boolean includeSubFolders,
                              ProgressBar progressBar)
Adds the URL to the content set. Subclasses should override this to do any special processing that needs to happen to correctly add the URL to the content set. For Java content, for example, the source root must be determined and set for the content set.

Note: Subclasses that override this method must not invoke any UI during its processing because it may be called off the event thread.

Parameters:
url - a file or folder URL
contentSet - the target content set
includeSubFolders - indicates whether or not subfolders are added (ignored if the supplied url is a file)
progressBar - when non-null, the supplied progressBar can be used to show progress during a long-running process. If progressBar is null, this method is being called off the event thread, so no UI should be shown.

restoreContent

public final boolean restoreContent(java.net.URL url,
                                    ProjectContent projectContent)
Restores a URL which has been excluded from the project. If the supplied URL is a child of the project and the URL is excluded from the content set, a new include filter is added to ensure the URL is no longer excluded. If the URL is not a child of the content set, the method does nothing and returns false.
Parameters:
url - the URL to "unexclude" from the content set
projectContent - the target project
Returns:
true if the URL was "unexcluded" from this content set. If the ContentSet cannot contain this URL, false is returned.
See Also:
#addContent(URL, ProjectContent, boolean, IndeterminateProgressMonitor)

restoreApplicationContent

public final boolean restoreApplicationContent(java.net.URL url,
                                               ApplicationContent applicationContent)
Restores a URL which has been excluded from the project. If the supplied URL is a child of the project and the URL is excluded from the content set, a new include filter is added to ensure the URL is no longer excluded. If the URL is not a child of the content set, the method does nothing and returns false.
Parameters:
url - the URL to "unexclude" from the content set
projectContent - the target project
Returns:
true if the URL was "unexcluded" from this content set. If the ContentSet cannot contain this URL, false is returned.
See Also:
#addContent(URL, ProjectContent, boolean, IndeterminateProgressMonitor)

restoreContentImpl

protected boolean restoreContentImpl(java.net.URL url,
                                     ContentSet contentSet)
Restores a URL which has been excluded from a content set. This returns false if contentSet cannot contain the supplied URL.

Note: Subclasses that override this method must not invoke any UI during its processing because it may be called off the event thread.

Parameters:
url - the URL to "unexclude" from the content set
contentSet - the content set to update
Returns:
true if the URL was "unexcluded" from this content set. If the ContentSet cannot contain this URL, false is returned.

unExclude

protected final boolean unExclude(java.lang.String pattern,
                                  ContentSet contentSet)
Adjusts the filters in the supplied content set to include the relative path described by pattern.
Parameters:
pattern - a path relative to the content set's URLPath
contentSet - the content set to update
Returns:
true if the filters were modified to include the content, false if the filters were not modified

removeContent

public final void removeContent(java.net.URL url,
                                ProjectContent projectContent)
Removes the URL from the project.
Parameters:
url - the URL to remove
projectContent - the target ProjectContent object

removeContentImpl

protected void removeContentImpl(java.net.URL url,
                                 ContentSet contentSet)
Creates an exclude filter to exclude the URL from the content set.

Note: Subclasses that override this method must not invoke any UI during its processing because it may be called off the event thread.

Parameters:
url - the URL to exclude
contentSet - the target project

newContentSet

protected final ContentSet newContentSet()
Creates a new constituent content set. Subclasses should call this method create new level-2 content sets.
Returns:
the new content set

newApplicationContentSet

protected final ContentSet newApplicationContentSet()
Creates a new constituent content set
Returns:
the new application content set

getBaseContentSet

protected final ContentSet getBaseContentSet(ProjectContent projectContent)
Gets the top-level content set for this ContentSetHelper.

getApplicationBaseContentSet

protected final ContentSet getApplicationBaseContentSet(ApplicationContent applicationContent)
Gets the top-level content set for this application-level ContentSetHelper.

Skip navigation links

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

E17493-04


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