Eclipse Platform
Release 3.2

org.eclipse.team.ui
Class PageSaveablePart

java.lang.Object
  extended byorg.eclipse.team.ui.SaveablePartAdapter
      extended byorg.eclipse.team.ui.PageSaveablePart
All Implemented Interfaces:
IAdaptable, IContentChangeListener, ISaveablePart, ISaveableWorkbenchPart, IWorkbenchPart
Direct Known Subclasses:
HistoryPageSaveablePart, ParticipantPageSaveablePart

public abstract class PageSaveablePart
extends SaveablePartAdapter
implements IContentChangeListener


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
PageSaveablePart(Shell shell, CompareConfiguration cc)
           
 
Method Summary
 void createPartControl(Composite parent2)
          Creates the SWT controls for this workbench part.
protected  CompareConfiguration getCompareConfiguration()
           
protected  ICompareInput getCompareInput(ISelection selection)
           
protected  CompareViewerSwitchingPane getContentPane()
           
 Control getControl()
          Returns the primary control for this part.
protected  ArrayList getDirtyViewers()
           
protected  CompareViewerPane getEditionPane()
           
protected  Shell getShell()
           
protected  CompareViewerSwitchingPane getStructuredComparePane()
           
abstract  String getTitle()
          Returns the title of this workbench part.
abstract  Image getTitleImage()
          Returns the title image of this workbench part.
protected  void hookContentChangeListener(ICompareInput node)
           
 boolean isDirty()
          Returns whether the contents of this part have changed since the last save operation.
protected  void prepareCompareInput(ICompareInput input)
           
protected abstract  void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor)
           
protected  void setDirty(boolean dirty)
           
protected  void setInput(Object input)
           
 void setShowContentPanes(boolean showContentPanes)
          Set whether the file contents panes should be shown.
 
Methods inherited from class org.eclipse.team.ui.SaveablePartAdapter
addPropertyListener, dispose, doSaveAs, getAdapter, getSite, getTitleToolTip, isSaveAsAllowed, isSaveOnCloseNeeded, removePropertyListener, setFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.compare.IContentChangeListener
contentChanged
 
Methods inherited from interface org.eclipse.ui.ISaveablePart
doSave
 

Constructor Detail

PageSaveablePart

public PageSaveablePart(Shell shell,
                        CompareConfiguration cc)
Method Detail

isDirty

public boolean isDirty()
Description copied from interface: ISaveablePart
Returns whether the contents of this part have changed since the last save operation. If this value changes the part must fire a property listener event with PROP_DIRTY.

Note: this method is called often on a part open or part activation switch, for example by actions to determine their enabled status.

Specified by:
isDirty in interface ISaveablePart
Returns:
true if the contents have been modified and need saving, and false if they have not changed since the last save

createPartControl

public void createPartControl(Composite parent2)
Description copied from interface: IWorkbenchPart
Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the site's IActionBars.
  4. Register any context menus with the site.
  5. Register a selection provider with the site, to make it available to the workbench's ISelectionService (optional).

Specified by:
createPartControl in interface IWorkbenchPart
Parameters:
parent2 - the parent control

setDirty

protected void setDirty(boolean dirty)

setInput

protected void setInput(Object input)

prepareCompareInput

protected void prepareCompareInput(ICompareInput input)

prepareInput

protected abstract void prepareInput(ICompareInput input,
                                     CompareConfiguration configuration,
                                     IProgressMonitor monitor)
                              throws InvocationTargetException
Throws:
InvocationTargetException

hookContentChangeListener

protected void hookContentChangeListener(ICompareInput node)

getTitle

public abstract String getTitle()
Description copied from interface: IWorkbenchPart
Returns the title of this workbench part. If this value changes the part must fire a property listener event with PROP_TITLE.

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

Specified by:
getTitle in interface IWorkbenchPart
Returns:
the workbench part title (not null)

getTitleImage

public abstract Image getTitleImage()
Description copied from interface: IWorkbenchPart
Returns the title image of this workbench part. If this value changes the part must fire a property listener event with PROP_TITLE.

The title image is usually used to populate the title bar of this part's visual container. Since this image is managed by the part itself, callers must not dispose the returned image.

Specified by:
getTitleImage in interface IWorkbenchPart
Returns:
the title image

getShell

protected Shell getShell()

getEditionPane

protected CompareViewerPane getEditionPane()

getStructuredComparePane

protected CompareViewerSwitchingPane getStructuredComparePane()

getContentPane

protected CompareViewerSwitchingPane getContentPane()

getCompareInput

protected ICompareInput getCompareInput(ISelection selection)

setShowContentPanes

public void setShowContentPanes(boolean showContentPanes)
Set whether the file contents panes should be shown. If they are not, only the resource tree will be shown.

Parameters:
showContentPanes - whether to show contents pane

getControl

public Control getControl()
Returns the primary control for this part.

Returns:
the primary control for this part.

getCompareConfiguration

protected CompareConfiguration getCompareConfiguration()

getDirtyViewers

protected ArrayList getDirtyViewers()

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

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