home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
VisualCafe.java
< prev
next >
Wrap
Text File
|
1998-10-25
|
31KB
|
862 lines
/*
* Copyright 1998 Symantec Corporation, All Rights Reserved.
*/
package com.symantec.itools.vcafe.openapi;
import java.awt.Rectangle;
import java.awt.MenuBar;
import java.awt.Menu;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeListener;
import java.util.Vector;
import java.util.Enumeration;
import java.io.File;
import com.sun.java.swing.LookAndFeel;
import com.sun.java.swing.JComponent;
import com.symantec.itools.vcafe.openapi.datatransfer.VisualCafeClipboard;
import com.symantec.itools.vcafe.openapi.options.EnvironmentOptionSet;
import com.symantec.itools.vcafe.openapi.pluginapi.OptionsWindow;
import com.symantec.itools.vcafe.openapi.dtreflect.DTListener;
/**
* The <code>VisualCafe</code> class provides the initial and primary interface used by Visual Cafe
* plug-ins. Using this class a plug-in can obtain access to Visual Cafe projects,
* project files, source files, environment options, the clipboard, component library
* and more.
* Use the <code>getVisualCafe()</code> method to access the one-and-only instance of this class.
* @see VisualCafe#getVisualCafe
*
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public abstract class VisualCafe
{
/**
* Project options
* @see VisualCafe#getOptionsWindow
*/
public static final int PROJECT_OPTIONS = 4;
/**
* Environment options
* @see VisualCafe#getOptionsWindow
*/
public static final int ENVIRONMENT_OPTIONS = 5;
/**
* The popup menu that appears upon right-mouse click in objects tab of project window
* @see VisualCafe#getContextualMenu
*/
public static final int OBJECT_VIEW_TAB_POPUP = 6;
/**
* The popup menu that appears upon right-mouse click in packages tab of project window
* @see VisualCafe#getContextualMenu
*/
public static final int PACKAGE_VIEW_TAB_POPUP = 7;
/**
* The popup menu that appears upon right-mouse click in files tab of project window
* @see VisualCafe#getContextualMenu
*/
public static final int FILE_VIEW_TAB_POPUP = 8;
/**
* The popup menu that appears upon right-mouse click in source code editor window
* @see VisualCafe#getContextualMenu
*/
public static final int SOURCE_EDITOR_POPUP = 9;
/**
* The popup menu that appears upon right-mouse click in form editor window
* @see VisualCafe#getContextualMenu
*/
public static final int FORM_EDITOR_POPUP = 10;
/**
* The popup menu that appears upon right-mouse click in component library window
* @see VisualCafe#getContextualMenu
*/
public static final int COMP_LIBRARY_POPUP = 11;
/**
* The popup menu that appears upon right-mouse click in classes pane of class browser
* @see VisualCafe#getContextualMenu
*/
public static final int CLASS_BROWSER_CLASSES_PANE_POPUP = 12;
/**
* The popup menu that appears upon right-mouse click in members pane of class browser
* @see VisualCafe#getContextualMenu
*/
public static final int CLASS_BROWSER_MEMBERS_PANE_POPUP = 13;
/**
* The popup menu that appears upon right-mouse click in editor pane of class browser
* @see VisualCafe#getContextualMenu
*/
public static final int CLASS_BROWSER_EDITOR_PANE_POPUP = 14;
/**
* The menu text for undoing a cut operation.
* @see VisualCafe#beginUndo
* @see VisualCafe#setUndoCommandName
*/
public static String UNDOCUT;
/**
* The menu text for undoing a paste operation.
* @see VisualCafe#beginUndo
* @see VisualCafe#setUndoCommandName
*/
public static String UNDOPASTE;
/**
* The menu text for undoing a delete operation.
* @see VisualCafe#beginUndo
* @see VisualCafe#setUndoCommandName
*/
public static String UNDODELETE;
/**
* The menu text for undoing a drag-n-drop operation.
* @see VisualCafe#beginUndo
* @see VisualCafe#setUndoCommandName
*/
public static String UNDODRAGDROP;
/**
* The menu text for undoing a property edit operation.
* @see VisualCafe#beginUndo
* @see VisualCafe#setUndoCommandName
*/
public static String UNDOPROPERTYEDIT;
/**
* The menu text for undoing an insert operation.
* @see VisualCafe#beginUndo
* @see VisualCafe#setUndoCommandName
*/
public static String UNDOINSERT;
/**
* Gets the object that implements the <code>VisualCafe</code> API. There is only one instance of this
* class. This method <b>never</b> returns <code>null</code>.
* @return the <code>VisualCafe</code> object.
*/
public static VisualCafe getVisualCafe()
{
return visualCafe;
}
/**
* Gets the top level menubar in Visual Cafe.
* @return a <code>MenuBar</code> object that represents the menu bar in Visual Cafe.
*/
public abstract MenuBar getMenuBar();
/**
* Returns an array of all of the open projects in Visual Cafe.
* If no projects are open, a zero-length array is returned.
* @return an array of <code>VisualProjects</code>
* @see #getProject
* @see #getTargetProject
*/
public abstract VisualProject[] getProjects();
/**
* Gets the target or current project in Visual Cafe.
* @return the current <code>VisualProject</code>, or <code>null</code> if no projects are open.
* @see #getProject
* @see #getProjects
*/
public abstract VisualProject getTargetProject();
/**
* Gets the open project with the given name in Visual Cafe.
* @param projectName the name of the open project.
* @return the named project, or <code>null</code> if it cannot be found.
* @see #getTargetProject
* @see #getProjects
*/
public abstract VisualProject getProject(String projectName);
/**
* Opens the project with the given name in Visual Cafe.
* The project becomes the target project.
* @param projectName the name of the project to open.
* @return the newly opened project, or <code>null</code> if it cannot be found.
* @see #getTargetProject
*/
public abstract VisualProject openProject(String projectName);
/**
* Creates a new project in Visual Cafe, using the specified <code>projectTemplate</code>.
* The project becomes the target project.
* @param projectTemplate a Project Template describing the initial state of the project.
* @return the new project, or <code>null</code> if it cannot be created.
* @see #getProjectTemplates
* @see #createEmptyProject
* @see #createDefaultProject
* @see #getTargetProject
*/
public abstract VisualProject createProject(VisualObject projectTemplate);
/**
* Creates a new project in Visual Cafe, using the Empty Project Template.
* The project becomes the target project.
* @return the new project, or <code>null</code> if it cannot be created.
* @see #getProjectTemplates
* @see #createProject
* @see #createDefaultProject
* @see #getTargetProject
*/
public abstract VisualProject createEmptyProject();
/**
* Creates a new project in Visual Cafe, using the default Project Template.
* The project becomes the target project.
* @return the new project, or <code>null</code> if it cannot be created.
* @see #getProjectTemplates
* @see #createProject
* @see #createEmptyProject
* @see #getTargetProject
*/
public abstract VisualProject createDefaultProject();
/**
* Returns an array of all of the installed Project Templates (as appearing
* in the Project Templates group of the Component Library).
* @return array of <code>VisualObjects</code> representing the installed Project Templates.
* @see #createProject
* @see #createEmptyProject
* @see #createDefaultProject
*/
public abstract VisualObject[] getProjectTemplates();
/**
* Returns an array of all of the open source files in Visual Cafe.
* If no source files are open, a zero-length array is returned.
* @return an array of open source files.
* @see #getSourceFile(String)
* @see #getSourceFile(File)
*/
public abstract SourceFile[] getSourceFiles();
/**
* Gets the <code>SourceFile</code> with the specified name.
* Note: unlike <code>getSourceFiles()</code>, this method will return a <code>SourceFile</code>
* even if it isn't currently open in Visual Cafe.
* @param filename name of the file to get.
* @return the named <code>SourceFile</code>, or <code>null</code> if not found.
* @see #getSourceFiles
* @see #getSourceFile(File)
*/
public abstract SourceFile getSourceFile(String filename);
/**
* Returns a <code>SourceFile</code> for the given <code>File</code>.
* Note: unlike <code>getSourceFiles()</code>, this method will return a <code>SourceFile</code>
* even if it isn't currently open in Visual Cafe.
* @param file the file to get.
* @return the <code>SourceFile</code>, or <code>null</code> if not found.
* @see #getSourceFiles
* @see #getSourceFile(String)
*/
public abstract SourceFile getSourceFile(File file);
/**
* Gets the Visual Repository object that allows access to Visual Cafe's Component Library.
* @return the <code>ComponentLibrary</code>.
* @see VisualRepository
* @see ComponentLibrary
*/
public abstract ComponentLibrary getComponentLibrary();
/**
* Get the <code>Attributes</code> object that global (program-wide) named value storage.
*
* The values stored in the returned <code>Attributes</code> object are associated with the Visual Cafe
* program (are global), not with a specific project. To associate named values with a
* specific project, use that <code>VisualProject</code>'s <code>getAttributes()</code> method.
* @return the global <code>Attributes</code> storage object.
* @see VisualProject#getAttributes
*/
public abstract Attributes getAttributes();
/**
* Gets the <code>EnvironmentOptionSet</code> object which allows access to Visual Cafe's environment options.
*
* @return the environment's options access API object.
*/
public abstract EnvironmentOptionSet getEnvironmentOptionSet();
/**
* Creates a new <code>VisualObject</code> that represents an object of the given class. The <code>Class</code> must
* already have an entry in the <code>ComponentLibrary</code>.
* @param clazz the <code>Class</code> of the new <code>VisualObject</code>.
* @return a new <code>VisualObject</code>.
* @see #createVisualObjectByName
*/
public abstract VisualObject createVisualObject(Class clazz);
/**
* Create a new <code>VisualObject</code> that represents an object of the given class. The class must
* already have an entry in the <code>ComponentLibrary</code>.
* @param className the class name of the new <code>VisualObject</code>.
* @return a new <code>VisualObject</code>.
* @see #createVisualObject
*/
public abstract VisualObject createVisualObjectByName(String className);
/**
* Adds a jar file to the Component Library in Visual Cafe.
* This performs the same action as using the Visual Cafe menus to insert a Component into
* the library (Insert -> Component into Library).
* Errors are reported in Visual Cafe's message window.
*
* @param jarFile the full path of the jar file to be added.
*/
public abstract void addJarToLibrary(String jarFile);
//
// Object Editor Support
//
/**
* Register an editor to edit an object of type class. After this call, the listener will be
* notified when the user chooses to edit an object of the given class, from anywhere in the
* environment.
* @param targetClassNames array of strings denoting the type of objects for editing
* @param listener the object that receives notifications.
* example usage:<code>
* // Register an object editor for SoftBevelBorder
* String[] objectType = { "com.symantec.itools.swing.borders.SoftBevelBorder" };
* VisualCafe.getVisualCafe().registerEditor(objectType, new SymObjectEditorAction());
*</code>
*/
public abstract void registerEditor(String[] targetClassNames, ActionListener l);
//
// Environment/Project Options Window Extension Support
//
/**
* Adds an <code>ActionListener</code>. After this call, the listener will be notified
* when the user chooses to open Environment Options or Project Options window.
* @param optionType the type of options window. One of:<ul type=circle>
* <li>PROJECT_OPTIONS - the project options window
* <li>ENVIRONMENT_OPTIONS - the environment options window
* </ul>
* @param listener the object that receives notifications.
*/
public abstract void addOptionsMenuItemListener(int optionType, ActionListener l);
/**
* Removes a <code>ActionListener</code>. After this call, the listener will not
* be notified when the user chooses to open Environment Options or Project Options window.
* @param optionType the type of options window. One of:<ul type=circle>
* <li>PROJECT_OPTIONS - the project options window
* <li>ENVIRONMENT_OPTIONS - the environment options window
* </ul>
* @param listener the object that was receiving notifications.
*/
public abstract void removeOptionsMenuItemListener(int optionType, ActionListener l);
/**
* Returns the options window being opened in Visual Cafe.
* One of:<ul type=circle>
* <li>PROJECT_OPTIONS - the project options window
* <li>ENVIRONMENT_OPTIONS - the environment options window
* </ul>
* @return the environment/project Options window
* @see OptionsWindow
*/
public abstract OptionsWindow getOptionsWindow();
//
// Contextual Menu Support
//
/**
* Returns a popup menu in Visual Cafe
* @param popupType the type of popup menu, one of:<ul type=circle>
* <li>OBJECT_VIEW_TAB_POPUP - popup menu in objects tab of project window,
* <li>PACKAGE_VIEW_TAB_POPUP - popup menu in packages tab of project window,
* <li>FILE_VIEW_TAB_POPUP - popup menu in files tab of project window,
* <li>SOURCE_EDITOR_POPUP - popup menu in source code editor window,
* <li>FORM_EDITOR_POPUP - popup menu in form editor window,
* <li>COMP_LIBRARY_POPUP - popup menu in component library window
* <li>CLASS_BROWSER_CLASSES_PANE_POPUP - popup menu in classes pane of class browser
* <li>CLASS_BROWSER_MEMBERS_PANE_POPUP - popup menu in members pane of class browser
* <li>CLASS_BROWSER_EDITOR_PANE_POPUP - popup menu in editor pane of class browser
* </ul>
* @return the requested menu
* @see VisualMenu
*/
public abstract VisualMenu getContextualMenu(int popupType);
/**
* Sets an array of <code>VisualObjects</code> as active in the Property List of Visual Cafe. The
* previously selected property remains selected if it exists for the list of objects.
*
* @param visualObjects an array containing objects of type <code>VisualObject</code>.
* @see #setActiveObjects(VisualObject[], boolean)
*/
public void setActiveObjects(VisualObject[] visualObjects) {
setActiveObjects(visualObjects, false /*!forceDefaultProperty*/);
}
/**
* Sets an array of <code>VisualObjects</code> as active in the Property List of Visual Cafe.
*
* @param visualObjects an array containing objects of type <code>VisualObject</code>.
* @param forceDefaultProperty if true, forces the default property for the object[s] to be selected.
* if false, the previously selected property remains selected (if it exists).
* @see #setActiveObjects(VisualObject[])
*/
public abstract void setActiveObjects(VisualObject[] visualObjects, boolean forceDefaultProperty);
/**
* Gets an array of <code>VisualObjects</code> that are active in the Property List of Visual Cafe.
* If there are no active <code>VisualObjects</code>, a zero-length array is returned.
*
* @return an array containing objects of type <code>VisualObject</code>.
*/
public abstract VisualObject[] getActiveObjects();
/**
* Activates the Property List, showing it as needed.
* @see #activatePropertySheet(char)
*/
public abstract void activatePropertySheet();
/**
* Activates the Property List, showing it as needed, and sends the typed character to it.
* @param typedCharacter the character to send to the property sheet.
* @see #activatePropertySheet()
*/
public abstract void activatePropertySheet(char typedCharacter);
/**
* Removes a <code>VisualObjectListener</code> from all <code>VisualObjects</code>. After this call, the listener will
* not be listening to changes to <i>any</i> <code>VisualObject</code>.
*
* A <code>VisualObjectListener</code> can stop listening to a specific <code>VisualObject</code> by calling that
* <code>VisualObject</code>'s <code>removeVisualObjectListener()</code> method.
*
* @param listener the object that was receiving notifications
* @see VisualObject#addVisualObjectListener
* @see VisualObject#removeVisualObjectListener
*/
public abstract void removeVisualObjectListener(VisualObjectListener listener);
/**
* Adds an <code>ActiveVisualObjectListener</code>. After this call, the listener will be notified
* when a <code>VisualObject</code> is selected into the Property List.
*
* @param listener the object that receives notifications.
* @see #removeActiveVisualObjectListener()
* @see #setActiveObjects(VisualObject[])
*/
public abstract void addActiveVisualObjectListener(ActiveVisualObjectListener listener);
/**
* Removes an <code>ActiveVisualObjectListener</code>. After this call, the listener will no longer be notified
* when a <code>VisualObject</code> is selected into the Property List.
*
* @param listener the object that was receiving notifications.
* @see VisualCafe#addActiveVisualObjectListener
* @see #setActiveObjects(VisualObject[])
*/
public abstract void removeActiveVisualObjectListener(ActiveVisualObjectListener listener);
/**
* Adds a <code>SourceFileListener</code> to all <code>SourceFiles</code>. After this call, the listener will be
* listening to changes to <i>any</i> <code>SourceFile</code>.
*
* A <code>SourceFileListener</code> can listen to a specific <code>SourceFile</code> by calling that <code>SourceFile</code>'s
* <code>addSourceFileListener()</code> method.
*
* @param listener the object that receives notifications
* @see #removeSourceFileListener
* @see SourceFile#addSourceFileListener
*/
public abstract void addSourceFileListener(SourceFileListener listener);
/**
* Removes a <code>SourceFileListener</code> from all <code>SourceFiles</code>. After this call, the listener will not
* be listening to changes to <i>any</i> <code>SourceFile</code>.
*
* A <code>SourceFileListener</code> can stop listenening to a specific <code>SourceFile</code> by calling that <code>SourceFile</code>'s
* <code>removeSourceFileListener()</code> method.
*
* @param listener the object that was receiving notifications.
* @see VisualCafe#addSourceFileListener
* @see SourceFile#removeSourceFileListener
*/
public abstract void removeSourceFileListener(SourceFileListener listener);
/**
* Start listening to changes to Visual Cafe's project system.
*
* @param listener the object that receives notifications.
* @see VisualCafe#removeProjectSystemListener
*/
public abstract void addProjectSystemListener(ProjectSystemListener listener);
/**
* Stop listening to changes to Visual Cafe's project system.
*
* @param listener the object that was receiving notifications.
* @see VisualCafe#addProjectSystemListener
*/
public abstract void removeProjectSystemListener(ProjectSystemListener listener);
/**
* Start listening to when classes' design time information is reparsed.
*
* @param listener the object that receives notifications.
* @see #removeDTListener
* @see VisualProject#addDTListener
* @see com.symantec.itools.vcafe.openapi.dtreflect.DTListener
*/
public abstract void addDTListener(DTListener listener);
/**
* Stop listening to when classes' design time information is reparsed.
*.
* @param listener the object that was receiving notifications.
* @see #addDTListener
* @see VisualProject#removeDTListener
* @see com.symantec.itools.vcafe.openapi.dtreflect.DTListener
*/
public abstract void removeDTListener(DTListener listener);
//
// Online Help Support
//
/**
* Activates online help displaying the link specified by the given help id.
*
* @param helpId the help id to use. (Note: HID_BASE_RESOURCE is added before WinHelp() is invoked).
*/
public abstract void invokeHelp(int helpId);
/**
* Activates online help displaying the link specified by the given help id, in
* the specified help file.
*
* @param helpFile the (WinHelp) help file to use.
* @param helpId the help id to use. (Note: HID_BASE_RESOURCE is added before WinHelp() is invoked).
*/
public abstract void invokeHelp(File helpFile, int helpId);
/**
* Activates online help displaying the link specified by the given help id, in
* the help file with the specified name. If the <code>helpFileName</code> doesn't contain
* a path, the "help" directory is assumed.
*
* @param helpFileName the name of the help file to use.
* @param helpId the help id to use. (Note: HID_BASE_RESOURCE is added before WinHelp() is invoked).
*/
public abstract void invokeHelp(String helpFileName, int helpId);
/**
* Gets Visual Cafe's clipboard object.
*
* @return the clipboard object that allows datatransfer between
* Java and Visual Cafe.
*/
public abstract VisualCafeClipboard getClipboard();
//
// Undo Support
//
/**
* Call before starting an undoable operation.
* @param commandName the command text for the undo menu, one of:<ul type=circle>
* <li>UNDOCUT - menu text for undoing a cut,
* <li>UNDOPASTE - menu text for undoing a paste,
* <li>UNDODELETE - menu text for undoing a delete,
* <li>UNDODRAGDROP - menu text for undoing a drag-n-drop,
* <li>UNDOPROPERTYEDIT - menu text for undoing a property edit,
* <li>UNDOINSERT - menu text for undoing an insert, or
* <li>any other text that specifies a different action.
* </ul>
*/
public abstract void beginUndo(String commandName);
/**
* Call when done with an undoable operation.
*/
public abstract void endUndo();
/**
* Call when starting an operation that can't be undone.
* Disables the "undo" menu selection.
*/
public abstract void clearUndo();
/**
* Sets the undo menu item to the specified text.
* @param commandName the command text for the undo menu, one of:<ul type=circle>
* <li>UNDOCUT - menu text for undoing a cut,
* <li>UNDOPASTE - menu text for undoing a paste,
* <li>UNDODELETE - menu text for undoing a delete,
* <li>UNDODRAGDROP - menu text for undoing a drag-n-drop,
* <li>UNDOPROPERTYEDIT - menu text for undoing a property edit,
* <li>UNDOINSERT - menu text for undoing an insert, or
* <li>any other text that specifies a different action.
* </ul>
*/
public abstract void setUndoCommandName(String commandName);
/**
* Returns an object that provides information about which edition of Visual Cafe is running.
* @return the object providing edition information.
* @see ProductEdition
*/
public abstract ProductEdition getProductEdition();
//
// Window Information
//
/**
* Returns an object that represents the frontmost window.
* Currently, can return objects of type:
* <code>VisualProject</code> (for active project windows), <code>SourceFile</code> (for active source editor windows),
* and <code>VisualRepository</code> (for the Component Library).
* If the frontmost window is not one of these, <code>null</code> is returned.
* @return the topmost window object.
*/
public abstract Object getFrontmostWindow();
/**
* Returns an object that represents the frontmost SourceFile window.
* @return the topmost SourceFile object.
*/
public abstract SourceFile getFrontmostSourceFile();
/**
* Determines the current environment mode (MDI/SDI) of Visual Cafe.
*
* This method is valid only on the Windows platform. On the Macintosh
* platform, it returns false.
*
* @return <code>true</code> for MDI, <code>false</code> for SDI.
*/
public abstract boolean isMDIEnabled();
/**
* Returns the dimensions of Visual Cafe's main frame window.
*
* @return the bounds of the main frame window.
*/
public abstract Rectangle getMainFrameBounds();
/**
* Returns the dimensions of the client area of Visual Cafe's main frame window.
*
* @return the bounds of the client area of the main frame window.
*/
public abstract Rectangle getClientAreaBounds();
/**
* Displays a message on Visual Cafe status bar.
*
* @param the text to display.
*/
public abstract void setMessageText(String message);
/**
* Indicate to the user that a lengthy operation is starting. The Wait cursor is
* displayed until a matching call to <code>stopWaitCursor()</code>.
* This method <b>must</b> be matched by a call to <code>stopWaitCursor()</code>.
* example usage:<code>
* VisualCafe.getVisualCafe().startWaitCursor();
* try {
* ...
* ... lots of time consuming processing here ...
* ...
* } finally {
* VisualCafe.getVisualCafe().stopWaitCursor();
* }</code>
*
* @see #stopWaitCursor()
*/
public abstract void startWaitCursor();
/**
* Indicate that a lengthy operation has ended. The cursor is restored to
* its appearance before <code>startWaitCursor()</code> was called.
*
* @see #startWaitCursor();
*/
public abstract void stopWaitCursor();
//
// DesignTime LookAndFeel Support
//
/**
* Gets the current design time look-and-feel.
*
* @return the current design time look-and-feel.
* @see #setDesignTimeLookAndFeel(LookAndFeel)
* @see #setDesignTimeLookAndFeel(String)
* @see #updateDesignTimeLookAndFeelUI
*/
public abstract LookAndFeel getDesignTimeLookAndFeel();
/**
* Set the current design time look-and-feel.
* The new look-and-feel is applied to both new and existing Components.
* <p>
* This is a JavaBeans bound property.
*
* @param newDesignTimeLookAndFeel an object defining the UI's new look-and-feel.
* @see #setDesignTimeLookAndFeel(String)
* @see #getDesignTimeLookAndFeel
* @see #updateDesignTimeLookAndFeelUI
*/
public abstract void setDesignTimeLookAndFeel(LookAndFeel newDesignTimeLookAndFeel);
/**
* Set the current design time look-and-feel.
* The new look-and-feel is applied to both new and existing Components.
* <p>
* This is a JavaBeans bound property.
*
* @param newDesignTimeLookAndFeelClassName class name of an object defining the UI's new look-and-feel.
* @exception ClassNotFoundException if the specified class cannot be located.
* @exception InstantiationException if the specified class could not be constructed.
* @exception IllegalAccessException if the specified class definition cannot be
* accessed (it's not public).
* @see #setDesignTimeLookAndFeel(LookAndFeel)
* @see #getDesignTimeLookAndFeel
* @see #updateDesignTimeLookAndFeelUI
*/
public abstract void setDesignTimeLookAndFeel(String newDesignTimeLookAndFeelClassName)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException;
/**
* Changes the look-and-feel of a JComponent to match the current design time look-and-feel.
* @param component the component whose look-and-feel needs updating.
* @see #setDesignTimeLookAndFeel(LookAndFeel)
* @see #setDesignTimeLookAndFeel(String)
* @see #getDesignTimeLookAndFeel
*/
public abstract void updateDesignTimeLookAndFeelUI(java.awt.Component component);
//
// Property Changed Support
//
/**
* Starts listening for <code>PropertyChangeEvents</code> generated by Visual Cafe. These occur when the
* bound property "design time look-and-feel" is changed.
* @param listener the object that receives notifications.
* @see #removePropertyChangeListener
* @see #setDesignTimeLookAndFeel(LookAndFeel)
* @see #setDesignTimeLookAndFeel(String)
*/
public abstract void addPropertyChangeListener(PropertyChangeListener listener);
/**
* Stops the specified listener from listening for <code>PropertyChangeEvents</code> generated by Visual Cafe.
* @param listener the object that was receiving notifications.
* @see #addPropertyChangeListener
*/
public abstract void removePropertyChangeListener(PropertyChangeListener listener);
//
// Directory Information
//
/**
* Gets the installation (bin) directory of Visual Cafe.
*
* @return path to the install directory.
*/
public abstract String getInstallDirectory();
/**
* Gets Visual Cafe's "current directory". This is the directory that would be displayed in
* the open file dialog.
*
* @return path to the current directory.
* @see #setDirectory
*/
public abstract String getDirectory();
/**
* Sets Visual Cafe's "current directory". This is the directory that would be displayed in
* the open file dialog.
*
* @param path to the new directory.
* @return true if success, false otherwise.
*/
public abstract boolean setDirectory(String newDirectory);
//
// Threading helpers
//
/**
* Executes a <code>Runnable</code> object in Visual Cafe's main UI thread.
* <p>
* If the caller is already running in the main UI thread,
* the Runnable's <code>run()</code> method is invoked immediately and
* <code>runInMainUIThread()</code> does not return until the <code>run()</code>
* method returns. If the caller is running in any other
* thread, the runnable is queued for later execution in
* the main UI thread and the caller returns immediately.
*
* This method can help performance when calling several
* openapi methods that individually execute in the main UI thread (for
* example, most of the <code>com.symantec.itools.vcafe.openapi.dtreflect</code>
* methods)
*/
public abstract void runInMainUIThread(Runnable runnable);
/**
* Executes a <code>Runnable</code> object in Visual Cafe's main UI thread and wait for completion.
* <p>
* <code>runInMainUIThreadAndWait()</code> does not return
* until the runnable's <code>run()</code> method has completed.
*
* This method can help performance when calling several
* openapi methods that individually execute in the main UI thread (for
* example, most of the <code>com.symantec.itools.vcafe.openapi.dtreflect</code>
* methods)
*/
public abstract void runInMainUIThreadAndWait(final Runnable runnable);
//
// Implementation
//
/**
* Instance of a <code>VisualCafe</code> object, created at startup and always available.
*/
protected static VisualCafe visualCafe;
}