Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Howto: Register Refactoring Support

< To: Tigerstripe_APIs

Some of the annotated objects URI can be changed (for example, annotated resource can be moved to another place and it path used for annotation URI will be changed). To solve this problem, Annotation Framework provide a way to listen this changes, named refactoring support. Refactoring Support class can be registered with the following extension point:

   <extension
           point="org.eclipse.tigerstripe.annotation.core.refactoringSupport">
       <refactoringSupport
           id="org.eclipse.tigerstripe.annotation.java.refactoring"
           class="org.eclipse.tigerstripe.annotation.java.ui.refactoring.JavaRefactoringSupport"/>
   </extension>

Provided class need to implements IRefactoringSupport interface, but clients should extends org.eclipse.tigerstripe.annotation.core.RefactoringSupport class. This class have two methods (fireContainerUpdated() and fireRefactoringPerformed(Map<URI, URI>)) to inform Annotation Framework about changes.

From the Annotation Framework side - refactoring is an operation which map one URI to another. fireContainerUpdated() method should be called every time when annotable objects changed independently can we determine how exactly they changed or not. fireRefactoringPerformed(Map<URI, URI>) should be called every time when some annotable URIs changed to another URIs and pass changes map.

Сomplete example of how refactoring support uses can be found in the org.eclipse.tigerstripe.annotation.java.ui.refactoring plug-in.

Back to the top