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

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.synchronize
Class SyncInfoCompareInput

java.lang.Object
  extended by 

org.eclipse.compare.CompareEditorInput
      extended by 

org.eclipse.team.ui.synchronize.SaveableCompareEditorInput
          extended by 
org.eclipse.team.ui.synchronize.SyncInfoCompareInput
All Implemented Interfaces:
EventListener, ICompareContainer, IPropertyChangeNotifier, IResourceChangeListener, IAdaptable, IRunnableContext, IRunnableWithProgress, IEditorInput, ISaveablesSource

public final class SyncInfoCompareInput
extends SaveableCompareEditorInput
implements IResourceChangeListener

A SyncInfo editor input used as input to a two-way or three-way compare viewer. It defines methods for accessing the three sides for the compare, and a name and image which is used when displaying the three way input in an editor. This input can alternately be used to show compare results in a dialog by calling CompareUI.openCompareDialog(org.eclipse.compare.CompareEditorInput).

The editor will not update when the elements in the sync info are changed.

Supports saving the local resource that is changed in the editor and will be updated when the local resources is changed.

Since:
3.0
See Also:
SyncInfo
Restriction:
This class cannot be subclassed by clients.

Field Summary
 
Fields inherited from class org.eclipse.compare. CompareEditorInput
DIRTY_STATE, PROP_SELECTED_EDITION, PROP_TITLE, PROP_TITLE_IMAGE
 
Constructor Summary
SyncInfoCompareInput ( ISynchronizePageConfiguration configuration, SyncInfo info)
           
SyncInfoCompareInput ( ISynchronizeParticipant participant, SyncInfo sync)
          Creates a compare editor input based on an existing SyncInfo from the given participant.
SyncInfoCompareInput ( String description, SyncInfo sync)
          Creates a compare editor input based on an existing SyncInfo.
 
Method Summary
 boolean canRunAsJob ()
          Return whether this compare editor input can be run as a job.
 boolean equals ( Object other)
           
protected  void fireInputChange ()
          Callback from the resource saveable that is invoked when the resource is saved so that this input can fire a change event for its input.
  Object getAdapter ( Class adapter)
          Returns an object which is an instance of the given class associated with this object.
  ICompareNavigator getNavigator ()
          Return the ICompareNavigator associated with this container or null if the container does not have a global navigator.
  SyncInfo getSyncInfo ()
           
  String getToolTipText ()
          Returns the tool tip text for this editor input.
protected  void handleDispose ()
          Callback that occurs when the UI associated with this compare editor input is disposed.
protected   ICompareInput prepareCompareInput ( IProgressMonitor monitor)
          Method called from SaveableCompareEditorInput.prepareInput(IProgressMonitor) to obtain the input.
 void resourceChanged ( IResourceChangeEvent event)
          Note that until the compare editor inputs can be part of the compare editors lifecycle we can't register as a listener because there is no dispose() method to remove the listener.
 
Methods inherited from class org.eclipse.team.ui.synchronize. SaveableCompareEditorInput
addCompareInputChangeListener, closeEditor, contentsCreated, createFileElement, createSaveable, findContentViewer, getActiveSaveables, getCompareInput, getImageDescriptor, getSaveable, getSaveables, getTitleImage, isDirty, prepareInput, registerContextMenu, removeCompareInputChangeListener
 
Methods inherited from class org.eclipse.compare. CompareEditorInput
addPropertyChangeListener, belongsTo, cancelPressed, contributeToToolBar, createContents, createDiffViewer, createOutlineContents, createStructureInputPane, dispose, exists, findStructureViewer, firePropertyChange, flushViewers, getActionBars, getCancelButtonLabel, getCompareConfiguration, getCompareResult, getContainer, getContentViewerDescriptor, getMessage, getName, getOKButtonLabel, getPersistable, getSelectedEdition, getServiceLocator, getStructureViewerDescriptor, getTitle, getWorkbenchPart, isEditionSelectionDialog, isSaveNeeded, okPressed, removePropertyChangeListener, run, run, runAsynchronously, save, saveChanges, setContainer, setContentViewerDescriptor, setDirty, setFocus, setFocus2, setHelpContextId, setMessage, setStatusMessage, setStructureViewerDescriptor, setTitle
 
Methods inherited from class java.lang. Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncInfoCompareInput

public SyncInfoCompareInput(
String description,
                            
SyncInfo sync)
Creates a compare editor input based on an existing SyncInfo.

Parameters:
description - a description of the context of this sync info. This is displayed to the user.
sync - the SyncInfo used as the base for the compare input.

SyncInfoCompareInput

public SyncInfoCompareInput(
ISynchronizeParticipant participant,
                            
SyncInfo sync)
Creates a compare editor input based on an existing SyncInfo from the given participant.

Parameters:
participant - the participant from which the sync info was obtained. The name of the participant is used as the description which is displayed to the user.
sync - the SyncInfo used as the base for the compare input.
Since:
3.1

SyncInfoCompareInput

public SyncInfoCompareInput(
ISynchronizePageConfiguration configuration,
                            
SyncInfo info)
Method Detail

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 SaveableCompareEditorInput

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
Overrides:
getAdapter in class SaveableCompareEditorInput
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

resourceChanged

public void resourceChanged(
IResourceChangeEvent event)
Note that until the compare editor inputs can be part of the compare editors lifecycle we can't register as a listener because there is no dispose() method to remove the listener.

Specified by:
resourceChanged in interface IResourceChangeListener
Parameters:
event - the resource change event
See Also:
IResourceDelta

prepareCompareInput

protected 
ICompareInput prepareCompareInput(
IProgressMonitor monitor)
                                     throws 
InvocationTargetException,
                                            
InterruptedException
Description copied from class: SaveableCompareEditorInput
Method called from SaveableCompareEditorInput.prepareInput(IProgressMonitor) to obtain the input. It's purpose is to ensure that the input is an instance of ICompareInput.

Specified by:
prepareCompareInput in class SaveableCompareEditorInput
Parameters:
monitor - a progress monitor
Returns:
the compare input
Throws:
InvocationTargetException
InterruptedException

getToolTipText

public 
String getToolTipText()
Description copied from interface: IEditorInput
Returns the tool tip text for this editor input. This text is used to differentiate between two input with the same name. For instance, MyClass.java in folder X and MyClass.java in folder Y. The format of the text varies between input types.

Specified by:
getToolTipText in interface IEditorInput
Overrides:
getToolTipText in class CompareEditorInput
Returns:
the tool tip text; never null.

equals

public boolean equals(
Object other)
Overrides:
equals in class Object

getSyncInfo

public 
SyncInfo getSyncInfo()

canRunAsJob

public boolean canRunAsJob()
Description copied from class: CompareEditorInput
Return whether this compare editor input can be run as a job. By default, false is returned since traditionally inputs were prepared in the foreground (i.e the UI was blocked when the CompareEditorInput.run(IProgressMonitor) method (and indirectly the CompareEditorInput.prepareInput(IProgressMonitor) method) was invoked. Subclasses may override.

Overrides:
canRunAsJob in class SaveableCompareEditorInput
Returns:
whether this compare editor input can be run in the background

getNavigator

public 
ICompareNavigator getNavigator()
Description copied from interface: ICompareContainer
Return the ICompareNavigator associated with this container or null if the container does not have a global navigator.

Specified by:
getNavigator in interface ICompareContainer
Overrides:
getNavigator in class CompareEditorInput
Returns:
the ICompareNavigator associated with this container or null

fireInputChange

protected void fireInputChange()
Description copied from class: SaveableCompareEditorInput
Callback from the resource saveable that is invoked when the resource is saved so that this input can fire a change event for its input. Subclasses only need this method if the left side of their compare input is an element returned from SaveableCompareEditorInput.createFileElement(IFile).

Specified by:
fireInputChange in class SaveableCompareEditorInput

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