Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Howto: Register Refactoring Support"

Line 11: Line 11:
 
     </extension>
 
     </extension>
  
Provided class need to implements IRefactoringSupport interface (Clients may also extends org.eclipse.tigerstripe.annotation.core.RefactoringSupport class):
+
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.
  
  public interface IRefactoringSupport {
+
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.
      public void addRefactoringListener(IRefactoringListener listener);
+
      public void removeRefactoringListener(IRefactoringListener listener);
+
  }
+
 
+
This interface provide a simple way to register and unregister refactoring listeners:
+
 
+
  public interface IRefactoringListener {
+
      public void containerUpdated();
+
      public void refactoringPerformed(Map<URI, URI> changes);
+
  }
+
 
+
containerUpdated() method should be called every time when annotable objects changed independently can we determine how exactly they changed or not.
+
 
+
From the Annotation Framework side - refactoring is an operation which map one URI to another. refactoringPerformed(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.   
 
Сomplete example of how refactoring support uses can be found in the org.eclipse.tigerstripe.annotation.java.ui.refactoring plug-in.   
  
 
[[Category:Tigerstripe_APIs]]
 
[[Category:Tigerstripe_APIs]]

Revision as of 00:02, 2 June 2008

< 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