de.cau.cs.kieler.kex.model.plugin
Class PluginExampleCreator

java.lang.Object
  extended by de.cau.cs.kieler.kex.model.plugin.PluginExampleCreator

public class PluginExampleCreator
extends Object

can be used for creating new extensions for KEX extension point.
So it allows to create new examples or example categories.

Rating red

Constructor Summary
PluginExampleCreator()
           
 
Method Summary
 void addExtension(File location, Example parseElement, List<String> creatableCategories, String absOverviewPic)
          NOTE: parseElement could only be a type of Example or a example category in String representation.
 String copyOverviewPic(String destPath, String sourcePath, List<IPath> finishedResources)
          Copies the preview picture of an example.
 void copyResources(File destFile, List<ExportResource> resources, List<IPath> finishedResources)
          creates example files to given location.
 void deleteExampleResources(List<IPath> resources)
          Deletes resources.
 String makeRelativePath(String projectPath, String absolutePath)
          Makes a absolute path, relative to export project of workspace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginExampleCreator

public PluginExampleCreator()
Method Detail

addExtension

public void addExtension(File location,
                         Example parseElement,
                         List<String> creatableCategories,
                         String absOverviewPic)
                  throws KielerException
NOTE: parseElement could only be a type of Example or a example category in String representation.

Parameters:
location - , File
parseElement - , Example
creatableCategories - , List of Strings
absOverviewPic - , String
Throws:
KielerException - , if duplicatechecks fails or can be thrown by getPluginNode(...).

copyResources

public void copyResources(File destFile,
                          List<ExportResource> resources,
                          List<IPath> finishedResources)
                   throws KielerException
creates example files to given location.

Parameters:
finishedResources - , List of IPath
resources - , List of ExportResource
destFile - , File
Throws:
KielerException - , if copyResource(...) throws it.

deleteExampleResources

public void deleteExampleResources(List<IPath> resources)
Deletes resources.

Parameters:
resources - , List of IPath.

copyOverviewPic

public String copyOverviewPic(String destPath,
                              String sourcePath,
                              List<IPath> finishedResources)
                       throws KielerException
Copies the preview picture of an example.

Parameters:
destPath - String
sourcePath - , String
finishedResources - , List of IPath
Returns:
String
Throws:
KielerException - , if an IOHandler.writeResource throws an exception.

makeRelativePath

public String makeRelativePath(String projectPath,
                               String absolutePath)
Makes a absolute path, relative to export project of workspace.

Parameters:
projectPath - String
absolutePath - String
Returns:
String