|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.Project
org.formaria.editor.project.EditorProject
public class EditorProject
An extension of the project to provide access to additional properties and facilities used while editing a project
Copyright (c) Formaria Ltd., 2002-2004
$Revision: 1.54 $
License: see License.txt
| Field Summary | |
|---|---|
protected java.lang.String |
appStyle
|
protected java.lang.String |
appTitle
|
protected boolean |
centerWindow
|
static int |
DEVELOPER_MODE
|
static int |
EXPERT_MODE
|
protected java.lang.String |
firstPage
|
protected boolean |
fixProject
|
protected java.lang.String |
frameFile
|
protected java.lang.String[] |
frameFiles
|
protected java.lang.String |
framesetName
|
protected int[] |
frameSizes
|
protected int |
height
|
protected java.lang.String |
iconFileName
|
protected java.lang.String |
lafName
|
protected int |
logLevel
|
protected java.lang.String |
modelFile
|
static int |
NOVICE_MODE
|
protected boolean |
openInFrames
|
protected java.lang.String |
packageName
|
protected java.lang.String |
path
|
protected java.lang.String |
projectTitle
|
protected EditorRegisteredComponentFactory |
registeredComponentFactory
|
protected java.lang.String |
styleFile
|
protected boolean |
swingClient
|
protected java.lang.String |
toolbarFile
|
protected boolean |
useFrames
|
protected boolean |
useToolbar
|
protected boolean |
useWindow
|
protected java.lang.String |
widgetSet
|
protected int |
width
|
| Fields inherited from class org.formaria.aria.Project |
|---|
basePackageName, CLOSING, CREATED, customClassLoaders, defaultEncoding, defaultFile, defaultModelClass, documentBase, eventHandlerClassName, exceptionHandler, imageCache, INITIALIZED, managerObjects, messageHelper, modelRoot, pageManager, resourceBundleLoader, RESTARTING, STARTED, startSettings, startupFile, startupObject, status, styleManager, TERMINATED, UNKNOWN, widgetPackageName, xmlParserFactory |
| Method Summary | |
|---|---|
boolean |
addComponentEntry(XmlElement xml)
Add to the components.xml file of this project |
void |
addComponentSelectionListener(ComponentSelectListener listener)
|
void |
addCustomManagerObject(java.lang.Object key,
java.lang.Object value)
|
void |
addModelListener(ModelListener listener)
|
void |
addPage(java.lang.String name,
java.lang.String ext)
Add a new Screen to the Hashtable with the key of the name parameter |
PageResource |
addPage(java.lang.String newPageName,
java.lang.String ext,
java.lang.String className)
Add a new page to the project |
boolean |
canAccessDefaultPackage(java.lang.ClassLoader cl,
java.lang.String path)
Can the project access the default package. |
protected void |
changePropertiesFile()
Change the necessary values of the properties file. |
protected void |
checkExtraProperties()
Check that all the extra properties are configured |
protected void |
checkProject()
Check that the necessary data sources are setup |
void |
componentSelected(PagePanel ownerPage,
java.util.Vector selectedComponents,
boolean contentsChanged)
Triggered when components are selected in the pagePanel |
void |
createProjectFile()
Called when the create button on the NewProject dialog is clicked. |
void |
generate(java.io.Writer w)
Write a project to a stream. |
protected void |
generateFrameFile()
Write the frame file |
java.util.HashMap |
getAllPageResources()
Get the pages Hashtable |
java.lang.String |
getAppStyle()
|
java.lang.String |
getAppTitle()
|
java.lang.Object[] |
getBindingFactories()
Get the class names of the binding factory classes |
boolean |
getCenterWindow()
|
java.lang.String |
getClassPath()
Get the path for compiled classes |
java.lang.Object[] |
getComponentFactories()
Set the class names of the component factory classes |
java.util.Hashtable |
getCustomManagerObjects()
|
EditorValidationFactory |
getDefaultValidationFactory()
|
static IEditorUtility |
getEditorUtility()
|
java.lang.String |
getFirstPage()
|
java.lang.String |
getFrameFile()
|
java.lang.String[] |
getFrameFiles()
|
int[] |
getFrameSizes()
|
int |
getHeight()
|
java.awt.Image |
getImage(java.lang.Class clazz,
java.lang.String name)
Loads an image resource |
java.awt.Image |
getImage(java.lang.String name)
Loads an image resource |
java.awt.Image |
getImage(java.net.URL url)
Loads an image resource |
java.io.InputStream |
getInputStream(java.lang.String fileName)
Gets a stream for a resource |
java.lang.String |
getLafName()
Get the name of the applications's LAF |
int |
getLogLevel()
|
java.util.Hashtable |
getManagerObjects()
Get the hashtable of manager objects |
int |
getMode()
Gets the editor mode. |
java.lang.String |
getModelFile()
|
boolean |
getOpenInFrames()
Get the open in framse flag |
java.lang.String |
getPackageName()
Get the default package name |
PageResource |
getPage(int pos)
|
PageResource |
getPageResource(java.lang.String name,
java.lang.String ext)
Gets the Screen object stored in the Hashtable under the 'name' parameter |
java.util.HashMap |
getPageResources()
Get the pages Hashtable |
java.lang.String |
getPath()
Get the Project path |
ProjectClassLoader |
getProjectClassLoader()
Gets the ProjectClassLoader object. |
java.lang.String |
getProjectName()
|
java.lang.String |
getProjectTitle()
|
int |
getSize()
|
java.lang.String |
getStartupFilePath()
Returns the path to the startup file so that plugins can set project info |
static java.lang.String |
getStrippedFileName(java.lang.String projectPath)
Get the basic file name from the argument e.g. |
static java.lang.String |
getStrippedPath(java.lang.String projectPath)
Get the basic path from the argument e.g. |
StyleFactory |
getStyleFactory()
|
java.lang.String |
getStyleFile()
|
static java.lang.String |
getSubPath(java.lang.String path)
Get the subpath regardless of how the file name is formatted, i.e. |
java.lang.String |
getToolbarFile()
Get the toolbar file name |
Translator |
getTranslator(java.lang.String name)
Get the translation object for the named bundle. |
boolean |
getUseFrames()
|
boolean |
getUseToolbar()
|
boolean |
getUseWindow()
|
XmlElement |
getValidation(java.lang.String validationName)
|
boolean |
getValidationExists(java.lang.String validationName)
|
java.lang.String |
getValidationFactory()
Get the name of the validation factory class |
java.lang.String[] |
getValidations()
|
java.lang.String |
getValidationsFile()
Get the name of the validation rules file |
java.lang.String |
getWidgetSet()
|
int |
getWidth()
|
boolean |
hasFrames()
Has the project got a frameset |
boolean |
hasProject()
|
void |
initialise(java.lang.String projectPath,
java.lang.String startupFile)
Setup the project, this method should not be called from client code |
boolean |
isModified()
|
boolean |
isSwingClient()
|
void |
modelChanged()
Triggered when the data model is changed |
EditorProject |
parse(java.lang.String filePath,
java.lang.String startupFile,
java.io.Reader r)
Read a project from a stream |
protected void |
readOtherProperties(XmlElement otherProperties)
Load any extra project proerties from the config |
java.lang.Object |
readResolve()
Resolve to singleton instance |
protected void |
registerHelpers()
|
void |
reloadFramesFile(java.io.InputStream is)
Reload the frames file |
void |
reloadStartupFile(java.io.InputStream is)
Reload the project settings file |
void |
removeAllPages()
Remove all page resources from the project |
void |
removeComponentSelectionListener(ComponentSelectListener listener)
|
void |
removeModelListener(ModelListener listener)
|
void |
removePage(java.lang.String pageName,
java.lang.String ext)
Remove a page resource from the project |
void |
replacePage(java.lang.String pageName,
java.lang.String ext,
Page updatedPage)
Replace a page resource from the project with an updated version |
void |
save()
Save the current project. |
protected void |
saveOtherProperties(XmlElement otherProperties)
Save any extra project proerties from the config |
protected void |
saveStartupFile()
|
void |
setAppStyle(java.lang.String style)
|
void |
setAppTitle(java.lang.String newTitle)
|
void |
setBindingFactories(java.lang.Object[] factories)
Set the class names of the binding factory classes |
void |
setCenterWindow(boolean state)
|
void |
setComponentFactories(java.lang.Object[] factories)
Set the class names of the component factory classes |
void |
setDataObject(Modifiable pdo)
|
static void |
setEditorUtility(IEditorUtility eu,
boolean isEclipse)
|
void |
setFirstPage(java.lang.String first)
|
void |
setFixProject(boolean fixProject)
|
void |
setFrameFile(java.lang.String newFile)
|
void |
setFrameFiles(java.lang.String[] files)
|
void |
setFrameset(java.lang.String framesSet)
Set the frameset name for the project |
void |
setFrameSizes(int[] sizes)
|
void |
setHeight(int h)
|
void |
setJavaSource(java.lang.String screenName,
java.lang.String src)
|
void |
setLafName(java.lang.String laf)
Set the name of the applications's LAF |
void |
setLogLevel(int level)
|
void |
setMode(int newMode)
Sets the editor mode. |
void |
setModelFile(java.lang.String newFile)
|
void |
setModified(boolean newState)
|
void |
setOpenInFrames()
Open the next page in a frameset |
void |
setPackageName(java.lang.String newPackage)
Set the default package name. |
void |
setPath(java.lang.String p)
Set the path of the Project |
void |
setProjectClassLoader(ProjectClassLoader cl)
|
void |
setProjectTitle(java.lang.String newTitle)
|
boolean |
setStartupParam(java.lang.String key,
java.lang.String value)
Change or add a startup property |
boolean |
setStartupProperty(java.lang.String fieldName,
java.lang.String fieldValue)
Change the startup property, the associated properties file is saved on each change |
void |
setStyleFile(java.lang.String newFile)
|
void |
setSwingClient(boolean state)
|
void |
setToolbarFile(java.lang.String fn)
Set the toolbar file name |
protected void |
setupProjectClassLoader()
Sets the class loader for the current project |
void |
setUseFrames(boolean state)
|
void |
setUseToolbar(boolean state)
Set the flag to use a toolbar |
void |
setUseWindow(boolean state)
|
void |
setValidationFactory(java.lang.String factoryName)
Set the name of the validation factory class |
void |
setValidationsFile(java.lang.String rulesFile)
Set the name of the validation rules file |
void |
setWidgetSet(java.lang.String set)
|
void |
setWidth(int w)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected EditorRegisteredComponentFactory registeredComponentFactory
protected java.lang.String packageName
protected java.lang.String path
protected java.lang.String framesetName
protected java.lang.String projectTitle
protected java.lang.String appTitle
protected java.lang.String firstPage
protected java.lang.String styleFile
protected java.lang.String modelFile
protected java.lang.String frameFile
protected java.lang.String lafName
protected java.lang.String iconFileName
protected int width
protected int height
protected boolean swingClient
protected java.lang.String widgetSet
protected java.lang.String appStyle
protected boolean useWindow
protected boolean centerWindow
protected boolean useFrames
protected boolean useToolbar
protected boolean openInFrames
protected boolean fixProject
protected int logLevel
protected java.lang.String[] frameFiles
protected int[] frameSizes
protected java.lang.String toolbarFile
public static final int NOVICE_MODE
public static final int EXPERT_MODE
public static final int DEVELOPER_MODE
| Method Detail |
|---|
public static void setEditorUtility(IEditorUtility eu,
boolean isEclipse)
public static IEditorUtility getEditorUtility()
public ProjectClassLoader getProjectClassLoader()
ProjectProjectClassLoader object. If any instance of
ProjectClassLoader class was created, it is registered in
this Project object.
getProjectClassLoader in class ProjectProjectClassLoader object.public void setProjectClassLoader(ProjectClassLoader cl)
protected void setupProjectClassLoader()
public java.lang.String getProjectName()
public void initialise(java.lang.String projectPath,
java.lang.String startupFile)
path - the path to the new project's root directorystartupFile - the name of the startup filepublic void reloadStartupFile(java.io.InputStream is)
fo - public static java.lang.String getStrippedPath(java.lang.String projectPath)
projectPath - the path where the project file is saved
public static java.lang.String getStrippedFileName(java.lang.String projectPath)
projectPath - the path where the project file is saved
public static java.lang.String getSubPath(java.lang.String path)
projectPath - the path where the project file is saved
public java.lang.String getStartupFilePath()
public java.lang.Object readResolve()
throws java.io.ObjectStreamException
java.io.ObjectStreamException
public void componentSelected(PagePanel ownerPage,
java.util.Vector selectedComponents,
boolean contentsChanged)
public void modelChanged()
public void addComponentSelectionListener(ComponentSelectListener listener)
public void removeComponentSelectionListener(ComponentSelectListener listener)
public void addModelListener(ModelListener listener)
public void removeModelListener(ModelListener listener)
public EditorProject parse(java.lang.String filePath,
java.lang.String startupFile,
java.io.Reader r)
throws java.io.IOException
startupFile - the name of the startup file
java.io.IOException
public void generate(java.io.Writer w)
throws java.io.IOException
java.io.IOExceptionprotected void generateFrameFile()
public void reloadFramesFile(java.io.InputStream is)
fo - the frames fileprotected void saveStartupFile()
protected void checkExtraProperties()
protected void checkProject()
public void addCustomManagerObject(java.lang.Object key,
java.lang.Object value)
public java.util.Hashtable getCustomManagerObjects()
protected void readOtherProperties(XmlElement otherProperties)
protected void saveOtherProperties(XmlElement otherProperties)
public int getSize()
public PageResource getPage(int pos)
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public PageResource getPageResource(java.lang.String name,
java.lang.String ext)
name - the name of the screen we're looking upext - the file extension
public boolean hasFrames()
public void setFrameset(java.lang.String framesSet)
framesSet -
public void addPage(java.lang.String name,
java.lang.String ext)
name - ext - the file extensionpublic java.util.HashMap getPageResources()
public java.util.HashMap getAllPageResources()
public void removePage(java.lang.String pageName,
java.lang.String ext)
pageName - ext - the file extension
public void replacePage(java.lang.String pageName,
java.lang.String ext,
Page updatedPage)
pageName - the page nameext - the file extensionupdatedPage - the updated version of this pagepublic void removeAllPages()
public void setPath(java.lang.String p)
p - the path of the Projectpublic void createProjectFile()
public boolean hasProject()
public PageResource addPage(java.lang.String newPageName,
java.lang.String ext,
java.lang.String className)
newPageName - the new page nameext - the file extensionclassName - the base class name or null if the default is to be used
public EditorValidationFactory getDefaultValidationFactory()
public java.lang.String[] getValidations()
public boolean getValidationExists(java.lang.String validationName)
public XmlElement getValidation(java.lang.String validationName)
protected void changePropertiesFile()
path - The path to the properties file.
public boolean setStartupProperty(java.lang.String fieldName,
java.lang.String fieldValue)
fieldName - the name or key of the property to change.fieldValue - the value to place in the file.public java.lang.String getPath()
public java.lang.String getClassPath()
public void save()
public void setJavaSource(java.lang.String screenName,
java.lang.String src)
public StyleFactory getStyleFactory()
public int getMode()
public void setMode(int newMode)
newMode - this can be one of the following values protected void registerHelpers()
public boolean setStartupParam(java.lang.String key,
java.lang.String value)
setStartupParam in class Projectkey - the object keyvalue - the object value
public java.lang.String getPackageName()
getPackageName in class Projectpublic void setPackageName(java.lang.String newPackage)
Project
setPackageName in class ProjectnewPackage - The name of the package to be usedpublic java.lang.String getAppTitle()
public void setAppTitle(java.lang.String newTitle)
public java.lang.String getProjectTitle()
public void setProjectTitle(java.lang.String newTitle)
public java.lang.String getFirstPage()
public void setFirstPage(java.lang.String first)
public boolean isSwingClient()
public java.lang.String getWidgetSet()
public void setWidgetSet(java.lang.String set)
public java.lang.String getAppStyle()
public void setAppStyle(java.lang.String style)
public void setSwingClient(boolean state)
public boolean getUseWindow()
public void setUseWindow(boolean state)
public boolean getCenterWindow()
public void setCenterWindow(boolean state)
public boolean getUseFrames()
public boolean getUseToolbar()
public boolean getOpenInFrames()
public void setOpenInFrames()
public void setUseFrames(boolean state)
public void setUseToolbar(boolean state)
state - true to use a toolbarpublic void setToolbarFile(java.lang.String fn)
public java.lang.String getToolbarFile()
public boolean isModified()
public void setModified(boolean newState)
public void setDataObject(Modifiable pdo)
public void setWidth(int w)
public void setHeight(int h)
public int getHeight()
public int getWidth()
public int getLogLevel()
public void setLogLevel(int level)
public java.lang.String getStyleFile()
public void setStyleFile(java.lang.String newFile)
public java.lang.String getFrameFile()
public void setFrameFile(java.lang.String newFile)
public java.lang.String getModelFile()
public void setModelFile(java.lang.String newFile)
public void setFrameFiles(java.lang.String[] files)
public java.lang.String[] getFrameFiles()
public void setFrameSizes(int[] sizes)
public int[] getFrameSizes()
public java.lang.String getLafName()
public void setLafName(java.lang.String laf)
public java.lang.Object[] getComponentFactories()
public java.lang.Object[] getBindingFactories()
public void setComponentFactories(java.lang.Object[] factories)
factories - the class names as an array of String objectspublic void setBindingFactories(java.lang.Object[] factories)
factories - the class names as an array of String objectspublic void setValidationFactory(java.lang.String factoryName)
factoryName - the class namepublic java.lang.String getValidationFactory()
the - class namepublic void setValidationsFile(java.lang.String rulesFile)
rulesFile - the class namepublic java.lang.String getValidationsFile()
public java.util.Hashtable getManagerObjects()
return - the hashtablepublic java.io.InputStream getInputStream(java.lang.String fileName)
getInputStream in class ProjectfileName - the resource file name
public java.awt.Image getImage(java.lang.String name)
getImage in class Projectname - the image resource name
public java.awt.Image getImage(java.net.URL url)
url - the image resource url
public java.awt.Image getImage(java.lang.Class clazz,
java.lang.String name)
clazz - the class whos classloader will be used while attempting to load the imagename - the image resource name
public Translator getTranslator(java.lang.String name)
getTranslator in class Projectname - the name of the resource used for translation
public boolean addComponentEntry(XmlElement xml)
xml - the new element to add if it is not already present
public boolean canAccessDefaultPackage(java.lang.ClassLoader cl,
java.lang.String path)
canAccessDefaultPackage in class Projectpublic void setFixProject(boolean fixProject)
fixProject - the fixProject to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||