|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.compare.CompareEditorInput
org.eclipse.team.ui.PageCompareEditorInput
org.eclipse.team.ui.synchronize.ParticipantPageCompareEditorInput
public class ParticipantPageCompareEditorInput
Displays a synchronize participant page combined with the compare/merge infrastructure. This only works if the
synchronize page viewer provides selections that are of the following types: ITypedElement and ICompareInput
or if the participant is a ModelSynchronizeParticipant.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.compare.CompareEditorInput |
|---|
DIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGE |
| Constructor Summary | |
|---|---|
ParticipantPageCompareEditorInput(CompareConfiguration configuration,
ISynchronizePageConfiguration pageConfiguration,
ISynchronizeParticipant participant)
Creates a part for the provided participant. |
|
| Method Summary | |
|---|---|
protected ICompareInput |
asCompareInput(ISelection selection)
Return a compare input that represents the selection. |
void |
cancelPressed()
The CANCEL button was pressed in a dialog. |
void |
contentChanged(IContentChangeNotifier source)
Called whenever the content of the given source has changed. |
Control |
createContents(Composite parent)
Create the SWT controls that are used to display the result of the compare operation. |
protected IPage |
createPage(CompareViewerPane parent,
IToolBarManager toolBarManager)
Create the page for this part and return the top level control for the page. |
java.lang.String |
getCancelButtonLabel()
Return the label used for the CANCEL
button when this input is shown in a compare dialog
using CompareUI.openCompareDialog(CompareEditorInput). |
java.lang.String |
getOKButtonLabel()
Return the label to be used for the OK
button when this input is displayed in a dialog. |
ISynchronizePageConfiguration |
getPageConfiguration()
Return the synchronize page configuration for this part |
ISynchronizeParticipant |
getParticipant()
Return the Synchronize participant for this part |
protected ISelectionProvider |
getSelectionProvider()
Return the selection provider for the page. |
Image |
getTitleImage()
Returns the title image which will be used in the compare editor's title bar. |
protected void |
handleDispose()
Callback that occurs when the UI associated with this compare editor input is disposed. |
protected boolean |
isOfferToRememberParticipant()
Return whether the ability to remember the participant in the synchronize view should be presented to the user. |
boolean |
isSaveNeeded()
Returns true if there are unsaved changes. |
boolean |
okPressed()
The OK button was pressed in a dialog. |
protected void |
prepareInput(ICompareInput input,
CompareConfiguration configuration,
IProgressMonitor monitor)
Prepare the compare input for display in a content viewer. |
protected java.lang.Object |
prepareInput(IProgressMonitor monitor)
Runs the compare operation and returns the compare result. |
void |
saveChanges(IProgressMonitor monitor)
Save any unsaved changes. |
| Methods inherited from class org.eclipse.team.ui.PageCompareEditorInput |
|---|
canRunAsJob, createStructureInputPane, prepareCompareInput, setPageDescription |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParticipantPageCompareEditorInput(CompareConfiguration configuration,
ISynchronizePageConfiguration pageConfiguration,
ISynchronizeParticipant participant)
For example, clients can decide if the user can edit the compare panes by calling CompareConfiguration.setLeftEditable(boolean)
or CompareConfiguration.setRightEditable(boolean).
configuration - the compare configuration that will be used to create the compare panespageConfiguration - the configuration that will be provided to the participant prior to creating the pageparticipant - the participant whose page will be displayed in this part| Method Detail |
|---|
protected java.lang.Object prepareInput(IProgressMonitor monitor)
throws java.lang.reflect.InvocationTargetException,
java.lang.InterruptedException
CompareEditorInputnull is returned no differences were found and no compare editor needs to be opened.
Progress should be reported to the given progress monitor.
A request to cancel the operation should be honored and acknowledged
by throwing InterruptedException.
Note: this method is typically called in a modal context thread which doesn't have a Display assigned. Implementors of this method shouldn't therefore allocated any SWT resources in this method.
prepareInput in class CompareEditorInputmonitor - the progress monitor to use to display progress and receive
requests for cancelation
null if there are no differences
java.lang.reflect.InvocationTargetException - if the prepareInput method must propagate a checked exception,
it should wrap it inside an InvocationTargetException; runtime exceptions are automatically
wrapped in an InvocationTargetException by the calling context
java.lang.InterruptedException - if the operation detects a request to cancel,
using IProgressMonitor.isCanceled(), it should exit by throwing
InterruptedExceptionpublic Image getTitleImage()
CompareEditorInput
getTitleImage in class CompareEditorInputnull if noneprotected void handleDispose()
CompareEditorInputCompareEditorInput.createContents(Composite).
Subclasses can extend this method but ensure that the overridden method
is invoked.
handleDispose in class PageCompareEditorInput
protected IPage createPage(CompareViewerPane parent,
IToolBarManager toolBarManager)
PageCompareEditorInput
createPage in class PageCompareEditorInputparent - the parent compositetoolBarManager - the toolbar manager for the page
protected ISelectionProvider getSelectionProvider()
PageCompareEditorInput
getSelectionProvider in class PageCompareEditorInputprotected ICompareInput asCompareInput(ISelection selection)
PageCompareEditorInputICompareInput.
Subclasses may override.
asCompareInput in class PageCompareEditorInputselection - the selection
protected void prepareInput(ICompareInput input,
CompareConfiguration configuration,
IProgressMonitor monitor)
throws java.lang.reflect.InvocationTargetException
PageCompareEditorInputPageCompareEditorInput.prepareCompareInput(ICompareInput) and may be called
from a non-UI thread. This method should not be called by others.
prepareInput in class PageCompareEditorInputinput - the inputconfiguration - the compare configurationmonitor - a progress monitor
java.lang.reflect.InvocationTargetExceptionpublic boolean isSaveNeeded()
CompareEditorInputtrue if there are unsaved changes.
The value returned is the value of the DIRTY_STATE property of this input object.
Returns true if this input has unsaved changes,
that is if setDirty(true) has been called.
Subclasses don't have to override if the functionality provided by setDirty
is sufficient.
isSaveNeeded in class CompareEditorInputtrue if there are changes that need to be saved
public void saveChanges(IProgressMonitor monitor)
throws CoreException
CompareEditorInputISavable.save on them.
saveChanges in class CompareEditorInputmonitor - an IProgressMonitor that the implementation of save may use to show progress
CoreExceptionpublic void contentChanged(IContentChangeNotifier source)
IContentChangeListener
contentChanged in interface IContentChangeListenercontentChanged in class PageCompareEditorInputsource - the source whose contents has changedpublic ISynchronizePageConfiguration getPageConfiguration()
public ISynchronizeParticipant getParticipant()
public Control createContents(Composite parent)
CompareEditorInputSubclasses may override if they need to change the layout or wiring between panes.
createContents in class CompareEditorInputparent - the parent control under which the control must be created
protected boolean isOfferToRememberParticipant()
true is
returned. Subclasses may override.
public boolean okPressed()
CompareEditorInputOK button was pressed in a dialog. If one or both of
the sides of the input is editable then any changes will be saved. If the
input is for edition selection (see CompareEditorInput.isEditionSelectionDialog()),
it is up to subclasses to override this method in order to perform the
appropriate operation on the selected edition.
okPressed in class CompareEditorInputpublic void cancelPressed()
CompareEditorInputCANCEL button was pressed in a dialog.
By default, nothing is done. Subclasses may override.
cancelPressed in class CompareEditorInputpublic java.lang.String getOKButtonLabel()
CompareEditorInputOK
button when this input is displayed in a dialog.
By default, different labels are used depending on
whether the input is editable or is for edition selection
(see CompareEditorInput.isEditionSelectionDialog().
getOKButtonLabel in class CompareEditorInputOK
button when this input is displayed in a dialogpublic java.lang.String getCancelButtonLabel()
CompareEditorInputCANCEL
button when this input is shown in a compare dialog
using CompareUI.openCompareDialog(CompareEditorInput).
getCancelButtonLabel in class CompareEditorInputCANCEL button
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.