Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.jdeveloper.vcs.util
Class VCSModelUtils

java.lang.Object
  extended by oracle.jdeveloper.vcs.util.VCSModelUtils


public final class VCSModelUtils
extends java.lang.Object

Utility class for node model operations.

Since:
9.0.5

Method Summary
static java.net.URL[] convertNodesToURLs(java.util.Collection<? extends Locatable> locatables)
          Converts the given locatables into their associated URLs.
static java.net.URL[] convertNodesToURLs(Locatable[] locatables)
          Converts the given locatables into their associated URLs.
static Node[] findCachedNodes(URLFilter filter)
          Finds nodes cached in the IDE whose files satisfy the given URL filter.
static Project[] findCachedProjects()
          Gets all open Project type nodes cached in the NodeFactory.
static Project[] findCachedProjects(boolean openWorkspaces)
          Deprecated. replaced by findCachedProjects(). Workspaces no longer need to be opened in order to discover their children.
static Workspace[] findCachedWorkspaces()
          Gets all open Workspace type nodes cached in the NodeFactory.
static Locatable[] findOrCreateNodes(java.net.URL[] urls)
          Finds or creates locatables for the given URLs, using the node cache.
static void fireProjectStructuresChanged()
          Deprecated. replaced with VCSCommand.fireFileStructureChanged(java.net.URL[]) and VCSFileEventSender.fireFileStructureChanged(java.net.URL[]).
static void fireProjectStructuresChanged(java.net.URL[] projectContentsUrls)
          Deprecated. replaced with VCSCommand.fireFileStructureChanged(java.net.URL[]) and VCSFileEventSender.fireFileStructureChanged(java.net.URL[]).
static void fireVetoableCanRemoveChildren(java.lang.Object[] elements)
          Fores a vetoable UpdateMessage.CAN_REMOVE_CHILD message on all projects which contain the given elements.
static Node[] getCachedBaseURLNodes(java.net.URL[] baseUrls)
          Gets all cached nodes with URLs underneath the given base URLs.
static Node[] getCachedDirectoryNodes(java.net.URL[] directoryUrls)
          Gets all cached nodes with URLs in the given directories.
static Node[] getDirtyNodes(Node[] nodes)
          Gets the nodes from the given selection which are dirty.
static java.net.URL getLocatableURL(java.lang.Object node)
          Gets the given node's URL, if the node is a locatable.
static Locatable[] getValidLocatables(java.lang.Object[] nodes, URLFilter filter)
          Gets the valid locatables from the given node selection.
static boolean isElementSaveUpdate(java.lang.Object observed, UpdateMessage change)
          Asks whether the given update message indicates that the observed node has been saved.
static java.lang.String[] listBinaryExtensions()
          Deprecated. replaced by VCSFileSystemUtils.listBinaryExtensions().
static java.net.URL[] listProjectURLs(Project project, VCSCancellable cancellable)
          Lists all content URLs belonging to the given project, if open.
static java.net.URL[] listProjectURLs(Project project, VCSCancellable cancellable, boolean includeDirectories)
          Lists all content URLs belonging to the given project, if open.

 

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

 

Method Detail

findOrCreateNodes

public static final Locatable[] findOrCreateNodes(java.net.URL[] urls)
Finds or creates locatables for the given URLs, using the node cache. This method will create default Folder instances for directory path URLs.
Parameters:
urls - the array of URLs for the nodes to find or create.
Returns:
the resulting array of locatables.

convertNodesToURLs

public static final java.net.URL[] convertNodesToURLs(Locatable[] locatables)
Converts the given locatables into their associated URLs.
Parameters:
locatables - the array of locatables to convert.
Returns:
the resulting array of URLs.

convertNodesToURLs

public static final java.net.URL[] convertNodesToURLs(java.util.Collection<? extends Locatable> locatables)
Converts the given locatables into their associated URLs.
Parameters:
locatables - the collection of locatables to convert.
Returns:
the resulting array of URLs.

isElementSaveUpdate

public static final boolean isElementSaveUpdate(java.lang.Object observed,
                                                UpdateMessage change)
Asks whether the given update message indicates that the observed node has been saved. This is determined by checking before and after values of the element's DIRTY attribute.
Parameters:
observed - the observed subject.
change - the update message.
Returns:
a verdict on whether the update message is a save.

getValidLocatables

public static final Locatable[] getValidLocatables(java.lang.Object[] nodes,
                                                   URLFilter filter)
Gets the valid locatables from the given node selection.
Parameters:
nodes - the original node selection.
filter - a filter that accepts valid locatable URLs. (null-capable)
Returns:
the valid locatable array.

getLocatableURL

public static final java.net.URL getLocatableURL(java.lang.Object node)
Gets the given node's URL, if the node is a locatable. This method performs the instance test and cast. It may be used as a shorthand for (node instanceof Locatable ? ((Locatable)node).getURL() : null).
Parameters:
node - the node.
Returns:
the node's URL, if it's a valid locatable.

findCachedNodes

public static final Node[] findCachedNodes(URLFilter filter)
Finds nodes cached in the IDE whose files satisfy the given URL filter.
Parameters:
filter - a filter that accepts URLs for cached nodes. (null-capable)
Returns:
the array of accepted nodes.

getDirtyNodes

public static final Node[] getDirtyNodes(Node[] nodes)
Gets the nodes from the given selection which are dirty.
Parameters:
nodes - an array of nodes.
Returns:
the resulting array of nodes which are dirty.

getCachedDirectoryNodes

public static final Node[] getCachedDirectoryNodes(java.net.URL[] directoryUrls)
Gets all cached nodes with URLs in the given directories.
Parameters:
directoryUrls - the array of directories for returned cached nodes.
Returns:
the array of cached nodes.

getCachedBaseURLNodes

public static final Node[] getCachedBaseURLNodes(java.net.URL[] baseUrls)
Gets all cached nodes with URLs underneath the given base URLs.
Parameters:
baseUrls - the array of base URLs for returned cached nodes.
Returns:
the array of cached nodes.

listBinaryExtensions

@Deprecated
public static final java.lang.String[] listBinaryExtensions()
Deprecated. replaced by VCSFileSystemUtils.listBinaryExtensions().
List all recognized binary file extensions registered with the IDE. Extensions are in the sanitized form, so they will include the leading '.' before the suffix.
Returns:
the array of recognized extensions.

findCachedWorkspaces

public static final Workspace[] findCachedWorkspaces()
Gets all open Workspace type nodes cached in the NodeFactory.
Returns:
the array of cached workspace nodes.

findCachedProjects

public static final Project[] findCachedProjects()
Gets all open Project type nodes cached in the NodeFactory.
Returns:
the array of cached project nodes.

findCachedProjects

@Deprecated
public static final Project[] findCachedProjects(boolean openWorkspaces)
Deprecated. replaced by findCachedProjects(). Workspaces no longer need to be opened in order to discover their children.
Gets all open Project type nodes cached in the NodeFactory.
Parameters:
openWorkspaces - a decision on whether workspaces should be opened. If true and the calling thread is not the AWT event dispatcher, please be aware that there may be risk of deadlock while this method is blocking.
Returns:
the array of cached project nodes.

fireProjectStructuresChanged

@Deprecated
public static final void fireProjectStructuresChanged()
Deprecated. replaced with VCSCommand.fireFileStructureChanged(java.net.URL[]) and VCSFileEventSender.fireFileStructureChanged(java.net.URL[]).
Fires an UpdateMessage.STRUCTURE_CHANGED message on all projects.

fireProjectStructuresChanged

@Deprecated
public static final void fireProjectStructuresChanged(java.net.URL[] projectContentsUrls)
Deprecated. replaced with VCSCommand.fireFileStructureChanged(java.net.URL[]) and VCSFileEventSender.fireFileStructureChanged(java.net.URL[]).
Fires an UpdateMessage.STRUCTURE_CHANGED message on all projects whose content sets may include any of the given URLs.
Parameters:
projectContentsUrls - the URLs which have been affected by an operation.

fireVetoableCanRemoveChildren

public static final void fireVetoableCanRemoveChildren(java.lang.Object[] elements)
                                                throws ChangeVetoException
Fores a vetoable UpdateMessage.CAN_REMOVE_CHILD message on all projects which contain the given elements.
Parameters:
elements - the URLs which will be affected by a remove operation.
Throws:
ChangeVetoException - if the removal was vetoed.

listProjectURLs

public static final java.net.URL[] listProjectURLs(Project project,
                                                   VCSCancellable cancellable)
                                            throws java.lang.InterruptedException
Lists all content URLs belonging to the given project, if open.
Parameters:
project - the project.
cancellable - an object representing the cancellable state. (null-capable)
Returns:
the array of project content URLs.
Throws:
java.lang.InterruptedException - if the process was interrupted.

listProjectURLs

public static final java.net.URL[] listProjectURLs(Project project,
                                                   VCSCancellable cancellable,
                                                   boolean includeDirectories)
                                            throws java.lang.InterruptedException
Lists all content URLs belonging to the given project, if open.
Parameters:
project - the project.
cancellable - an object representing the cancellable state. (null-capable)
includeDirectories - a decision on whether to return directory URLs in addition to regular file URLs.
Returns:
the array of project content URLs.
Throws:
java.lang.InterruptedException - if the process was interrupted.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


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