Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.team.ui.history
Class HistoryPageCompareEditorInput


java.lang.Object
  extended by 

org.eclipse.compare.CompareEditorInput
      extended by 

org.eclipse.team.ui.PageCompareEditorInput
          extended by 
org.eclipse.team.ui.history.HistoryPageCompareEditorInput
All Implemented Interfaces:
ICompareContainer, IContentChangeListener, IPropertyChangeNotifier, IAdaptable, IRunnableContext, IRunnableWithProgress, IEditorInput

public class HistoryPageCompareEditorInput
extends PageCompareEditorInput

Displays a history page combined with the compare/merge infrastructure. This only works properly if the history page adapts to an IHistoryCompareAdapter.

Since:
3.3

Field Summary
 
Fields inherited from class org.eclipse.compare. CompareEditorInput
DIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGE
 
Constructor Summary
HistoryPageCompareEditorInput ( CompareConfiguration configuration, IHistoryPageSource pageSource, Object object)
          Create a history page compare editor input for the given page and object.
 
Method Summary
protected   ICompareInput asCompareInput ( ISelection selection)
          Return a compare input that represents the selection.
protected   IPage createPage ( CompareViewerPane parent, IToolBarManager toolBarManager)
          Create the page for this part and return the top level control for the page.
  IHistoryPage getHistoryPage ()
          Return the history page for this input or null if the page hasn't been created yet.
  String getOKButtonLabel ()
          Return the label to be used for the OK button when this input is displayed in a dialog.
protected   ISelectionProvider getSelectionProvider ()
          Return the selection provider for the page.
protected  void handleDispose ()
          Callback that occurs when the UI associated with this compare editor input is disposed.
protected  void handlePropertyChange ( PropertyChangeEvent event)
          Handle a property change event from the history page.
 boolean isEditionSelectionDialog ()
          Return whether this input is intended to be used to select a particular edition of an element in a dialog.
protected  boolean isReplaceDialog ()
          Return whether this compare editor input is being used in a replace dialog.
 boolean okPressed ()
          The OK button was pressed in a dialog.
protected  void performReplace ( Object selectedObject)
          A replace has been requested.
protected  void prepareInput ( ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor)
          Prepare the compare input for display in a content viewer.
protected   Object prepareInput ( IProgressMonitor monitor)
          Runs the compare operation and returns the compare result.
 void setReplace (boolean isReplace)
          Set whether this compare editor input is being used in a replace dialog.
 
Methods inherited from class org.eclipse.team.ui. PageCompareEditorInput
canRunAsJob, contentChanged, createStructureInputPane, prepareCompareInput, setPageDescription
 
Methods inherited from class org.eclipse.compare. CompareEditorInput
addCompareInputChangeListener, addPropertyChangeListener, belongsTo, cancelPressed, contentsCreated, contributeToToolBar, createContents, createDiffViewer, createOutlineContents, dispose, exists, findContentViewer, findStructureViewer, firePropertyChange, flushViewers, getActionBars, getAdapter, getCancelButtonLabel, getCompareConfiguration, getCompareResult, getContainer, getContentViewerDescriptor, getImageDescriptor, getMessage, getName, getNavigator, getPersistable, getSelectedEdition, getServiceLocator, getStructureViewerDescriptor, getTitle, getTitleImage, getToolTipText, getWorkbenchPart, isDirty, isSaveNeeded, registerContextMenu, removeCompareInputChangeListener, removePropertyChangeListener, run, run, runAsynchronously, save, saveChanges, setContainer, setContentViewerDescriptor, setDirty, setFocus, setFocus2, setHelpContextId, setMessage, setStatusMessage, setStructureViewerDescriptor, setTitle
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryPageCompareEditorInput

public HistoryPageCompareEditorInput(
CompareConfiguration configuration,
                                     
IHistoryPageSource pageSource,
                                     
Object object)
Create a history page compare editor input for the given page and object.

Parameters:
configuration - the compare configuration
pageSource - the page source
object - the object whose history is to be displayed
Method Detail

prepareInput

protected 
Object prepareInput(
IProgressMonitor monitor)
                       throws 
InvocationTargetException,
                              
InterruptedException
Description copied from class: CompareEditorInput
Runs the compare operation and returns the compare result. If null 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.

Specified by:
prepareInput in class CompareEditorInput
Parameters:
monitor - the progress monitor to use to display progress and receive requests for cancelation
Returns:
the result of the compare operation, or null if there are no differences
Throws:
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
InterruptedException - if the operation detects a request to cancel, using IProgressMonitor.isCanceled(), it should exit by throwing InterruptedException

handleDispose

protected void handleDispose()
Description copied from class: CompareEditorInput
Callback that occurs when the UI associated with this compare editor input is disposed. This method will only be invoked if the UI has been created (i.e. after the call to CompareEditorInput.createContents(Composite). Subclasses can extend this method but ensure that the overridden method is invoked.

Overrides:
handleDispose in class PageCompareEditorInput

createPage

protected 
IPage createPage(
CompareViewerPane parent,
                           
IToolBarManager toolBarManager)
Description copied from class: PageCompareEditorInput
Create the page for this part and return the top level control for the page.

Specified by:
createPage in class PageCompareEditorInput
Parameters:
parent - the parent composite
toolBarManager - the toolbar manager for the page
Returns:
the top-level control for the page

asCompareInput

protected 
ICompareInput asCompareInput(
ISelection selection)
Description copied from class: PageCompareEditorInput
Return a compare input that represents the selection. This input is used to feed the structure and content viewers. By default, a compare input is returned if the selection is of size 1 and the selected element implements ICompareInput. Subclasses may override.

Overrides:
asCompareInput in class PageCompareEditorInput
Parameters:
selection - the selection
Returns:
a compare input representing the selection

getSelectionProvider

protected 
ISelectionProvider getSelectionProvider()
Description copied from class: PageCompareEditorInput
Return the selection provider for the page. This method is called after the page is created in order to register a selection listener on the page.

Specified by:
getSelectionProvider in class PageCompareEditorInput
Returns:
the selection provider for the page

prepareInput

protected void prepareInput(
ICompareInput input,
                            
CompareConfiguration configuration,
                            
IProgressMonitor monitor)
                     throws 
InvocationTargetException
Description copied from class: PageCompareEditorInput
Prepare the compare input for display in a content viewer. This method is called from PageCompareEditorInput.prepareCompareInput(ICompareInput) and may be called from a non-UI thread. This method should not be called by others.

Specified by:
prepareInput in class PageCompareEditorInput
Parameters:
input - the input
configuration - the compare configuration
monitor - a progress monitor
Throws:
InvocationTargetException

getHistoryPage

public final 
IHistoryPage getHistoryPage()
Return the history page for this input or null if the page hasn't been created yet.

Returns:
the history page for this input

handlePropertyChange

protected void handlePropertyChange(
PropertyChangeEvent event)
Handle a property change event from the history page.

Parameters:
event - the change event

isEditionSelectionDialog

public boolean isEditionSelectionDialog()
Description copied from class: CompareEditorInput
Return whether this input is intended to be used to select a particular edition of an element in a dialog. The result of this method is only consider if neither sides of the input are editable. By default, false is returned.

Overrides:
isEditionSelectionDialog in class CompareEditorInput
Returns:
whether this input is intended to be used to select a particular edition of an element in a dialog
See Also:
CompareEditorInput.getOKButtonLabel(), CompareEditorInput.okPressed(), CompareEditorInput.getSelectedEdition()

isReplaceDialog

protected boolean isReplaceDialog()
Return whether this compare editor input is being used in a replace dialog.

Returns:
whether this compare editor input is being used in a replace dialog

setReplace

public void setReplace(boolean isReplace)
Set whether this compare editor input is being used in a replace dialog.

Parameters:
isReplace - whether this compare editor input is being used in a replace dialog

getOKButtonLabel

public 
String getOKButtonLabel()
Description copied from class: CompareEditorInput
Return the label to be used for the OK 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().

Overrides:
getOKButtonLabel in class CompareEditorInput
Returns:
the label to be used for the OK button when this input is displayed in a dialog

okPressed

public boolean okPressed()
Description copied from class: CompareEditorInput
The OK 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.

Overrides:
okPressed in class CompareEditorInput
Returns:
whether the dialog should be closed or not.

performReplace

protected void performReplace(
Object selectedObject)
                       throws 
CoreException
A replace has been requested. This method will be invoked if isReplaceDialog() is true and the user has clicked the "Replace" button. By default, this method does nothing. Subclasses may override.

Parameters:
selectedObject - the selected object
Throws:
CoreException - if an error occurs performing the replace

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire