Extension SDK 9.0.5

oracle.jdeveloper.vcs.util
Class VCSModelUtils

java.lang.Object
  extended byoracle.jdeveloper.vcs.util.VCSModelUtils

public final class VCSModelUtils
extends java.lang.Object

Utility class for document model operations.

Since:
9.0.5

Method Summary
static java.net.URL[] convertNodesToURLs(java.util.Collection 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 Locatable[] findOrCreateNodes(java.net.URL[] urls)
          Finds or creates locatables for the given URLs, using the node cache.
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 Document[] getDirtyDocuments(Document[] documents)
          Gets the documents 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.
 
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.

Returns:
the resulting array of URLs.

convertNodesToURLs

public static final java.net.URL[] convertNodesToURLs(java.util.Collection locatables)
Converts the given locatables into their associated URLs.

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.

getDirtyDocuments

public static final Document[] getDirtyDocuments(Document[] documents)
Gets the documents from the given selection which are dirty.

Parameters:
documents - an array of documents.
Returns:
the resulting array of documents 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.

Extension SDK

 

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