de.cau.cs.kieler.kaom.importer.ptolemy
Class DiagramsImporter

java.lang.Object
  extended by de.cau.cs.kieler.kaom.importer.ptolemy.DiagramsImporter
All Implemented Interfaces:
IRunnableWithProgress

public class DiagramsImporter
extends Object
implements IRunnableWithProgress

An importer for Ptolemy2 diagrams. Usually invoked by the import wizard. Designed to only run once and be destroyed.

Rating yellow
2010-03-14 reviewed by haf, msp, pkl

Constructor Summary
DiagramsImporter(ImportDiagramsWizard wizard, List<File> sourceFiles, IPath targetContainerPath, boolean initializeDiagramFiles, boolean overwriteWithoutWarning)
          Constructs a new instance with the given configuration.
 
Method Summary
 IStatus getStatus()
          Returns an IStatus object describing the outcome of the import.
 boolean isImportCanceled()
          Checks whether the user canceled the import or not.
 boolean isImportSuccessful()
          Checks whether or not the import was successful.
 void run(IProgressMonitor monitor)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagramsImporter

public DiagramsImporter(ImportDiagramsWizard wizard,
                        List<File> sourceFiles,
                        IPath targetContainerPath,
                        boolean initializeDiagramFiles,
                        boolean overwriteWithoutWarning)
Constructs a new instance with the given configuration.

Parameters:
wizard - the wizard using this importer.
sourceFiles - the list of source files to import.
targetContainerPath - the possibly non-existent container to import them to.
initializeDiagramFiles - whether to initialize KAOD diagram files.
overwriteWithoutWarning - whether existing files should be overwritten without warning.
Method Detail

isImportSuccessful

public boolean isImportSuccessful()
Checks whether or not the import was successful. The import was successful if it completed and no exceptions occurred. If the import was not successful, use isImportCanceled() and getException() to find out whether the user canceled the operation or an exception occurred, respectively.

Returns:
true if an uninterrupted import was successful.

isImportCanceled

public boolean isImportCanceled()
Checks whether the user canceled the import or not.

Returns:
true if the user canceled the import.

getStatus

public IStatus getStatus()
Returns an IStatus object describing the outcome of the import. This may be either a single status object if everything went fine, or a multi status that contains a list of error statusses.

Returns:
the status.

run

public void run(IProgressMonitor monitor)
         throws InvocationTargetException,
                InterruptedException

Specified by:
run in interface IRunnableWithProgress
Throws:
InvocationTargetException
InterruptedException