Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.team.ui
Class SaveablePartAdapter

java.lang.Object
  extended byorg.eclipse.team.ui.SaveablePartAdapter

All Implemented Interfaces:
IAdaptable, ISaveablePart, ISaveableWorkbenchPart, IWorkbenchPart

Direct Known Subclasses:
ParticipantPageSaveablePart


public abstract class SaveablePartAdapter
extends Object
implements ISaveableWorkbenchPart

This adapter provides default implementations for methods on ISaveableWorkbenchPart and IWorkbenchPart.

Classes that want to implement a saveable part can simply implement the methods that they need while accepting the provided defaults for most of the methods.

Since:
3.0
See Also:
SaveablePartDialog


Field Summary
 
Fields inherited from interface org.eclipse.team.ui.ISaveableWorkbenchPart
PROP_DIRTY
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
SaveablePartAdapter()
           
 
Method Summary
 void addPropertyListener(IPropertyListener listener)
          Adds a listener for changes to properties of this workbench part.
 void dispose()
          Disposes of this workbench part.
 void doSaveAs()
          Saves the contents of this part to another object.
 Object getAdapter(Class adapter)
          Returns an object which is an instance of the given class associated with this object.
 IWorkbenchPartSite getSite()
          Returns the site for this workbench part.
 String getTitleToolTip()
          Returns the title tool tip text of this workbench part.
 boolean isSaveAsAllowed()
          Returns whether the "Save As" operation is supported by this part.
 boolean isSaveOnCloseNeeded()
          Returns whether the contents of this part should be saved when the part is closed.
 void removePropertyListener(IPropertyListener listener)
          Removes the given property listener from this workbench part.
 void setFocus()
          Asks this part to take focus within the workbench.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.ISaveablePart
doSave, isDirty
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
createPartControl, getTitle, getTitleImage
 

Constructor Detail

 

 

SaveablePartAdapter

public SaveablePartAdapter()

Method Detail

 

 

doSaveAs

public void doSaveAs()

Description copied from interface: ISaveablePart
Saves the contents of this part to another object.

Implementors are expected to open a "Save As" dialog where the user will be able to select a new name for the contents. After the selection is made, the contents should be saved to that new name. During this operation a IProgressMonitor should be used to indicate progress.

If the save is successful, the part fires a property changed event reflecting the new dirty state (PROP_DIRTY property).

Specified by:
doSaveAs in interface ISaveablePart


 

 

isSaveAsAllowed

public boolean isSaveAsAllowed()

Description copied from interface: ISaveablePart
Returns whether the "Save As" operation is supported by this part.

Specified by:
isSaveAsAllowed in interface ISaveablePart

Returns:
true if "Save As" is supported, and false if not supported


 

 

isSaveOnCloseNeeded

public boolean isSaveOnCloseNeeded()

Description copied from interface: ISaveablePart
Returns whether the contents of this part should be saved when the part is closed.

Specified by:
isSaveOnCloseNeeded in interface ISaveablePart

Returns:
true if the contents of the part should be saved on close, and false if the contents are expendable


 

 

addPropertyListener

public void addPropertyListener(IPropertyListener listener)

Description copied from interface: IWorkbenchPart
Adds a listener for changes to properties of this workbench part. Has no effect if an identical listener is already registered.

The property ids are defined in IWorkbenchPartConstants.

Specified by:
addPropertyListener in interface IWorkbenchPart

Parameters:
listener - a property listener


 

 

dispose

public void dispose()

Description copied from interface: IWorkbenchPart
Disposes of this workbench part.

This is the last method called on the IWorkbenchPart. At this point the part controls (if they were ever created) have been disposed as part of an SWT composite. There is no guarantee that createPartControl() has been called, so the part controls may never have been created.

Within this method a part may release any resources, fonts, images, etc.  held by this part. It is also very important to deregister all listeners from the workbench.

Clients should not call this method (the workbench calls this method at appropriate times).

Specified by:
dispose in interface IWorkbenchPart


 

 

getSite

public IWorkbenchPartSite getSite()

Description copied from interface: IWorkbenchPart
Returns the site for this workbench part. The site can be null while the workbench part is being initialized. After the initialization is complete, this value must be non-null for the remainder of the part's life cycle.

Specified by:
getSite in interface IWorkbenchPart

Returns:
The part site; this value may be null if the part has not yet been initialized


 

 

getTitleToolTip

public String getTitleToolTip()

Description copied from interface: IWorkbenchPart
Returns the title tool tip text of this workbench part. An empty string result indicates no tool tip. If this value changes the part must fire a property listener event with PROP_TITLE.

The tool tip text is used to populate the title bar of this part's visual container.

Specified by:
getTitleToolTip in interface IWorkbenchPart

Returns:
the workbench part title tool tip (not null)


 

 

removePropertyListener

public void removePropertyListener(IPropertyListener listener)

Description copied from interface: IWorkbenchPart
Removes the given property listener from this workbench part. Has no affect if an identical listener is not registered.

Specified by:
removePropertyListener in interface IWorkbenchPart

Parameters:
listener - a property listener


 

 

setFocus

public void setFocus()

Description copied from interface: IWorkbenchPart
Asks this part to take focus within the workbench.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.

Specified by:
setFocus in interface IWorkbenchPart


 

 

getAdapter

public Object getAdapter(Class adapter)

Description copied from interface: IAdaptable
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Specified by:
getAdapter in interface IAdaptable

Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.