Class com.symantec.itools.vcafe.openapi.VisualProject
All Packages Class Hierarchy This Package Previous Next Index
Class com.symantec.itools.vcafe.openapi.VisualProject
Object
|
+----com.symantec.itools.vcafe.openapi.VisualProject
- public abstract class VisualProject
- extends Object
The API used to represent and access a Visual Cafe project.
To get a VisualProject
to work with, use one of the following VisualCafe
methods:
getProjects()
to get all open projects,
getTargetProject()
to get the currently active project,
getProject()
to get an open project with a given name,
openProject()
to open a project,
createProject()
to create a new project,
createEmptyProject()
to create a new empty project, or
createDefaultProject()
to create a new project from the default project template.
The implementation of all of VisualProject
's abstract methods first calls
checkValidity(). Any method could therefore throw an InvalidVisualProjectException
.
This exception extends RuntimeException
, so doesn't have to be explicity declared or
caught. A VisualProject
can become invalid if it is closed, and the corresponding
ProjectListener
message is ignored, for example.
- Version:
- 1.0
- Author:
- Symantec Internet Tools Division
- Since:
- VCafe 3.0
- See Also:
- VisualCafe, getProjects, getTargetProject, getProject, openProject, createProject, createEmptyProject, createDefaultProject
-
com.symantec.itools.vcafe.openapi.VisualProject. ProjectInputStream
- ObjectInputStream with getProject() method for streaming
in objects that require a project to instantiate themselves.
-
ENABLE_RAD_DEFAULT
- An
addFile
"enableRAD" value indicating the file should added with RAD set to the default
value for the project.
-
ENABLE_RAD_OFF
- An
addFile
"enableRAD" value indicating the file should added with RAD disabled.
-
ENABLE_RAD_ON
- An
addFile
"enableRAD" value indicating the file should added with RAD enabled.
-
FILES_TAB
- Indicates the "Files" tab is selected in the project window.
-
OBJECTS_TAB
- Indicates the "Objects" tab is selected in the project window.
-
PACKAGES_TAB
- Indicates the "Packages" tab is selected in the project window.
-
UPDATE_PROJECT_BEANS_ASK
- An
addFile
"updateProjectBeans" value indicating that after the file is added, the user should be prompted
about updating project beans.
-
UPDATE_PROJECT_BEANS_NO
- An
addFile
"updateProjectBeans" value indicating that after the file is added, project beans should be
NOT be updated.
-
UPDATE_PROJECT_BEANS_YES
- An
addFile
"updateProjectBeans" value indicating that after the file is added, project beans should be
updated.
-
com.symantec.itools.vcafe.openapi.VisualProject()
-
-
aboutToChangeProjectEntries()
- This method triggers the
aboutToChangeProjectEntries()
message to be
sent to all ProjectListeners
registered to this project.
-
addDTListener(DTListener)
- Add a
DTListener
to this project.
-
addFile(File)
- Adds a [relative, ProjectFile.USER_ADDED, ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this
VisualProject
.
-
addFile(String, boolean, int, int)
- Adds a [ProjectFile.USER_ADDED] file to this
VisualProject
.
-
addFile(String, int, boolean)
- Adds a [ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this
VisualProject
.
-
addProjectListener(ProjectListener)
- Add a listener to this project.
-
checkValidity()
- Checks that this
VisualProject
corresponds to a valid project in Visual Cafe.
-
close()
- Closes this
VisualProject
.
-
createFile(String, String, int)
- Creates a file in this
VisualProject
.
-
createFile(String, byte[], int)
- Creates a file in this
VisualProject
.
-
createNewInteraction(VisualObject, VisualObject)
- Creates a new interaction and opens an editor to edit it.
-
createNewInteraction(VisualObject, VisualObject, boolean)
- Create a new interaction and open an editor to edit it.
-
doneChangingProjectEntries()
- This method triggers the
doneChangingProjectEntries()
message to be
sent to all ProjectListeners
registered to this project.
-
execute()
- Builds the project and runs the resulting program.
-
getAttributes()
- Get the
Attributes
object that allows project-related named value storage.
-
getBuildManager()
- Gets the class that allows access to this project's build commands.
-
getClassLoader()
- Gets the
ClassLoader
for objects/classes in this project.
-
getDTClassObject(String)
- Gets the Design-Time Reflection
DTClass
object associated with the class
with the given string name.
-
getDocumentBase()
- Gets the built project's document base.
-
getFile()
- Gets the
File
associated with this VisualProject
file.
-
getObjectLibrary()
- Gets the class that allows access to this project's
VisualObjects
.
-
getOptionSet()
- Gets this project's options.
-
getProjectFile(String)
- Gets a
ProjectFile
that corresponds to the file with the given name.
-
getProjectFile(int)
- Gets a
ProjectFile
that corresponds to the file id.
-
getProjectFiles()
- Gets all of the files in this project.
-
getProjectFiles(int)
- Gets all of the files in this project added by the specified source.
-
getProjectName()
- Gets the name of the project.
-
getProjectType()
- Gets this project's 'type'.
-
getSelectedFiles()
- Get a list of the selected files in this project window.
-
getSelectedObjects()
- Gets a list of the selected objects in this project window.
-
getSelectedTab()
- Determines which tab is selected in the project window.
-
isValid()
- Determines if this
VisualProject
corresponds to a valid project in Visual Cafe.
-
parseOutstandingFiles()
- Parses the files in the project.
-
removeDTListener(DTListener)
- Remove a
DTListener
from this project.
-
removeFile(ProjectFile)
- Removes a
ProjectFile
from this project.
-
removeFile(File)
- Removes a
ProjectFile
from this project.
-
removeProjectListener(ProjectListener)
- Remove a listener from this project.
-
renameFile(ProjectFile, String, boolean)
- Renames a file in this project.
-
resumeBackgroundParser(boolean)
- Tells the project that it can resume the background parsing of
DTClass
information.
-
runInDebugger()
- Builds the project and runs the resulting program under the debugger.
-
save()
- Saves this
VisualProject
.
-
saveAs(File)
- Saves this
VisualProject
to a new name.
-
setModified()
- Mark this
VisualProject
's contents modified.
-
setProjectType(int)
- Sets this project's 'type'.
-
setSelectedTab(int)
- Selects the tab in the project window.
-
suspendBackgroundParser(boolean)
- Tells this project to suspend the background parsing of
DTClass
information.
-
toString()
- Gets a
String
that represents this object.
-
updateProjectBeans()
- Forces all of the project's local beans to be updated.
ENABLE_RAD_DEFAULT
public static final int ENABLE_RAD_DEFAULT
- An
addFile
"enableRAD" value indicating the file should added with RAD set to the default
value for the project.
- See Also:
- addFile(String, boolean, int, int)
ENABLE_RAD_OFF
public static final int ENABLE_RAD_OFF
- An
addFile
"enableRAD" value indicating the file should added with RAD disabled.
- See Also:
- addFile(String, boolean, int, int)
ENABLE_RAD_ON
public static final int ENABLE_RAD_ON
- An
addFile
"enableRAD" value indicating the file should added with RAD enabled.
- See Also:
- addFile(String, boolean, int, int)
FILES_TAB
public static final int FILES_TAB
- Indicates the "Files" tab is selected in the project window.
- See Also:
- getSelectedTab
OBJECTS_TAB
public static final int OBJECTS_TAB
- Indicates the "Objects" tab is selected in the project window.
- See Also:
- getSelectedTab
PACKAGES_TAB
public static final int PACKAGES_TAB
- Indicates the "Packages" tab is selected in the project window.
- See Also:
- getSelectedTab
UPDATE_PROJECT_BEANS_ASK
public static final int UPDATE_PROJECT_BEANS_ASK
- An
addFile
"updateProjectBeans" value indicating that after the file is added, the user should be prompted
about updating project beans.
- See Also:
- addFile(String, boolean, int, int)
UPDATE_PROJECT_BEANS_NO
public static final int UPDATE_PROJECT_BEANS_NO
- An
addFile
"updateProjectBeans" value indicating that after the file is added, project beans should be
NOT be updated.
- See Also:
- addFile(String, boolean, int, int)
UPDATE_PROJECT_BEANS_YES
public static final int UPDATE_PROJECT_BEANS_YES
- An
addFile
"updateProjectBeans" value indicating that after the file is added, project beans should be
updated.
- See Also:
- addFile(String, boolean, int, int)
VisualProject
public VisualProject()
aboutToChangeProjectEntries
public abstract void aboutToChangeProjectEntries()
- This method triggers the
aboutToChangeProjectEntries()
message to be
sent to all ProjectListeners
registered to this project.
- See Also:
- aboutToChangeProjectEntries, doneChangingProjectEntries
addDTListener
public abstract void addDTListener(DTListener listener)
- Add a
DTListener
to this project.
Changes to this project's Design-Time Reflection classes are broadcast to the listeners registered with it.
To be notified of changes, a plug-in implements the com.symantec.itools.vcafe.openapi.dtreflect.DTListener
interface, then calls this method to place itself on the notification list. When this VisualProject
's
Design-Time Reflection information changes, the listener is called.
- Parameters:
- listener - the object that receives notifications
- See Also:
- removeDTListener, addDTListener, DTListener
addFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile addFile(File file)
- Adds a [relative, ProjectFile.USER_ADDED, ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this
VisualProject
.
- Parameters:
- file - file to be added.
- Returns:
- the resultant
ProjectFile
object.
- Throws: IllegalArgumentException
- if the file doesn't exist or is a diretory.
- See Also:
- ProjectFile
addFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile addFile(String fileName,
boolean makeRelative,
int enableRAD,
int updateProjectBeans)
- Adds a [ProjectFile.USER_ADDED] file to this
VisualProject
.
- Parameters:
- fileName - the name of the file to be added.
- makeRelative - option to make the file relative to the project or not.
- enableRAD - should RAD be turned on for this file. Can be one of ENABLE_RAD_ON, ENABLE_RAD_OFF
or ENABLE_RAD_DEFAULT.
- updateProjectBeans - should local beans be updated after this file is added. Can be one of UPDATE_PROJECT_BEANS_YES,
UPDATE_PROJECT_BEANS_NO, or UPDATE_PROJECT_BEANS_ASK.
- Returns:
- the resultant
ProjectFile
object.
- Throws: IllegalArgumentException
- if the file doesn't exist or is a diretory.
- See Also:
- ProjectFile
addFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile addFile(String fileName,
int addedBy,
boolean makeRelative)
- Adds a [ENABLE_RAD_DEFAULT, UPDATE_PROJECT_BEANS_NO] file to this
VisualProject
.
- Parameters:
- fileName - name of the file to be added.
- addedBy - who is adding this file.
- makeRelative - option to make the file relative to the project or not.
- Returns:
- the resultant
ProjectFile
object.
- Throws: IllegalArgumentException
- if the file doesn't exist or is a diretory.
- See Also:
- ProjectFile
addProjectListener
public abstract void addProjectListener(ProjectListener projectListener)
- Add a listener to this project.
Changes to this project are broadcast to the listeners registered with it.
To be notified of changes, a plug-in implements the
ProjectListener
interface, then calls
this method to place itself on the notification list. When this VisualProject
changes, the
appropriate listener method is called.
- Parameters:
- listener - the object that receives notifications of changes to this project.
- See Also:
- ProjectListener, removeProjectListener
checkValidity
public void checkValidity() throws InvalidVisualProjectException
- Checks that this
VisualProject
corresponds to a valid project in Visual Cafe.
Note that the implementation of all of VisualProject
's abstract methods first call
checkValidity(). Any method could therefore throw an InvalidVisualProjectException
.
- Throws: InvalidVisualProjectException
- when the VisualProject has been closed, for example.
close
public abstract void close()
- Closes this
VisualProject
.
createFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile createFile(String fileName,
String contents,
int enableRAD)
- Creates a file in this
VisualProject
. The file will be created relative to the project's
location.
- Parameters:
- fileName - the name of the new
ProjectFile
.
- contents - the text contents to put in this file.
- enableRAD - should RAD be turned on for this file.
- Returns:
- the resultant
ProjectFile
object.
- See Also:
- ProjectFile
createFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile createFile(String fileName,
byte contents,
int enableRAD)
- Creates a file in this
VisualProject
. The file will be created relative to the project's
location.
- Parameters:
- fileName - the name of the new
ProjectFile
.
- contents - the binary contents to put in this file.
- enableRAD - should RAD be turned on for this file.
- Returns:
- the resultant
ProjectFile
object.
- See Also:
- ProjectFile
createNewInteraction
public abstract void createNewInteraction(VisualObject from,
VisualObject to)
- Creates a new interaction and opens an editor to edit it.
The method returns before editing begins. There is no guarantee that
an interaction involving the objects specified will result, e.g., the
user may cancel the interaction or specify other from and to objects.
If called while the wizard is running (not likely because the wizard
is modal, but possible) the wizard will queue the request to be performed
after the current session is completed.
- Parameters:
- from - the
VisualObject
that fires the event; must not be null
.
- to - the
VisualObject
that is affected by the interaction;
may be null
.
createNewInteraction
public abstract void createNewInteraction(VisualObject from,
VisualObject to,
boolean useEditor)
- Create a new interaction and open an editor to edit it.
Same as above except sets the interaction editor preference based on
the preferEditor argument. The editor preference applies to all subsequent
createNewInteraction calls without the third argument, in any project.
- Parameters:
- from - the
VisualObject
that fires the event; must not be null
.
- to - the
VisualObject
that is affected by the interaction;
may be null
.
- useEditor -
true
if the interaction editor is to be used,
false
if the interaction wizard is to be used.
doneChangingProjectEntries
public abstract void doneChangingProjectEntries()
- This method triggers the
doneChangingProjectEntries()
message to be
sent to all ProjectListeners
registered to this project.
- See Also:
- doneChangingProjectEntries, aboutToChangeProjectEntries
execute
public abstract void execute()
- Builds the project and runs the resulting program.
The debugger is not used to run the program.
- See Also:
- build
getAttributes
public abstract com.symantec.itools.vcafe.openapi.Attributes getAttributes()
- Get the
Attributes
object that allows project-related named value storage.
The values stored in the returned Attributes
object are assoicated with this
specific VisualProject
, not with the Visual Cafe program in general. To create
global name values (not specific to any one project), use VisualCafe
's
getAttributes
method.
- Returns:
- this project's
Attributes
storage object.
- See Also:
- VisualProject.ProjectInputStream, Attributes
getBuildManager
public abstract com.symantec.itools.vcafe.openapi.BuildManager getBuildManager()
- Gets the class that allows access to this project's build commands.
- Returns:
- this project's
BuildManager
- See Also:
- BuildManager
getClassLoader
public abstract java.lang.ClassLoader getClassLoader()
- Gets the
ClassLoader
for objects/classes in this project.
- Returns:
- this project's
ClassLoader
.
getDTClassObject
public abstract com.symantec.itools.vcafe.openapi.dtreflect.DTClass getDTClassObject(String className)
- Gets the Design-Time Reflection
DTClass
object associated with the class
with the given string name.
- Parameters:
- className - the name of a class in the project to find a design-time reflection class for.
- Returns:
- a
DTClass
object for the class.
getDocumentBase
public abstract java.net.URL getDocumentBase() throws MalformedURLException
- Gets the built project's document base.
- Returns:
- the document base for this project's executable.
getFile
public abstract java.io.File getFile()
- Gets the
File
associated with this VisualProject
file.
- Returns:
- this
VisualProject
's File
.
getObjectLibrary
public abstract com.symantec.itools.vcafe.openapi.VisualRepository getObjectLibrary()
- Gets the class that allows access to this project's
VisualObjects
.
- Returns:
- this project's object library
- See Also:
- VisualRepository
getOptionSet
public abstract com.symantec.itools.vcafe.openapi.options.ProjectOptionSet getOptionSet()
- Gets this project's options.
The returned
ProjectOptionSet
allows access to the options for this project.
- Returns:
- the project's options.
- See Also:
- ProjectOptionSet
getProjectFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile(String fileName)
- Gets a
ProjectFile
that corresponds to the file with the given name.
If the file isn't in this project, null
is returned.
- Parameters:
- fileName - the name of the desired file.
- Returns:
- a
ProjectFile
object, or null
if not found.
- See Also:
- getProjectFiles(), getProjectFile(int), ProjectFile
getProjectFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile(int projectFileID)
- Gets a
ProjectFile
that corresponds to the file id.
If the file isn't in this project, null
is returned.
- Parameters:
- projectFileId - the id of the desired file.
- Returns:
- a
ProjectFile
object, or null
if not found.
- See Also:
- getProjectFiles(), getProjectFile(String), ProjectFile
getProjectFiles
public abstract com.symantec.itools.vcafe.openapi.ProjectFile[] getProjectFiles()
- Gets all of the files in this project.
An array is returned containing all of the files. If there are no files in the project, a
zero-length array is returned.
- Returns:
- array of
ProjectFile
objects
- See Also:
- getProjectFiles(int), getProjectFile(String), getProjectFile(int), ProjectFile
getProjectFiles
public abstract com.symantec.itools.vcafe.openapi.ProjectFile[] getProjectFiles(int addedBy)
- Gets all of the files in this project added by the specified source.
An array is returned containing all of the added files. If there are no files, a
zero-length array is returned.
- Parameters:
- addedBy - the source that added the file to the project, is a mask containing any of:
- USER_ADDED - files added by the user.
- COMPILER_ADDED - files added by the compiler.
- PARSER_ADDED - files added by the parser.
- UNKNOWN_ADDED - files added by an unknown source.
- SHARED_DATABASE_ADDED - files added by the database.
- ERAD_WIZARD_ADDED - the file was added by one of the ERAD wizards.
- ALL_FILE_ADDED - files added by any source.
- Returns:
- array of
ProjectFile
objects
- See Also:
- getProjectFiles(), getProjectFile(String), getProjectFile(int), ProjectFile, getFileAddedBy
getProjectName
public abstract java.lang.String getProjectName()
- Gets the name of the project.
- Returns:
- name of the project.
getProjectType
public abstract int getProjectType()
- Gets this project's 'type'. More specific than the project's target type.
- Returns:
- the project's type.
- See Also:
- ProjectTemplateInterface;, getTargetType
getSelectedFiles
public abstract com.symantec.itools.vcafe.openapi.ProjectFile[] getSelectedFiles()
- Get a list of the selected files in this project window.
If no files are selected a zero-length array is returned.
- Returns:
- an array of selected
ProjectFile
objects.
getSelectedObjects
public abstract com.symantec.itools.vcafe.openapi.VisualObject[] getSelectedObjects()
- Gets a list of the selected objects in this project window.
If no objects are selected a zero-length array is returned.
- Returns:
- an array of selected
VisualObject
objects.
getSelectedTab
public abstract int getSelectedTab()
- Determines which tab is selected in the project window.
- Returns:
- an integer that identifies the selected tab, one of:
- OBJECTS_TAB - the "Objects" tab is selected,
- PACKAGES_TAB - the "Packages" tab is selected, or
- FILES_TAB - the "Files" tab is selected
- See Also:
- setSelectedTab
isValid
public abstract boolean isValid()
- Determines if this
VisualProject
corresponds to a valid project in Visual Cafe.
- Returns:
-
true
if so, false
otherwise.
- See Also:
- checkValidity
parseOutstandingFiles
public abstract void parseOutstandingFiles()
- Parses the files in the project. Only outdated files are parsed. This causes
the project's Design-Time Reflection classes to be updated.
removeDTListener
public abstract void removeDTListener(DTListener listener)
- Remove a
DTListener
from this project. Stops the listener from receiving notifications of
changes to this project's Design-Time Reflection classes.
- Parameters:
- listener - the object that was receiving notifications
- See Also:
- addDTListener, removeDTListener, DTListener
removeFile
public abstract void removeFile(ProjectFile file)
- Removes a
ProjectFile
from this project.
- Parameters:
- file - the
ProjectFile
to remove.
- See Also:
- ProjectFile
removeFile
public abstract void removeFile(File file)
- Removes a
ProjectFile
from this project.
- Parameters:
- file - the File to remove.
- Throws: IllegalArgumentException
- if the file doesn't exist, is a directory, or isn't
part of this project.
removeProjectListener
public abstract void removeProjectListener(ProjectListener projectListener)
- Remove a listener from this project. Stops the listener from receiving notifications of
changes to this project.
- Parameters:
- listener - the object that was receiving notifications.
- See Also:
- ProjectListener, addProjectListener
renameFile
public abstract void renameFile(ProjectFile file,
String newName,
boolean replace)
- Renames a file in this project. The new file name must be fully qualified.
This method optionally overwrites any existing file with the same new name.
The old file with the original name is deleted.
- Parameters:
- file - the
ProjectFile
that will be renamed.
- newName - the new fully qualified name for this file.
- replace -
true
to overwrite any file that might already have the new name.
resumeBackgroundParser
public abstract void resumeBackgroundParser(boolean bringUpToDate)
- Tells the project that it can resume the background parsing of
DTClass
information.
- Parameters:
- bringUpToDate - if true, update the
DTClass
information.
runInDebugger
public abstract void runInDebugger()
- Builds the project and runs the resulting program under the debugger.
- See Also:
- build
save
public abstract void save()
- Saves this
VisualProject
.
saveAs
public abstract void saveAs(File newFile)
- Saves this
VisualProject
to a new name.
- Parameters:
- newFile - where to save this
VisualProject
.
setModified
public abstract void setModified()
- Mark this
VisualProject
's contents modified.
This can be useful if you save persistent attributes in response to
ProjectListener.aboutToSaveProject()
.
- See Also:
- aboutToSaveProject
setProjectType
public abstract void setProjectType(int projectType)
- Sets this project's 'type'. More specific than the project's target type. The Target Type
is updated in all of the project's option sets (Debug and Final).
- Parameters:
- projectType - the project's new type.
- See Also:
- ProjectTemplateInterface;, getTargetType
setSelectedTab
public abstract void setSelectedTab(int selectedTab)
- Selects the tab in the project window.
- Parameters:
- selectedTab - an integer that identifies the selected tab, one of:
- OBJECTS_TAB - the "Objects" tab is selected,
- PACKAGES_TAB - the "Packages" tab is selected, or
- FILES_TAB - the "Files" tab is selected
- See Also:
- getSelectedTab
suspendBackgroundParser
public abstract void suspendBackgroundParser(boolean bringUpToDate)
- Tells this project to suspend the background parsing of
DTClass
information.
- Parameters:
- bringUpToDate - if
true
, make sure the state of the DTClass
information is
brought up to date before suspending the parser.
This method must be matched by a call to resumeBackgroundParser()
.
example usage:
visualProject.suspendBackgroundParser(false);
try {
...
... lots of processing here that causes parsing ...
...
} finally {
visualProject.resumeBackgroundParser(true);
}
toString
public java.lang.String toString()
- Gets a
String
that represents this object.
- Returns:
- the
String
,
- Overrides:
- toString in class Object
updateProjectBeans
public abstract void updateProjectBeans()
- Forces all of the project's local beans to be updated.
All Packages Class Hierarchy This Package Previous Next Index