org.jupe.synchronisation.sourcechanges.java
Class FileHandler

java.lang.Object
  extended by org.jupe.synchronisation.sourcechanges.java.AbstractHandler
      extended by org.jupe.synchronisation.sourcechanges.java.FileHandler
All Implemented Interfaces:
IChangeHandler

public class FileHandler
extends AbstractHandler
implements IChangeHandler

This handles is used to react to changes in classes. If called, there can be several changes in a class!

Author:
Michael Pradel, Eva Zielasko, Emanuel Thomas

Constructor Summary
FileHandler(JupeProject jupeProject)
           
 
Method Summary
 java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.core.resources.IResource resource)
          Calls IChangeHandler.add(IResource, boolean) with forceCreate set to true.
 java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.core.resources.IResource resource, boolean forceCreate)
          This method is called when a resource is added and propagates the element to the UML Model.
 java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.jdt.core.IType type, boolean forceCreate)
           
 java.util.List<org.eclipse.uml2.uml.Element> add(java.lang.String absoluteName)
          Propagates a given Element from source to UML level.
 void change(org.eclipse.core.resources.IResource resource)
          When a resource has changed this method is called.
 void remove(org.eclipse.core.resources.IResource resource)
          When a resource is removed this method is called.
 void rename(org.eclipse.core.resources.IResource resource, org.eclipse.core.runtime.IPath oldPath)
          When a resource has been renamed this method is called.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler(JupeProject jupeProject)
Method Detail

add

public java.util.List<org.eclipse.uml2.uml.Element> add(java.lang.String absoluteName)
Description copied from interface: IChangeHandler
Propagates a given Element from source to UML level. It's presumed that the type exists in the source.

Specified by:
add in interface IChangeHandler
Parameters:
absoluteName - absolute name of the element
Returns:
a list of UML2 elements which habe been altered

add

public java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.jdt.core.IType type,
                                                        boolean forceCreate)

add

public java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.core.resources.IResource resource,
                                                        boolean forceCreate)
Description copied from interface: IChangeHandler
This method is called when a resource is added and propagates the element to the UML Model.

Specified by:
add in interface IChangeHandler
Parameters:
resource - The resource to add, should be an IFile.
forceCreate - True, if it's sure that this isn't already in the model, false otherwise.
Returns:
A collection of the added UML2 elements. See IChangeHandler.add(IResource).

remove

public void remove(org.eclipse.core.resources.IResource resource)
Description copied from interface: IChangeHandler
When a resource is removed this method is called.

Specified by:
remove in interface IChangeHandler

change

public void change(org.eclipse.core.resources.IResource resource)
Description copied from interface: IChangeHandler
When a resource has changed this method is called. Attention: Renaming will call #rename().

Specified by:
change in interface IChangeHandler

rename

public void rename(org.eclipse.core.resources.IResource resource,
                   org.eclipse.core.runtime.IPath oldPath)
Description copied from interface: IChangeHandler
When a resource has been renamed this method is called.

Specified by:
rename in interface IChangeHandler

add

public java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.core.resources.IResource resource)
Description copied from interface: IChangeHandler
Calls IChangeHandler.add(IResource, boolean) with forceCreate set to true.

Specified by:
add in interface IChangeHandler
Returns:
A collection of the UML2 elements that correspond to the resource. Either they have been added to the model in this method, to they've already been in it before. The order of the elements should be in a way that parent elements are before their children.