java.lang.Object
org.eclipse.jface.action.Action
org.eclipse.ui.internal.ide.actions.OpenWorkspaceAction
- All Implemented Interfaces:
- org.eclipse.ui.actions.ActionFactory.IWorkbenchAction, org.eclipse.jface.action.IAction
- public class OpenWorkspaceAction
- extends org.eclipse.jface.action.Action
- implements org.eclipse.ui.actions.ActionFactory.IWorkbenchAction
Implements the open workspace action. Opens a dialog prompting for a
directory and then restarts the IDE on that workspace.
- Since:
- 3.0
| Fields inherited from class org.eclipse.jface.action.Action |
|
| Fields inherited from interface org.eclipse.jface.action.IAction |
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT |
|
Method Summary |
private java.lang.String |
buildCommandLine(java.lang.String workspace)
Create and return a string with command line options for eclipse.exe that
will launch a new workbench that is the same as the currently running
one, but using the argument directory as its workspace. |
void |
dispose()
Disposes of this action. |
private java.lang.String |
promptForWorkspace()
Use the ChooseWorkspaceDialog to get the new workspace from the user. |
void |
run()
Runs this action. |
| Methods inherited from class org.eclipse.jface.action.Action |
addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, notifyResult, removeAcceleratorText, removeMnemonics, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.action.IAction |
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
PROP_VM
private static final java.lang.String PROP_VM
- See Also:
- Constant Field Values
PROP_VMARGS
private static final java.lang.String PROP_VMARGS
- See Also:
- Constant Field Values
PROP_COMMANDS
private static final java.lang.String PROP_COMMANDS
- See Also:
- Constant Field Values
PROP_EXIT_CODE
private static final java.lang.String PROP_EXIT_CODE
- See Also:
- Constant Field Values
PROP_EXIT_DATA
private static final java.lang.String PROP_EXIT_DATA
- See Also:
- Constant Field Values
CMD_DATA
private static final java.lang.String CMD_DATA
- See Also:
- Constant Field Values
CMD_VMARGS
private static final java.lang.String CMD_VMARGS
- See Also:
- Constant Field Values
NEW_LINE
private static final java.lang.String NEW_LINE
- See Also:
- Constant Field Values
window
private org.eclipse.ui.IWorkbenchWindow window
OpenWorkspaceAction
public OpenWorkspaceAction(org.eclipse.ui.IWorkbenchWindow window)
- Set definition for this action and text so that it will be used for
File -> Open Workspace in the argument window.
run
public void run()
- Description copied from interface:
org.eclipse.jface.action.IAction
- Runs this action.
Each action implementation must define the steps needed to carry out this action.
The default implementation of this method in
Action
does nothing.
- Specified by:
run in interface org.eclipse.jface.action.IAction
promptForWorkspace
private java.lang.String promptForWorkspace()
- Use the ChooseWorkspaceDialog to get the new workspace from the user.
buildCommandLine
private java.lang.String buildCommandLine(java.lang.String workspace)
- Create and return a string with command line options for eclipse.exe that
will launch a new workbench that is the same as the currently running
one, but using the argument directory as its workspace.
dispose
public void dispose()
- Description copied from interface:
org.eclipse.ui.actions.ActionFactory.IWorkbenchAction
- Disposes of this action. Once disposed, this action cannot be used.
This operation has no effect if the action has already been
disposed.
- Specified by:
dispose in interface org.eclipse.ui.actions.ActionFactory.IWorkbenchAction