de.cau.cs.kieler.kex.controller.util
Class ExampleImport

java.lang.Object
  extended by de.cau.cs.kieler.kex.controller.util.ExampleImport

public final class ExampleImport
extends Object

Contains all Elements for an import of examples.

Rating red

Method Summary
static InputStream getEmptyPic()
          Loads the empty picture, often called when no example image exists.
static List<String> importExample(IPath destination, Example example, boolean checkDuplicate)
          Imports an example.
static List<String> importExamples(IPath destination, List<Example> examples, boolean checkDuplicate)
          Imports a list of examples.
static void validate(IPath selectedResource, List<Example> selectedExamples, boolean checkDuplicate)
          validates the selected examples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

importExamples

public static List<String> importExamples(IPath destination,
                                          List<Example> examples,
                                          boolean checkDuplicate)
                                   throws Exception
Imports a list of examples.

Parameters:
destination - , destination resource of type IPath.
examples - , List of Examples to import.
checkDuplicate - , flag for checking example duplication in project.
Returns:
directopens, List of String.
Throws:
Exception

importExample

public static List<String> importExample(IPath destination,
                                         Example example,
                                         boolean checkDuplicate)
                                  throws Exception
Imports an example.

Parameters:
destination - where to import the example to.
example - the example to import.
checkDuplicate - flag for checking example duplication in project.
Returns:
list of resources to open.
Throws:
Exception - if anything goes wrong.

getEmptyPic

public static InputStream getEmptyPic()
Loads the empty picture, often called when no example image exists.

Returns:
InputStream

validate

public static void validate(IPath selectedResource,
                            List<Example> selectedExamples,
                            boolean checkDuplicate)
validates the selected examples.

Parameters:
selectedResource - , IPath
selectedExamples - , List of Example
checkDuplicate - , boolean