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 RevisionAnnotationController


java.lang.Object
  extended by 
org.eclipse.team.ui.history.RevisionAnnotationController

public abstract class RevisionAnnotationController
extends Object

Helper class that coordinates the selection behavior between an editor revision ruler and a history list such as one shown in the history view. In other words, the selection in the history list will be reflected in the revision rule and vice versa.

Since:
3.3
See Also:
Revision, RevisionInformation

Constructor Summary
RevisionAnnotationController ( IWorkbenchPage page, IFile file, ISelectionProvider historyList)
          Create a controller that links an editor on a local file to a history list.
RevisionAnnotationController ( IWorkbenchPage page, IStorageEditorInput editorInput, ISelectionProvider historyList)
          Create a controller that links an editor input on a remote file to a history list.
 
Method Summary
 void dispose ()
          Dispose of the controller.
protected abstract   Object getHistoryEntry ( Revision selected)
          Return the history list entry corresponding to the provided revision.
protected   String getRevisionId ( Object historyEntry)
          Return the revision id associated with the given history list entry.
static  AbstractDecoratedTextEditor openEditor ( IWorkbenchPage page, IFile file)
          Open a text editor that supports the use of a revision ruler on the given file.
static  AbstractDecoratedTextEditor openEditor ( IWorkbenchPage page, Object fileRevision, IStorage storage)
          Open a text editor that supports the use of a revision ruler on the given file.
protected  void revisionSelected ( Revision selected)
          Callback from the ruler when a particular revision has been selected by the user.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RevisionAnnotationController

public RevisionAnnotationController(
IWorkbenchPage page,
                                    
IFile file,
                                    
ISelectionProvider historyList)
Create a controller that links an editor on a local file to a history list.

Parameters:
page - the workbench page
file - the local file
historyList - the history list selection provider

RevisionAnnotationController

public RevisionAnnotationController(
IWorkbenchPage page,
                                    
IStorageEditorInput editorInput,
                                    
ISelectionProvider historyList)
Create a controller that links an editor input on a remote file to a history list.

Parameters:
page - the workbench page
editorInput - the editor input for the remote file
historyList - the history list selection provider
Method Detail

openEditor

public static 
AbstractDecoratedTextEditor openEditor(
IWorkbenchPage page,
                                                     
IFile file)
                                              throws 
PartInitException
Open a text editor that supports the use of a revision ruler on the given file. If an appropriate editor is already open, it is returned. Otherwise a new editor is opened.

Parameters:
page - the page in which the editor is to be opened
file - the file to be edited
Returns:
the open editor on the file
Throws:
PartInitException

openEditor

public static 
AbstractDecoratedTextEditor openEditor(
IWorkbenchPage page,
                                                     
Object fileRevision,
                                                     
IStorage storage)
                                              throws 
PartInitException
Open a text editor that supports the use of a revision ruler on the given file. If an appropriate editor is already open, it is returned. Otherwise a new editor is opened.

Parameters:
page - the page in which the editor is to be opened
fileRevision - the file revision object
storage - the storage that provides access to the contents of the file revision
Returns:
the open editor on the file revision
Throws:
PartInitException

dispose

public void dispose()
Dispose of the controller.


revisionSelected

protected void revisionSelected(
Revision selected)
Callback from the ruler when a particular revision has been selected by the user. By default, this method will set the selection of the history list selection provider that was passed in the constructor using the history entry returned by getHistoryEntry(Revision). Subclasses may override.

Parameters:
selected - the selected revision

getHistoryEntry

protected abstract 
Object getHistoryEntry(
Revision selected)
Return the history list entry corresponding to the provided revision. THis method is called by the revisionSelected(Revision) method in order to determine what the selection of the history list selection provider should be set to.

Parameters:
selected - the selected revision.
Returns:
the history list entry that corresponds to the provided revision.

getRevisionId

protected 
String getRevisionId(
Object historyEntry)
Return the revision id associated with the given history list entry. This method is used to determine which revision in the revision ruler should be highlighted when the history list selection provider fires a selection changed event. By default, this method tries to adapt the entry to either IFileRevision or IResourceVariant in order to obtain the content identifier. Subclasses may override.

Parameters:
historyEntry - the history list entry
Returns:
the id of the entry

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