public abstract class PageSaveablePart extends SaveablePartAdapter implements IContentChangeListener
This class is not intended to be subclassed by clients outside of the Team framework.
PROP_DIRTYPROP_TITLE| Modifier | Constructor and Description |
|---|---|
protected |
PageSaveablePart(Shell shell,
CompareConfiguration compareConfiguration)
Create a saveable part.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Control |
createPage(Composite parent,
ToolBarManager toolBarManager)
Create the page for this part and return the top level control
for the page.
|
void |
createPartControl(Composite parent)
Creates the SWT controls for this workbench part.
|
void |
doSave(IProgressMonitor monitor)
This method flushes the content in any viewers.
|
protected ICompareInput |
getCompareInput(ISelection selection)
Return a compare input that represents the selection.
|
Control |
getControl()
Returns the primary control for this part.
|
protected abstract ISelectionProvider |
getSelectionProvider()
Return the selection provider for the page.
|
protected Shell |
getShell()
Return the parent shell of this part.
|
boolean |
isDirty()
Returns whether the contents of this part have changed since the last save
operation.
|
protected void |
prepareCompareInput(ICompareInput input)
Convenience method that calls
prepareInput(ICompareInput, CompareConfiguration, IProgressMonitor)
with a progress monitor. |
protected abstract void |
prepareInput(ICompareInput input,
CompareConfiguration configuration,
IProgressMonitor monitor)
Prepare the compare input for display in a content viewer.
|
protected void |
setDirty(boolean dirty)
Set the saveable part's dirty state to the given state.
|
protected void |
setNavigator(ISynchronizePageConfiguration configuration)
This method is internal to the framework and should not be called by clients
outside of the framework.
|
protected void |
setPageDescription(String title)
Set the title of the page's page to the given text.
|
void |
setShowContentPanes(boolean showContentPanes)
Set whether the file contents panes should be shown.
|
addPropertyListener, dispose, doSaveAs, getAdapter, getSite, getTitleToolTip, isSaveAsAllowed, isSaveOnCloseNeeded, removePropertyListener, setFocusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontentChangedgetTitle, getTitleImageprotected PageSaveablePart(Shell shell, CompareConfiguration compareConfiguration)
shell - the shell for the partcompareConfiguration - the compare econfigurationpublic boolean isDirty()
ISaveablePartPROP_DIRTY.
Note: this method is called often on a part open or part activation switch, for example by actions to determine their enabled status.
isDirty in interface ISaveableParttrue if the contents have been modified and need
saving, and false if they have not changed since the last
savepublic void createPartControl(Composite parent)
IWorkbenchPartClients 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:
IActionBars.ISelectionService (optional). createPartControl in interface IWorkbenchPartparent - the parent controlprotected abstract ISelectionProvider getSelectionProvider()
protected abstract Control createPage(Composite parent, ToolBarManager toolBarManager)
parent - the parent compositetoolBarManager - the toolbar manager for the pageprotected void setPageDescription(String title)
title - the page's titleprotected void setDirty(boolean dirty)
dirty - the dirty stateprotected void prepareCompareInput(ICompareInput input)
prepareInput(ICompareInput, CompareConfiguration, IProgressMonitor)
with a progress monitor.input - the compare input to be preparedprotected abstract void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor) throws InvocationTargetException
prepareCompareInput(ICompareInput) and may be called
from a non-UI thread. This method should not be called by others.input - the inputconfiguration - the compare configurationmonitor - a progress monitorInvocationTargetExceptionprotected Shell getShell()
protected void setNavigator(ISynchronizePageConfiguration configuration)
protected ICompareInput getCompareInput(ISelection selection)
ICompareInput.
Subclasses may override.selection - the selectionpublic void setShowContentPanes(boolean showContentPanes)
showContentPanes - whether to show contents panepublic Control getControl()
public void doSave(IProgressMonitor monitor)
doSave in interface ISaveablePartmonitor - a progress monitorGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.