org.jupe.synchronisation.sourcechanges.java
Class FolderHandler

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

public class FolderHandler
extends AbstractHandler
implements IChangeHandler

This handles is used to react to changes in packages. Remark: Only one call for multiple remove events possible: When a package is deleted, there will be no call for the files and subpackages in this package.

Author:
Michael Pradel, Eva Zielasko, Emanuel Thomas

Constructor Summary
FolderHandler(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 forceToCreate)
          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(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

FolderHandler

public FolderHandler(JupeProject jupeProject)
Method Detail

add

public java.util.List<org.eclipse.uml2.uml.Element> add(org.eclipse.core.resources.IResource resource,
                                                        boolean forceToCreate)
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.
forceToCreate - 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).

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

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.