|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.runtime.Plugin
com.adobe.flexbuilder.designmodel.DesignModelPlugin
public class DesignModelPlugin
A plugin that maintains browsable, editable object models that continuously synchronize with a corresponding source code document.
| Nested Class Summary | |
|---|---|
static interface |
DesignModelPlugin.EditEnabler
Passed to getModelForDocument |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.core.runtime.Plugin |
|---|
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME |
| Constructor Summary | |
|---|---|
DesignModelPlugin()
Constructor |
|
| Method Summary | |
|---|---|
void |
addModel(com.adobe.flexbuilder.designmodel.DesignModel model)
Add a model |
boolean |
checkResourcesDisposed()
|
ICSSModel |
createCSSModel()
Creates an empty CSS model. |
IMXMLModel |
createMXMLModel()
Creates an empty MXML model. |
static void |
defineFakeDefaultProperty(java.lang.String component,
java.lang.String property)
|
void |
editorGoingAway(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.viewers.ISelectionProvider selectionProvider,
org.eclipse.jface.text.IUndoManager undoManager)
Call this when an IDocument is going to be shut down, for example because an editor is being closed. |
IDesignModel |
getDebugModelForFile(java.lang.String filename,
com.adobe.flexbuilder.designmodel.MarkerSplitter splitter,
boolean editable)
|
static DesignModelPlugin |
getDefault()
Fetch the one-and-only singleton instance of the Design Model plugin. |
IDesignModel |
getEditableModelForFile(org.eclipse.core.resources.IFile file)
get the editable model for the file |
IDesignModel |
getEditorOrDiskModelForFile(org.eclipse.core.resources.IFile file,
boolean create)
If the given file is open in an editor, returns the model used by that editor. |
IDesignModel |
getModelForDocument(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.viewers.ISelectionProvider selectionProvider,
org.eclipse.jface.text.IUndoManager undoManager,
org.eclipse.core.resources.IFile file,
DesignModelPlugin.EditEnabler editEnabler)
Finds or creates a Design model that corresponds to the text of an IDocument. |
IDesignModel |
getModelForFile(org.eclipse.core.resources.IFile file)
Finds or creates a Design model corresponding to the file. |
IDesignModel |
getUniqueModelForFile(org.eclipse.core.resources.IFile file)
see getModelForFile. |
boolean |
hasModelForDocument(org.eclipse.jface.text.IDocument document)
Finds out if there already exists a design model that corresponds to the text of an IDocument. |
static boolean |
isCreateVirtualItems()
|
static boolean |
isDumpStateDebugInfo()
|
static boolean |
isEditorModel(IDesignModel model)
Returns whether a model is in use by an editor |
static boolean |
isUseHardCoded()
|
void |
removeModel(com.adobe.flexbuilder.designmodel.DesignModel model)
Remove a model |
void |
saveDiskModel(IDesignModel model)
If the given model is a model for a file on disk, saves the model out to the file. |
void |
selectionEvent(IDesignModel model,
org.eclipse.jface.viewers.SelectionChangedEvent event)
|
static void |
setCreateVirtualItems(boolean createVirtualItems)
|
static void |
setDumpStateDebugInfo(boolean dump)
|
void |
setEditListener(com.adobe.flexbuilder.designmodel.IEditListener endEdit)
|
static void |
setUseHardCoded(boolean useHardCoded)
|
void |
start(org.osgi.framework.BundleContext context)
This method is called upon plug-in activation |
void |
updateDocument(org.eclipse.core.resources.IFile oldFile,
org.eclipse.jface.text.IDocument newDocument,
org.eclipse.jface.viewers.ISelectionProvider selectionProvider,
org.eclipse.jface.text.IUndoManager undoManager,
org.eclipse.core.resources.IFile newFile,
boolean editable)
Call this when the IDocument/IFile associated with a model need to change, for example after doing a Save As or Rename. |
static java.lang.String |
xmlEscape(java.lang.String str)
Finds any special characters in a string and replaces them with the corresponding XML Entity. |
| Methods inherited from class org.eclipse.core.runtime.Plugin |
|---|
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DesignModelPlugin()
| Method Detail |
|---|
public void start(org.osgi.framework.BundleContext context)
throws java.lang.Exception
start in interface org.osgi.framework.BundleActivatorstart in class org.eclipse.core.runtime.Pluginjava.lang.Exceptionpublic boolean hasModelForDocument(org.eclipse.jface.text.IDocument document)
document - an IDocument, such as the document owned by a text editor
public IDesignModel getModelForDocument(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.viewers.ISelectionProvider selectionProvider,
org.eclipse.jface.text.IUndoManager undoManager,
org.eclipse.core.resources.IFile file,
DesignModelPlugin.EditEnabler editEnabler)
throws java.lang.Exception
Typical usage is:
IDocument doc = ....;
IDesignModel model = DesignModelPlugin.getDefault().getModelForDocument(doc);
document - an IDocument, such as the document owned by a text editorselectionProvider - the selection providerundoManager - the undo managerfile - the fileeditEnabler - the edit enabler
java.lang.Exception
public IDesignModel getModelForFile(org.eclipse.core.resources.IFile file)
throws java.lang.Exception
When the file is open/editable, the IDesignModel will notify listeners of all edits. When the file is closed/noneditable, the IDesignModel will notify listeners if the file is modified.
file - a file
file - system exceptions if we fail to open the file, or ModelEditException if the file's extension
is not MXML or CSS.
java.lang.Exception
public IDesignModel getUniqueModelForFile(org.eclipse.core.resources.IFile file)
throws java.lang.Exception
file - a file
java.lang.Exception
public IDesignModel getEditorOrDiskModelForFile(org.eclipse.core.resources.IFile file,
boolean create)
throws java.lang.Exception
file - the filecreate - whether to create the file
java.lang.Exceptionpublic static boolean isEditorModel(IDesignModel model)
model - the model in question
public void saveDiskModel(IDesignModel model)
throws org.eclipse.core.runtime.CoreException,
ModelEditException
model - the model
ModelEditException
org.eclipse.core.runtime.CoreException
public IDesignModel getEditableModelForFile(org.eclipse.core.resources.IFile file)
throws java.lang.Exception
file - the fiel
java.lang.Exception
public IDesignModel getDebugModelForFile(java.lang.String filename,
com.adobe.flexbuilder.designmodel.MarkerSplitter splitter,
boolean editable)
throws java.lang.Exception
java.lang.Exceptionpublic IMXMLModel createMXMLModel()
public ICSSModel createCSSModel()
public void updateDocument(org.eclipse.core.resources.IFile oldFile,
org.eclipse.jface.text.IDocument newDocument,
org.eclipse.jface.viewers.ISelectionProvider selectionProvider,
org.eclipse.jface.text.IUndoManager undoManager,
org.eclipse.core.resources.IFile newFile,
boolean editable)
public void editorGoingAway(org.eclipse.jface.text.IDocument document,
org.eclipse.jface.viewers.ISelectionProvider selectionProvider,
org.eclipse.jface.text.IUndoManager undoManager)
public static DesignModelPlugin getDefault()
public void addModel(com.adobe.flexbuilder.designmodel.DesignModel model)
model - model to addpublic void removeModel(com.adobe.flexbuilder.designmodel.DesignModel model)
model - model to removepublic boolean checkResourcesDisposed()
public static java.lang.String xmlEscape(java.lang.String str)
str -
public void selectionEvent(IDesignModel model,
org.eclipse.jface.viewers.SelectionChangedEvent event)
public static boolean isCreateVirtualItems()
public static void setCreateVirtualItems(boolean createVirtualItems)
public static boolean isUseHardCoded()
public static void setUseHardCoded(boolean useHardCoded)
public void setEditListener(com.adobe.flexbuilder.designmodel.IEditListener endEdit)
public static boolean isDumpStateDebugInfo()
public static void setDumpStateDebugInfo(boolean dump)
public static void defineFakeDefaultProperty(java.lang.String component,
java.lang.String property)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||