com.adobe.flexbuilder.codemodel.common
Class CMFactory

java.lang.Object
  extended bycom.adobe.flexbuilder.codemodel.common.CMFactory

public class CMFactory
extends java.lang.Object

The Code Model Factory where you get most of the singletons for the Code Model


Constructor Summary
CMFactory()
           
 
Method Summary
static boolean canParseFile(java.lang.String absFilePath)
          Determines if this file is one that is parseable by Code Model
static IASIdentifierAnalyzer getASIdentifierAnalyzer()
          Get the ActionScript identifier analyzer, which can be used to test for legal file names and knows all of the ActionScript keywords.
static ICodeChangeProxy getCodeChangeProxy()
          Get the code change proxy (used to let code model listen to document changes)
static java.lang.Object getLockObject()
          Get the code model's lock object.
static IProjectManager getManager()
          Get the project manager
static IRegistrar getRegistrar()
          Get the registrar, which allows clients to register files and projects with the code model
static org.eclipse.core.resources.IResource getResourceFromAbsolutePath(java.lang.String absolutePath)
          Returns the IResource
static ISwcManager getSwcManager()
          Get the swc manager (used to get icons and swfs embedded in a swc)
static boolean hasLockObject()
          Determine whether the current thread holds a lock on the code model's lock object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMFactory

public CMFactory()
Method Detail

getManager

public static IProjectManager getManager()
Get the project manager

Returns:
The project manager

getLockObject

public static java.lang.Object getLockObject()
Get the code model's lock object. All code model queries that use IProjectManager, IProject, IFile, IType, etc. must be enclosed in a block that looks like this:
 synchronized (CMFactory.getLockObject())
 {
     // code model queries go here.
 }
 

WARNING: The block should not do anything other than query the code model. In particular, it should not call any code that might want to run an IWorkspaceRunnable job. (An assertion will fail in FlexWorkspaceRunner if you try this).

Returns:
locking object

hasLockObject

public static boolean hasLockObject()
Determine whether the current thread holds a lock on the code model's lock object. Used to enforce synchronization rules.

Returns:
true if the current thread holds the lock

getASIdentifierAnalyzer

public static IASIdentifierAnalyzer getASIdentifierAnalyzer()
Get the ActionScript identifier analyzer, which can be used to test for legal file names and knows all of the ActionScript keywords.

Returns:
The ActionScript identifier analyzer

getCodeChangeProxy

public static ICodeChangeProxy getCodeChangeProxy()
Get the code change proxy (used to let code model listen to document changes)

Returns:
The code change proxy

getSwcManager

public static ISwcManager getSwcManager()
Get the swc manager (used to get icons and swfs embedded in a swc)

Returns:
The swc manager

getRegistrar

public static IRegistrar getRegistrar()
Get the registrar, which allows clients to register files and projects with the code model


canParseFile

public static boolean canParseFile(java.lang.String absFilePath)
Determines if this file is one that is parseable by Code Model

Parameters:
absFilePath -
Returns:
true if we can parse it

getResourceFromAbsolutePath

public static org.eclipse.core.resources.IResource getResourceFromAbsolutePath(java.lang.String absolutePath)
Returns the IResource

Parameters:
absolutePath - the absolute path on the file system
Returns:
an IResource or null