Modelers

org.topcased.modeler.tools
Class Importer

java.lang.Object
  extended by org.topcased.modeler.tools.Importer
All Implemented Interfaces:
org.eclipse.jface.operation.IRunnableWithProgress

public class Importer
extends java.lang.Object
implements org.eclipse.jface.operation.IRunnableWithProgress

This class imports existing model objects in the given editpart


Constructor Summary
Importer(Modeler mod, EObject obj)
          Constructor
Importer(Modeler mod, java.util.List objs)
          Constructor
 
Method Summary
protected  org.eclipse.gef.requests.CreateRequest createTargetRequest()
          Create the Request
protected  org.eclipse.gef.commands.Command getCommand()
          Returns the current command from the target EditPart.
protected  org.eclipse.gef.commands.CommandStack getCommandStack()
          The command stack used to execute the final commands
 org.eclipse.gef.requests.CreateRequest getCreateRequest()
          A helper method that casts the target Request to a CreateRequest.
protected  org.eclipse.gef.commands.CommandStack getTemporaryCommandStack()
          Get the temporary CommandStack
 void run(org.eclipse.core.runtime.IProgressMonitor monitor)
          Import the model objects graphically in the diagram
 void setCommandStack(org.eclipse.gef.commands.CommandStack cmdStack)
          Define the command stack to use to execute the commands.
 void setLocation(org.eclipse.draw2d.geometry.Point location)
           
 void setTargetEditPart(org.eclipse.gef.GraphicalEditPart ep)
          Change the current target edit part
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Importer

public Importer(Modeler mod,
                EObject obj)
Constructor


Importer

public Importer(Modeler mod,
                java.util.List objs)
Constructor

Method Detail

getTemporaryCommandStack

protected org.eclipse.gef.commands.CommandStack getTemporaryCommandStack()
Get the temporary CommandStack

Returns:
the temp CommandStack

getCommandStack

protected org.eclipse.gef.commands.CommandStack getCommandStack()
The command stack used to execute the final commands

Returns:
the definitive command stack

setCommandStack

public void setCommandStack(org.eclipse.gef.commands.CommandStack cmdStack)
Define the command stack to use to execute the commands. The default command stack is the command stack from the modeler. Users can change this default value if they want to use an other one.

Parameters:
cmdStack - The commandStack to set.

run

public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
         throws BoundsFormatException,
                java.lang.IllegalArgumentException,
                java.lang.InterruptedException
Import the model objects graphically in the diagram

Specified by:
run in interface org.eclipse.jface.operation.IRunnableWithProgress
Throws:
BoundsFormatException
java.lang.IllegalArgumentException
java.lang.InterruptedException
See Also:
IRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor)

getCommand

protected org.eclipse.gef.commands.Command getCommand()
Returns the current command from the target EditPart.

Returns:
The current command from the target EditPart

getCreateRequest

public org.eclipse.gef.requests.CreateRequest getCreateRequest()
A helper method that casts the target Request to a CreateRequest.

Returns:
CreateRequest

createTargetRequest

protected org.eclipse.gef.requests.CreateRequest createTargetRequest()
Create the Request


setLocation

public void setLocation(org.eclipse.draw2d.geometry.Point location)

setTargetEditPart

public void setTargetEditPart(org.eclipse.gef.GraphicalEditPart ep)
Change the current target edit part

Parameters:
ep - the target edit part

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.