Java Doc for AbstractWorkspaceOperation.java in  » IDE-Eclipse » ui-ide » org » eclipse » ui » ide » undo » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » ui ide » org.eclipse.ui.ide.undo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.ui.ide.undo.AbstractWorkspaceOperation

All known Subclasses:   org.eclipse.ui.ide.undo.AbstractResourcesOperation,  org.eclipse.ui.ide.undo.AbstractMarkersOperation,
AbstractWorkspaceOperation
abstract public class AbstractWorkspaceOperation extends AbstractOperation implements IAdvancedUndoableOperation,IAdvancedUndoableOperation2(Code)
An AbstractWorkspaceOperation represents an undoable operation that affects the workspace. It handles common workspace operation activities such as tracking which resources are affected by an operation, prompting the user when there are possible side effects of operations, building execution exceptions from core exceptions, etc. Clients may call the public API from a background thread. This class is not intended to be subclassed by clients.
since:
   3.3


Field Summary
protected static  intEXECUTE
    
protected static  intREDO
    
protected static  intUNDO
    
 String[]modelProviderIds
    
protected  booleanquietCompute
    
protected  IResource[]resources
    

Constructor Summary
 AbstractWorkspaceOperation(String name)
     Create an AbstractWorkspaceOperation with the specified name.

Method Summary
public  voidaboutToNotify(OperationHistoryEvent event)
    
protected  voidappendDescriptiveText(StringBuffer text)
     Append any descriptive text to the specified string buffer to be shown in the receiver's AbstractWorkspaceOperation.toString() text.
public  booleancanExecute()
    
public  booleancanRedo()
    
public  booleancanUndo()
    
public  IStatuscomputeExecutionStatus(IProgressMonitor monitor)
     Return a status indicating the projected outcome of executing the receiver.
public  IStatuscomputeRedoableStatus(IProgressMonitor monitor)
     Return a status indicating the projected outcome of redoing the receiver. This method is not called by the operation history, but instead is used by clients (such as implementers of org.eclipse.core.commands.operations.IOperationApprover2 ) who wish to perform advanced validation of an operation before attempting to redo it. If an ERROR status is returned, the redo will not proceed and the user notified if deemed necessary by the caller.
public  IStatuscomputeUndoableStatus(IProgressMonitor monitor)
     Return a status indicating the projected outcome of undoing the receiver. This method is not called by the operation history, but instead is used by clients (such as implementers of org.eclipse.core.commands.operations.IOperationApprover2 ) who wish to perform advanced validation of an operation before attempting to undo it. If an ERROR status is returned, the undo will not proceed and the user notified if deemed necessary by the caller.
abstract protected  voiddoExecute(IProgressMonitor monitor, IAdaptable uiInfo)
     Perform the specific work involved in executing this operation.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary.
abstract protected  voiddoUndo(IProgressMonitor monitor, IAdaptable uiInfo)
     Perform the specific work involved in undoing this operation.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary.
public  IStatusexecute(IProgressMonitor monitor, IAdaptable uiInfo)
     Execute the specified operation.
public  Object[]getAffectedObjects()
    
protected  IStatusgetErrorStatus(String message)
     Return an error status describing an invalid operation using the provided message.
protected  ISchedulingRulegetExecuteSchedulingRule()
     Return a scheduling rule appropriate for executing this operation. The default implementation is to return a rule that locks out the entire workspace.
protected  ISchedulingRulegetRedoSchedulingRule()
     Return a scheduling rule appropriate for redoing this operation.
protected  ShellgetShell(IAdaptable uiInfo)
     Return the shell described by the specified adaptable, or the active shell if no shell has been specified in the adaptable.
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary.
protected  ISchedulingRulegetUndoSchedulingRule()
     Return a scheduling rule appropriate for undoing this operation. The default implementation is to return a rule that locks out the entire workspace.
protected  IStatusgetWarningStatus(String message, int code)
     Return a warning status describing the warning state of an operation using the provided message and code.
protected  IWorkspacegetWorkspace()
     Return the workspace manipulated by this operation.
protected  IResourceRuleFactorygetWorkspaceRuleFactory()
     Return the workspace rule factory associated with this operation.
protected  booleanisValid()
     Return whether the proposed operation is valid.
protected  voidmarkInvalid()
     Mark this operation invalid due to some external change.
public  IStatusredo(IProgressMonitor monitor, IAdaptable uiInfo)
     Redo the specified operation.
protected  booleanresourcesExist()
     Return whether the resources known by this operation currently exist.
protected  booleanresourcesIncludesProjects()
     Return whether the resources known by this operation contain any projects.
public  booleanrunInBackground()
    
public  voidsetModelProviderIds(String[] ids)
     Set the ids of any model providers for the resources involved.
public  voidsetQuietCompute(boolean quiet)
    
protected  voidsetTargetResources(IResource[] resources)
    
public  StringtoString()
    
public  IStatusundo(IProgressMonitor monitor, IAdaptable uiInfo)
     Undo the specified operation.
protected  booleanupdateResourceChangeDescriptionFactory(IResourceChangeDescriptionFactory factory, int operation)
     Update the provided resource change description factory so it can generate a resource delta describing the result of an undo or redo. Return a boolean indicating whether any update was done.

Field Detail
EXECUTE
protected static int EXECUTE(Code)



REDO
protected static int REDO(Code)



UNDO
protected static int UNDO(Code)



modelProviderIds
String[] modelProviderIds(Code)



quietCompute
protected boolean quietCompute(Code)



resources
protected IResource[] resources(Code)




Constructor Detail
AbstractWorkspaceOperation
AbstractWorkspaceOperation(String name)(Code)
Create an AbstractWorkspaceOperation with the specified name.
Parameters:
  name - the name used to describe the operation




Method Detail
aboutToNotify
public void aboutToNotify(OperationHistoryEvent event)(Code)



appendDescriptiveText
protected void appendDescriptiveText(StringBuffer text)(Code)
Append any descriptive text to the specified string buffer to be shown in the receiver's AbstractWorkspaceOperation.toString() text.

Note that this method is not intend to be subclassed by clients.
Parameters:
  text - the StringBuffer on which to append the text




canExecute
public boolean canExecute()(Code)



canRedo
public boolean canRedo()(Code)



canUndo
public boolean canUndo()(Code)



computeExecutionStatus
public IStatus computeExecutionStatus(IProgressMonitor monitor)(Code)
Return a status indicating the projected outcome of executing the receiver. This method is not called by the operation history, but instead is used by clients (such as implementers of org.eclipse.core.commands.operations.IOperationApprover2 ) who wish to perform advanced validation of an operation before attempting to execute it. If an ERROR status is returned, the operation will not proceed and the user notified if deemed necessary by the caller. The validity flag on the operation should be marked as invalid. If an OK status is returned, the operation will proceed. The caller must interpret any other returned status severity, and may choose to prompt the user as to how to proceed. If there are multiple conditions that result in an ambiguous status severity, it is best for the implementor of this method to consult the user as to how to proceed for each one, and return an OK or ERROR status that accurately reflects the user's wishes, or to return a multi-status that accurately describes all of the issues at hand, so that the caller may potentially consult the user. (Note that the user should not be consulted at all if a client has called AbstractWorkspaceOperation.setQuietCompute(boolean) with a value of true.) This implementation computes the validity of execution by computing the resource delta that would be generated on execution, and checking whether any registered model providers are affected by the operation.
Parameters:
  monitor - the progress monitor to be used for computing the status the status indicating the projected outcome of executing thereceiver
See Also:   org.eclipse.core.commands.operations.IAdvancedUndoableOperation.computeUndoableStatus(org.eclipse.core.runtime.IProgressMonitor)
See Also:   AbstractWorkspaceOperation.setQuietCompute(boolean)



computeRedoableStatus
public IStatus computeRedoableStatus(IProgressMonitor monitor)(Code)
Return a status indicating the projected outcome of redoing the receiver. This method is not called by the operation history, but instead is used by clients (such as implementers of org.eclipse.core.commands.operations.IOperationApprover2 ) who wish to perform advanced validation of an operation before attempting to redo it. If an ERROR status is returned, the redo will not proceed and the user notified if deemed necessary by the caller. The validity flag on the operation should be marked as invalid. If an OK status is returned, the redo will proceed. The caller must interpret any other returned status severity, and may choose to prompt the user as to how to proceed. If there are multiple conditions that result in an ambiguous status severity, it is best for the implementor of this method to consult the user as to how to proceed for each one, and return an OK or ERROR status that accurately reflects the user's wishes, or to return a multi-status that accurately describes all of the issues at hand, so that the caller may potentially consult the user. (Note that the user should not be consulted at all if a client has called AbstractWorkspaceOperation.setQuietCompute(boolean) with a value of true.) This implementation computes the validity of redo by computing the resource delta that would be generated on redo, and checking whether any registered model providers are affected by the operation.
Parameters:
  monitor - the progress monitor to be used for computing the status the status indicating the projected outcome of redoing thereceiver
See Also:   org.eclipse.core.commands.operations.IAdvancedUndoableOperation.computeUndoableStatus(org.eclipse.core.runtime.IProgressMonitor)
See Also:   AbstractWorkspaceOperation.setQuietCompute(boolean)



computeUndoableStatus
public IStatus computeUndoableStatus(IProgressMonitor monitor)(Code)
Return a status indicating the projected outcome of undoing the receiver. This method is not called by the operation history, but instead is used by clients (such as implementers of org.eclipse.core.commands.operations.IOperationApprover2 ) who wish to perform advanced validation of an operation before attempting to undo it. If an ERROR status is returned, the undo will not proceed and the user notified if deemed necessary by the caller. The validity flag on the operation should be marked as invalid. If an OK status is returned, the undo will proceed. The caller must interpret any other returned status severity, and may choose to prompt the user as to how to proceed. If there are multiple conditions that result in an ambiguous status severity, it is best for the implementor of this method to consult the user as to how to proceed for each one, and return an OK or ERROR status that accurately reflects the user's wishes, or to return a multi-status that accurately describes all of the issues at hand, so that the caller may potentially consult the user. (Note that the user should not be consulted at all if a client has called AbstractWorkspaceOperation.setQuietCompute(boolean) with a value of true.) This implementation computes the validity of undo by computing the resource delta that would be generated on undo, and checking whether any registered model providers are affected by the operation.
Parameters:
  monitor - the progress monitor to be used for computing the status the status indicating the projected outcome of undoing thereceiver
See Also:   org.eclipse.core.commands.operations.IAdvancedUndoableOperation.computeUndoableStatus(org.eclipse.core.runtime.IProgressMonitor)
See Also:   AbstractWorkspaceOperation.setQuietCompute(boolean)



doExecute
abstract protected void doExecute(IProgressMonitor monitor, IAdaptable uiInfo) throws CoreException(Code)
Perform the specific work involved in executing this operation.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull, it contains an adapter for theorg.eclipse.swt.widgets.Shell.class
throws:
  CoreException - propagates any CoreExceptions thrown from the resources API



doUndo
abstract protected void doUndo(IProgressMonitor monitor, IAdaptable uiInfo) throws CoreException(Code)
Perform the specific work involved in undoing this operation.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull, it contains an adapter for theorg.eclipse.swt.widgets.Shell.class
throws:
  CoreException - propagates any CoreExceptions thrown from the resources API



execute
public IStatus execute(IProgressMonitor monitor, IAdaptable uiInfo) throws ExecutionException(Code)
Execute the specified operation. This implementation executes the operation in a workspace runnable and catches any CoreExceptions resulting from the operation. Unhandled CoreExceptions are propagated as ExecutionExceptions.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull, it contains an adapter for theorg.eclipse.swt.widgets.Shell.class the IStatus of the execution. The status severity should be setto OK if the operation was successful, andERROR if it was not. Any other status is assumedto represent an incompletion of the execution.
throws:
  ExecutionException - if an exception occurred during execution.
See Also:   org.eclipse.core.commands.operations.IUndoableOperation.execute(org.eclipse.core.runtime.IProgressMonitororg.eclipse.core.runtime.IAdaptable)



getAffectedObjects
public Object[] getAffectedObjects()(Code)



getErrorStatus
protected IStatus getErrorStatus(String message)(Code)
Return an error status describing an invalid operation using the provided message.
Parameters:
  message - the message to be used in the status, or nullif a generic message should be used the error status



getExecuteSchedulingRule
protected ISchedulingRule getExecuteSchedulingRule()(Code)
Return a scheduling rule appropriate for executing this operation. The default implementation is to return a rule that locks out the entire workspace. Subclasses are encouraged to provide more specific rules that affect only their resources. the scheduling rule to use when executing this operation, ornull if there are no scheduling restrictions forthis operation.
See Also:   IWorkspace.run(IWorkspaceRunnableISchedulingRuleintIProgressMonitor)



getRedoSchedulingRule
protected ISchedulingRule getRedoSchedulingRule()(Code)
Return a scheduling rule appropriate for redoing this operation. The default implementation considers the redo scheduling rule the same as the original execution scheduling rule. the scheduling rule to use when redoing this operation, ornull if there are no scheduling restrictions forthis operation.
See Also:   IWorkspace.run(IWorkspaceRunnableISchedulingRuleintIProgressMonitor)



getShell
protected Shell getShell(IAdaptable uiInfo)(Code)
Return the shell described by the specified adaptable, or the active shell if no shell has been specified in the adaptable.
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull, it contains an adapter for theorg.eclipse.swt.widgets.Shell.class the shell specified in the adaptable, or the active shell if noshell has been specified



getUndoSchedulingRule
protected ISchedulingRule getUndoSchedulingRule()(Code)
Return a scheduling rule appropriate for undoing this operation. The default implementation is to return a rule that locks out the entire workspace. Subclasses are encouraged to provide more specific rules that affect only their resources. the scheduling rule to use when undoing this operation, ornull if there are no scheduling restrictions forthis operation.
See Also:   IWorkspace.run(IWorkspaceRunnableISchedulingRuleintIProgressMonitor)



getWarningStatus
protected IStatus getWarningStatus(String message, int code)(Code)
Return a warning status describing the warning state of an operation using the provided message and code.
Parameters:
  message - the message to be used in the status, or nullif a generic message should be used
Parameters:
  code - the integer code to be assigned to the status the warning status



getWorkspace
protected IWorkspace getWorkspace()(Code)
Return the workspace manipulated by this operation. the IWorkspace used by this operation.



getWorkspaceRuleFactory
protected IResourceRuleFactory getWorkspaceRuleFactory()(Code)
Return the workspace rule factory associated with this operation. the IResourceRuleFactory associated with this operation.



isValid
protected boolean isValid()(Code)
Return whether the proposed operation is valid. The default implementation simply checks to see if the flag has been marked as invalid, relying on subclasses to mark the flag invalid when appropriate. the validity flag



markInvalid
protected void markInvalid()(Code)
Mark this operation invalid due to some external change. May be used by subclasses.



redo
public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) throws ExecutionException(Code)
Redo the specified operation. This implementation redoes the operation in a workspace runnable and catches any CoreExceptions resulting from the operation. Unhandled CoreExceptions are propagated as ExecutionExceptions.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull, it contains an adapter for theorg.eclipse.swt.widgets.Shell.class the IStatus of the redo. The status severity should be set toOK if the operation was successful, andERROR if it was not. Any other status is assumedto represent an incompletion of the redo.
throws:
  ExecutionException - if an exception occurred during execution.
See Also:   org.eclipse.core.commands.operations.IUndoableOperation.redo(org.eclipse.core.runtime.IProgressMonitororg.eclipse.core.runtime.IAdaptable)



resourcesExist
protected boolean resourcesExist()(Code)
Return whether the resources known by this operation currently exist. true if there are existing resources andfalse if there are no known resources or any oneof them does not exist



resourcesIncludesProjects
protected boolean resourcesIncludesProjects()(Code)
Return whether the resources known by this operation contain any projects. true if there is one or more projects known bythis operation and false if there are no projects.



runInBackground
public boolean runInBackground()(Code)



setModelProviderIds
public void setModelProviderIds(String[] ids)(Code)
Set the ids of any model providers for the resources involved.
Parameters:
  ids - the array of String model provider ids that provide modelsassociated with the resources involved in this operation



setQuietCompute
public void setQuietCompute(boolean quiet)(Code)



setTargetResources
protected void setTargetResources(IResource[] resources)(Code)
Set the resources which are affected by this operation
Parameters:
  resources - an array of resources



toString
public String toString()(Code)



undo
public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) throws ExecutionException(Code)
Undo the specified operation. This implementation undoes the operation in a workspace runnable and catches any CoreExceptions resulting from the operation. Unhandled CoreExceptions are propagated as ExecutionExceptions.
Parameters:
  monitor - the progress monitor to use for the operation
Parameters:
  uiInfo - the IAdaptable (or null) provided by thecaller in order to supply UI information for prompting theuser if necessary. When this parameter is notnull, it contains an adapter for theorg.eclipse.swt.widgets.Shell.class the IStatus of the undo. The status severity should be set toOK if the operation was successful, andERROR if it was not. Any other status is assumedto represent an incompletion of the undo. *
throws:
  ExecutionException - if an exception occurred during execution.
See Also:   org.eclipse.core.commands.operations.IUndoableOperation.undo(org.eclipse.core.runtime.IProgressMonitororg.eclipse.core.runtime.IAdaptable)



updateResourceChangeDescriptionFactory
protected boolean updateResourceChangeDescriptionFactory(IResourceChangeDescriptionFactory factory, int operation)(Code)
Update the provided resource change description factory so it can generate a resource delta describing the result of an undo or redo. Return a boolean indicating whether any update was done. The default implementation does not update the factory. Subclasses are expected to override this method to more specifically describe their modifications to the workspace.
Parameters:
  factory - the factory to update
Parameters:
  operation - an integer indicating whether the change is part of anexecute, undo, or redo a boolean indicating whether the factory was updated.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.