Java Doc for Saveable.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » 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 workbench » org.eclipse.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.ui.internal.InternalSaveable
      org.eclipse.ui.Saveable

All known Subclasses:   org.eclipse.ui.internal.DefaultSaveable,
Saveable
abstract public class Saveable extends InternalSaveable implements IAdaptable(Code)
A Saveable represents a unit of saveability, e.g. an editable subset of the underlying domain model that may contain unsaved changes. Different workbench parts (editors and views) may present the same saveables in different ways. This interface allows the workbench to provide more appropriate handling of operations such as saving and closing workbench parts. For example, if two editors sharing the same saveable with unsaved changes are closed simultaneously, the user is only prompted to save the changes once for the shared saveable, rather than once for each editor.

Workbench parts that work in terms of saveables should implement ISaveablesSource .


See Also:   ISaveablesSource
since:
   3.2




Method Summary
public  voiddisableUI(IWorkbenchPart[] parts, boolean closing)
     Disables the UI of the given parts containing this saveable if necessary. This method is not intended to be called by clients.
abstract public  voiddoSave(IProgressMonitor monitor)
     Saves the contents of this saveable.
public  IJobRunnabledoSave(IProgressMonitor monitor, IShellProvider shellProvider)
     Saves this saveable, or prepares this saveable for a background save operation.
public  voidenableUI(IWorkbenchPart[] parts)
     Enables the UI of the given parts containing this saveable after a background save operation has finished.
abstract public  booleanequals(Object object)
     Clients must implement equals and hashCode as defined in Object.equals(Object) and Object.hashCode .
public  ObjectgetAdapter(Class adapter)
     This implementation of IAdaptable.getAdapter(Class) returns null.
abstract public  ImageDescriptorgetImageDescriptor()
     Returns the image descriptor for this saveable.
abstract public  StringgetName()
     Returns the name of this saveable for display purposes.
abstract public  StringgetToolTipText()
     Returns the tool tip text for this saveable.
abstract public  inthashCode()
     Clients must implement equals and hashCode as defined in Object.equals(Object) and Object.hashCode .
abstract public  booleanisDirty()
     Returns whether the contents of this saveable have changed since the last save operation.
public  booleanshow(IWorkbenchPage page)
     Attempts to show this saveable in the given page and returns true on success.



Method Detail
disableUI
public void disableUI(IWorkbenchPart[] parts, boolean closing)(Code)
Disables the UI of the given parts containing this saveable if necessary. This method is not intended to be called by clients. A corresponding call to

Saveables that can be saved in the background should ensure that the user cannot make changes to their data from the UI, for example by disabling controls, unless they are prepared to handle this case. This method is called on the UI thread after a job runnable has been returned from Saveable.doSave(IProgressMonitor,IShellProvider) and before spinning the event loop. The closing flag indicates that this saveable is currently being saved in response to closing a workbench part, in which case further changes to this saveable through the UI must be prevented.

The default implementation calls setEnabled(false) on the given parts' composites.


Parameters:
  parts - the workbench parts containing this saveable
Parameters:
  closing - a boolean flag indicating whether the save was triggered by arequest to close a workbench part, and all of the given partswill be closed after the save operation finishes successfully.
since:
   3.3



doSave
abstract public void doSave(IProgressMonitor monitor) throws CoreException(Code)
Saves the contents of this saveable.

If the save is cancelled through user action, or for any other reason, the part should invoke setCancelled on the IProgressMonitor to inform the caller.

This method is long-running; progress and cancellation are provided by the given progress monitor.


Parameters:
  monitor - the progress monitor
throws:
  CoreException - if the save fails; it is the caller's responsibility toreport the failure to the user



doSave
public IJobRunnable doSave(IProgressMonitor monitor, IShellProvider shellProvider) throws CoreException(Code)
Saves this saveable, or prepares this saveable for a background save operation. Returns null if this saveable has been successfully saved, or a job runnable that needs to be run to complete the save in the background. This method is called in the UI thread. If this saveable supports saving in the background, it should do only minimal work. However, since the job runnable returned by this method (if any) will not run on the UI thread, this method should copy any state that can only be accessed from the UI thread so that the job runnable will be able to access it.

The supplied shell provider can be used from within this method and from within the job runnable for the purpose of parenting dialogs. Care should be taken not to open dialogs gratuitously and only if user input is required for cases where the save cannot otherwise proceed - note that in any given save operation, many saveable objects may be saved at the same time. In particular, errors should be signaled by throwing an exception, or if an error occurs while running the job runnable, an error status should be returned.

If the foreground part of the save is cancelled through user action, or for any other reason, the part should invoke setCancelled on the IProgressMonitor to inform the caller. If the background part of the save is cancelled, the job should return a IStatus.CANCEL status.

This method is long-running; progress and cancellation are provided by the given progress monitor.

The default implementation of this method calls Saveable.doSave(IProgressMonitor) and returns null.


Parameters:
  monitor - a progress monitor used for reporting progress andcancellation
Parameters:
  shellProvider - an object that can provide a shell for parenting dialogs null if this saveable has been saved successfully,or a job runnable that needs to be run to complete the save inthe background.
since:
   3.3



enableUI
public void enableUI(IWorkbenchPart[] parts)(Code)
Enables the UI of the given parts containing this saveable after a background save operation has finished. This method is not intended to be called by clients.

The default implementation calls setEnabled(true) on the given parts' composites.


Parameters:
  parts - the workbench parts containing this saveable
since:
   3.3



equals
abstract public boolean equals(Object object)(Code)
Clients must implement equals and hashCode as defined in Object.equals(Object) and Object.hashCode . Two saveables should be equal if their dirty state is shared, and saving one will save the other. If two saveables are equal, their names, tooltips, and images should be the same because only one of them will be shown when prompting the user to save.
Parameters:
  object - true if this Saveable is equal to the given object



getAdapter
public Object getAdapter(Class adapter)(Code)
This implementation of IAdaptable.getAdapter(Class) returns null. Subclasses may override. This allows two unrelated subclasses of Saveable to implement Saveable.equals(Object) and Saveable.hashCode() based on an underlying implementation class that is shared by both Saveable subclasses.
since:
   3.3



getImageDescriptor
abstract public ImageDescriptor getImageDescriptor()(Code)
Returns the image descriptor for this saveable. the image descriptor for this model; may be nullif there is no image



getName
abstract public String getName()(Code)
Returns the name of this saveable for display purposes. the model's name; never null.



getToolTipText
abstract public String getToolTipText()(Code)
Returns the tool tip text for this saveable. This text is used to differentiate between two inputs with the same name. For instance, MyClass.java in folder X and MyClass.java in folder Y. The format of the text varies between input types. the tool tip text; never null



hashCode
abstract public int hashCode()(Code)
Clients must implement equals and hashCode as defined in Object.equals(Object) and Object.hashCode . Two saveables should be equal if their dirty state is shared, and saving one will save the other. If two saveables are equal, their hash codes MUST be the same, and their names, tooltips, and images should be the same because only one of them will be shown when prompting the user to save.

IMPORTANT: Implementers should ensure that the hashCode returned is sufficiently unique so as not to collide with hashCodes returned by other implementations. It is suggested that the defining plug-in's ID be used as part of the returned hashCode, as in the following example:

 int PRIME = 31;
 int hash = ...; // compute the "normal" hash code, e.g. based on some identifier unique within the defining plug-in
 return hash * PRIME + MY_PLUGIN_ID.hashCode();
 
a hash code



isDirty
abstract public boolean isDirty()(Code)
Returns whether the contents of this saveable have changed since the last save operation.

Note: this method is called frequently, for example by actions to determine their enabled status.

true if the contents have been modified and needsaving, and false if they have not changed sincethe last save



show
public boolean show(IWorkbenchPage page)(Code)
Attempts to show this saveable in the given page and returns true on success. The default implementation does nothing and returns false.
Parameters:
  page - the workbench page in which to show this saveable true if this saveable is now visible to the user
since:
   3.3




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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