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(Node extensionKEX, File location, Example parseElement, List<Category> creatableCategories, String absOverviewPic)
          NOTE: parseElement could only be a type of Example or a example category in String representation.
 void checkDuplicate(Node extensionKEX, String exampleId, List<Category> creatableCategories)
          Searches in a given file with node extensionKEX for duplicates.
 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.
 Node filterExtensionKEX(Node pluginNode)
           
 Node getPluginNode()
           
 String makeRelativePath(String projectPath, String absolutePath)
          Makes a absolute path, relative to export project of workspace.
 void setPluginXML(File pluginXML)
          setter for the pluginXML.
 
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(Node extensionKEX,
                         File location,
                         Example parseElement,
                         List<Category> creatableCategories,
                         String absOverviewPic)
NOTE: parseElement could only be a type of Example or a example category in String representation.

Parameters:
extensionKEX - , plugin.xml KEX-extension root.
location - , File
parseElement - , Example
creatableCategories - , List of Strings
absOverviewPic - , String

checkDuplicate

public void checkDuplicate(Node extensionKEX,
                           String exampleId,
                           List<Category> creatableCategories)
Searches in a given file with node extensionKEX for duplicates. The exampleIds of the file examples must not match with the id of the exporting one, for exporting new categories count the same.

Parameters:
extensionKEX - , the KEX-extension node of a plugin.xml file.
exampleId - , the id of the exporting example.
creatableCategories - , a list of categories to create

getPluginNode

public Node getPluginNode()

filterExtensionKEX

public Node filterExtensionKEX(Node pluginNode)

copyResources

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

Parameters:
finishedResources - , List of IPath
resources - , List of ExportResource
destFile - , File

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)
Copies the preview picture of an example.

Parameters:
destPath - String
sourcePath - , String
finishedResources - , List of IPath
Returns:
String

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

setPluginXML

public void setPluginXML(File pluginXML)
setter for the pluginXML.

Parameters:
pluginXML -