Interface com.ibm.ivj.util.base.Workspace
- public interface Workspace
This interface defines the behavior of a VisualAge for Java workspace.
Typically, a workspace reference is obtained by
calling ToolEnv.connectToWorkspace()
Method Index
- clearToolOptions(String)
- Resets the tools options with the specified key
- createBuilderFactory()
- Creates a factory object used to construct
code builders for this workspace.
- createProject(String, boolean)
- Creates a new project with the specified name if it does not
already exist in the workspace.
- exportData(ExportCodeSpec)
- Export specified selection as code (.java, .class, resources)
- exportData(ExportInterchangeSpec)
- Export specified selection from the repository in interchange
file format.
- getClassPathEntries()
- Returns an array containing entries which represent the
classpath (for the current execution) in the order that
lookup procedes.
- getCurrentOwnerName()
- Return the name of the person currently designated as the owner
of the workspace
- getDefaultClassPathEntries()
- Returns an array containing the classpath
entries that the VisualAge for Java VM would by default add
at the end of your classpath environment
variable.
- getPackages()
- Returns all packages in the workspace
- getProjects()
- Returns all projects in the workspace
- getRepository()
- Returns a reference to the current workspace repository.
- getRepository(String)
- Returns a reference to a local repository (.dat repository
file accessible via the local file system).
- getRepository(String, String)
- Returns a reference to a team repository (.dat repository
managed by a team server).
- getTempDirectory()
- This is a convenience method that creates a temporary
directory for use by the caller.
- getToolOptions(String)
- Retrieves the tools options with the specified key
- getTypes()
- Returns all types in the workspace
- importData(ImportCodeSpec)
- Import specified selection as code (.java, .class, resources).
- importData(ImportInterchangeSpec)
- Import specified selection into the repository from interchange
file.
- isTeamMode()
- Indicates whether the workspace is running in team mode
- loadedDefaultPackageFor(String)
- Locate the default package for the named project in the workspace
- loadedDefaultPackagesFor(String[])
- Locate the default packages for the named projects in the workspace
- loadedPackageNamed(String)
- Locate the named package in the workspace
- loadedPackagesNamed(String[])
- Locate the named packages in the workspace
- loadedProjectNamed(String)
- Locate the named project in the workspace
- loadedProjectsNamed(String[])
- Locate the named projects in the workspace
- loadedTypeNamed(String)
- Locate the named type in the workspace
- loadedTypesNamed(String[])
- Locate the named types in the workspace
- logMessage(String, boolean)
- Logs a message to the VisualAge for Java error log
- promptForApplet(String, String, WorkspaceModel, String)
- This method encapsulates the function of the
VisualAge for Java applet selection dialog.
- promptForApplication(String, String, WorkspaceModel, String)
- This method encapsulates the function of the
VisualAge for Java application selection dialog.
- promptForClass(String, String, WorkspaceModel, String)
- This method encapsulates the function of the
VisualAge for Java type selection dialog (filtered for classes only).
- promptForDirectoryName(String, String)
- This method encapsulates the function of the
VisualAge for Java file directory selection dialog.
- promptForFileName(String, String, String)
- This method encapsulates the function of the
VisualAge for Java file selection dialog.
- promptForInterface(String, String, WorkspaceModel, String)
- This method encapsulates the function of the
VisualAge for Java type selection dialog (filtered for interfaces only).
- promptForModel(WorkspaceModel[], String, String, String)
- This method encapsulates the function of the
VisualAge for Java model selection dialog.It allows the caller to supply
a list containing WorkspaceModel instances (Project, Package
or Type).
- promptForPackage(Package[], String, String, String)
- This method encapsulates the function of the
VisualAge for Java package selection dialog.It allows the caller to supply
the package list
- promptForPackage(String, String, Project, String)
- This method encapsulates the function of the
VisualAge for Java package selection dialog.
- promptForProject(Project[], String, String, String)
- This method encapsulates the function of the
VisualAge for Java project selection dialog.
- promptForProject(String, String, String)
- This method encapsulates the function of the
VisualAge for Java project selection dialog.
- promptForType(String, String, WorkspaceModel, String)
- This method encapsulates the function of the
VisualAge for Java type selection dialog.
- promptForType(Type[], String, String, String)
- This method encapsulates the function of the
VisualAge for Java type selection dialog.It allows the caller to supply
the type list
- removeClassPathEntries(Object[])
- Removes the classpath entries from the classpath
for the current execution which match the items
specified by the argument.
- runMain(Class, String[])
- Run a main on the specified class passing the specified
arguments.
- setClassPath(Object[])
- Sets the classpath for the current execution to the
items specified.
- setToolOptions(ToolData)
- Sets the tools options.
- shutdown()
- Shutdown the workspace and exit VisualAge for Java.
- testToolOptions(String)
- Test for existence of tool options with the specified key
Methods
clearToolOptions
public abstract void clearToolOptions(String key) throws IvjException
- Resets the tools options with the specified key
- Parameters:
- key - String
createBuilderFactory
public abstract BuilderFactory createBuilderFactory()
- Creates a factory object used to construct
code builders for this workspace. Code builders can be
used to directly manipulate Java source code for types
loaded in the workspace
- Returns:
- com.ibm.ivj.util.builders.BuilderFactory
createProject
public abstract Project createProject(String name,
boolean ignoreRepository) throws IvjException
- Creates a new project with the specified name if it does not
already exist in the workspace.
- Parameters:
- name - String
- ignoreRepository - boolean If true, create new project even
if another project edition with the same name exists in the repository
- Returns:
- com.ibm.ivj.util.base.Project
exportData
public abstract void exportData(ExportCodeSpec spec) throws IvjException
- Export specified selection as code (.java, .class, resources)
- Parameters:
- spec - com.ibm.ivj.util.base.ExportCodeSpec
exportData
public abstract void exportData(ExportInterchangeSpec spec) throws IvjException
- Export specified selection from the repository in interchange
file format.
- Parameters:
- spec - com.ibm.ivj.tdk.ExportInterchangeSpec
getClassPathEntries
public abstract Object[] getClassPathEntries()
- Returns an array containing entries which represent the
classpath (for the current execution) in the order that
lookup procedes. For classpath entries which map to
a loaded project, the entry is the matching Project object.
For others, the entry is String describing the absolute
file path to the directory/zip file.
- Returns:
- java.lang.Object[]
getCurrentOwnerName
public abstract String getCurrentOwnerName()
- Return the name of the person currently designated as the owner
of the workspace
- Returns:
- java.lang.String
getDefaultClassPathEntries
public abstract Object[] getDefaultClassPathEntries()
- Returns an array containing the classpath
entries that the VisualAge for Java VM would by default add
at the end of your classpath environment
variable. Callers to Workspace.setClassPath(...)
need to ensure these entries are included as
appropriate
- Returns:
- java.lang.Object[]
getPackages
public abstract Package[] getPackages()
- Returns all packages in the workspace
- Returns:
- com.ibm.ivj.util.base.Package[]
getProjects
public abstract Project[] getProjects()
- Returns all projects in the workspace
- Returns:
- com.ibm.ivj.util.base.Project[]
getRepository
public abstract Repository getRepository()
- Returns a reference to the current workspace repository.
- Returns:
- com.ibm.ivj.util.base.Repository
getRepository
public abstract Repository getRepository(String repositoryFileName) throws IvjException
- Returns a reference to a local repository (.dat repository
file accessible via the local file system).
Note, that the call does not check to make sure
the referenced local file in fact exists and is a valid
repository. The check is performed at the time the
repository is actually used. When exporting to
a repository file that does not exist, the
file will be created, or the operation will fail,
depending on the settings in the ExportInterchangeSpec.
- Parameters:
- repositoryFileName - String repository local file name
- Returns:
- com.ibm.ivj.util.base.Repository
getRepository
public abstract Repository getRepository(String teamServer,
String repositoryFileName) throws IvjException
- Returns a reference to a team repository (.dat repository
managed by a team server).
Note, that the call does not check to make sure
the referenced server file in fact exists and is a valid
repository. The check is performed at the time the
repository is actually used. When exporting to
a repository file that does not exist, the
file will be created, or the operation will fail,
depending on the settings in the ExportInterchangeSpec.
- Parameters:
- teamServer - String network address of the team server
- repositoryFileName - String repository file name on server
- Returns:
- com.ibm.ivj.util.base.Repository
getTempDirectory
public abstract String getTempDirectory() throws IvjException
- This is a convenience method that creates a temporary
directory for use by the caller. The directory and all
its content is deleted after the caller application terminates
- Returns:
- java.lang.String
getToolOptions
public abstract ToolData getToolOptions(String key) throws IvjException, OptionalDataException, ClassNotFoundException, IOException, StreamCorruptedException
- Retrieves the tools options with the specified key
- Parameters:
- key - String
- Returns:
- com.ibm.ivj.util.base.ToolData
getTypes
public abstract Type[] getTypes()
- Returns all types in the workspace
- Returns:
- com.ibm.ivj.util.base.Type[]
importData
public abstract Type[] importData(ImportCodeSpec spec) throws IvjException, IllegalArgumentException
- Import specified selection as code (.java, .class, resources)
Note, that importData() implements the following behavior
in terms of container versioning:
- all types (classes and interfaces) are always imported as
a new edition of the type, regardless whether the type
already existed in the workspace, was a version or an edition.
- if types are imported into an existing package and the package
is an edition (including a scratch edition), the operation simply
imports the types. If the package is a version, a scratch
edition of the package is created and the types are imported
- if types are imported into a package that did not exist, then
import first attempts to create the package (named or default).
If the specified default project is a version, the operation
fails (ie. import will not create a new project edition).
Otherwise the package is created and types are imported.
- Parameters:
- spec - com.ibm.ivj.util.base.ImportCodeSpec
- Returns:
- com.ibm.ivj.util.base.Type[] or null (nothing imported)
importData
public abstract void importData(ImportInterchangeSpec spec) throws IvjException
- Import specified selection into the repository from interchange
file.
- Parameters:
- spec - com.ibm.ivj.util.base.ExportInterchangeSpec
isTeamMode
public abstract boolean isTeamMode()
- Indicates whether the workspace is running in team mode
- Returns:
- boolean
loadedDefaultPackageFor
public abstract Package loadedDefaultPackageFor(String name)
- Locate the default package for the named project in the workspace
- Parameters:
- name - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Package or null (not found)
loadedDefaultPackagesFor
public abstract Package[] loadedDefaultPackagesFor(String list[])
- Locate the default packages for the named projects in the workspace
- Parameters:
- list - java.lang.String[]
- Returns:
- com.ibm.ivj.util.base.Package[] or null (none found)
loadedPackageNamed
public abstract Package loadedPackageNamed(String name)
- Locate the named package in the workspace
- Parameters:
- name - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Package or null (not found)
loadedPackagesNamed
public abstract Package[] loadedPackagesNamed(String names[])
- Locate the named packages in the workspace
- Parameters:
- name - java.lang.String[]
- Returns:
- com.ibm.ivj.util.base.Package[] or null (none found)
loadedProjectNamed
public abstract Project loadedProjectNamed(String name)
- Locate the named project in the workspace
- Parameters:
- name - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Project or null (not found)
loadedProjectsNamed
public abstract Project[] loadedProjectsNamed(String names[])
- Locate the named projects in the workspace
- Parameters:
- name - java.lang.String[]
- Returns:
- com.ibm.ivj.util.base.Project[] or null (none found)
loadedTypeNamed
public abstract Type loadedTypeNamed(String name)
- Locate the named type in the workspace
- Parameters:
- name - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type or null (not found)
loadedTypesNamed
public abstract Type[] loadedTypesNamed(String names[])
- Locate the named types in the workspace
- Parameters:
- name - java.lang.String[]
- Returns:
- com.ibm.ivj.util.base.Type[] or null (none found)
logMessage
public abstract void logMessage(String message,
boolean bringToFront)
- Logs a message to the VisualAge for Java error log
- Parameters:
- message - java.lang.String
- bringToFront - boolean force the log window "to front"
promptForApplet
public abstract Type promptForApplet(String title,
String prompt,
WorkspaceModel scope,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java applet selection dialog.
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- scope - com.ibm.ivj.util.base.WorkspaceModel
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type
promptForApplication
public abstract Type promptForApplication(String title,
String prompt,
WorkspaceModel scope,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java application selection dialog.
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- scope - com.ibm.ivj.util.base.WorkspaceModel
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type
promptForClass
public abstract Type promptForClass(String title,
String prompt,
WorkspaceModel scope,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java type selection dialog (filtered for classes only).
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- scope - com.ibm.ivj.util.base.WorkspaceModel or null
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type
promptForDirectoryName
public abstract String promptForDirectoryName(String title,
String initialSelection)
- This method encapsulates the function of the
VisualAge for Java file directory selection dialog.
- Parameters:
- title - java.lang.String
- initialSelection - java.lang.String
- Returns:
- java.lang.String
promptForFileName
public abstract String promptForFileName(String title,
String initialSelection,
String extension)
- This method encapsulates the function of the
VisualAge for Java file selection dialog.
- Parameters:
- title - java.lang.String
- initialSelection - java.lang.String
- extension - java.lang.String preferred extension (eg. ".txt")
- Returns:
- java.lang.String
promptForInterface
public abstract Type promptForInterface(String title,
String prompt,
WorkspaceModel scope,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java type selection dialog (filtered for interfaces only).
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- scope - com.ibm.ivj.util.base.WorkspaceModel or null
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type
promptForModel
public abstract WorkspaceModel promptForModel(WorkspaceModel list[],
String title,
String prompt,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java model selection dialog.It allows the caller to supply
a list containing WorkspaceModel instances (Project, Package
or Type).
- Parameters:
- list - co.ibm.ivj.util.base.WorkspaceModel[]
- title - java.lang.String
- prompt - java.lang.String
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.WorkspaceModel
promptForPackage
public abstract Package promptForPackage(Package list[],
String title,
String prompt,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java package selection dialog.It allows the caller to supply
the package list
- Parameters:
- list - co.ibm.ivj.util.base.Package[]
- title - java.lang.String
- prompt - java.lang.String
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Package
promptForPackage
public abstract Package promptForPackage(String title,
String prompt,
Project scope,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java package selection dialog.
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- scope - com.ibm.ivj.util.Project or null
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Package
promptForProject
public abstract Project promptForProject(Project list[],
String title,
String prompt,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java project selection dialog. It allows the caller to supply
the project list
- Parameters:
- list - co.ibm.ivj.util.base.Project[]
- title - java.lang.String
- prompt - java.lang.String
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Project
promptForProject
public abstract Project promptForProject(String title,
String prompt,
String mask)
- This method encapsulates the function of the
VisualAge for Java project selection dialog.
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Project
promptForType
public abstract Type promptForType(Type list[],
String title,
String prompt,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java type selection dialog.It allows the caller to supply
the type list
- Parameters:
- list - co.ibm.ivj.util.base.Type[]
- title - java.lang.String
- prompt - java.lang.String
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type
promptForType
public abstract Type promptForType(String title,
String prompt,
WorkspaceModel scope,
String mask) throws IvjException
- This method encapsulates the function of the
VisualAge for Java type selection dialog.
- Parameters:
- title - java.lang.String
- prompt - java.lang.String
- scope - com.ibm.ivj.util.base.WorkspaceModel or null
- mask - java.lang.String
- Returns:
- com.ibm.ivj.util.base.Type
removeClassPathEntries
public abstract void removeClassPathEntries(Object entries[]) throws IvjException
- Removes the classpath entries from the classpath
for the current execution which match the items
specified by the argument. The elements of the
argument array should be either Projects or Strings.
- Parameters:
- entries - java.lang.Object[]
runMain
public abstract void runMain(Class application,
String args[]) throws IllegalAccessException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException, IvjException
- Run a main on the specified class passing the specified
arguments. The execution proceeds as a separate VisualAge for Java
process independent of the caller (equivalent to invoking the
specified class using the "Run>Run main ..." menu actions,
or pressing the "Run" toolbar button).
- Parameters:
- application - java.lang.Class
- args - java.lang.String[]
setClassPath
public abstract void setClassPath(Object entries[]) throws IvjException
- Sets the classpath for the current execution to the
items specified. The argument must be an array
containing either instances of Project, or Strings.
Project items are used to create a classpath entry which
matches the current project_resources directory for
the project (either shared or local). Note that, this
is done only once at the time of the call, so
subsequent changes to the project's "use shared resources"
flag will not be reflected unless this method is called
again. Strings are used to construct classpath entries
directly. Note also that, the items specified by
the argument become the complete classpath for the
execution, so it is the caller's responsibility to
ensure that the default items needed by the system
(like CLASSES.ZIP) are included. The default items can be
obtained by calling Workspace.getDefaultClassPathEntries()
- Parameters:
- entries - java.lang.Object[]
setToolOptions
public abstract void setToolOptions(ToolData data) throws IvjException, IOException
- Sets the tools options. Note, that the tool data key must
be a String suitable for use as a file name (without
extension) on the target execution platform.
The API code does not perform any checking or
transformation of the key to ensure it is a valid
- Parameters:
- data - com.ibm.ivj.util.base.ToolData
shutdown
public abstract void shutdown()
- Shutdown the workspace and exit VisualAge for Java.
All executing Java programs (including the caller of this method)
are terminated.
IMPORTANT: under normal use, this method shoul not need to be called.
It is intended for use by server programs executing within
VA/Java in "unattended" mode.
testToolOptions
public abstract boolean testToolOptions(String key) throws IvjException
- Test for existence of tool options with the specified key
- Parameters:
- key - String
- Returns:
- boolean
