4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.51 $ |
* @version $Revision: 1.52 $ |
* |
* Last modification: $Date: 2003/07/22 16:14:23 $ |
* $Id: PluginManager.java,v 1.51 2003/07/22 16:14:23 swalkenh Exp $ |
* Last modification: $Date: 2003/07/23 13:12:42 $ |
* $Id: PluginManager.java,v 1.52 2003/07/23 13:12:42 swalkenh Exp $ |
*/ |
|
package src.plugins; |
56,7 → 56,7 |
* |
* @author Sascha Walkenhorst |
* |
* @version $Revision: 1.51 $ Last modification: $Date: 2003/07/22 16:14:23 $ |
* @version $Revision: 1.52 $ Last modification: $Date: 2003/07/23 13:12:42 $ |
*/ |
public class PluginManager implements TreeSelectionListener, |
PluginManagerInterface, |
1184,7 → 1184,6 |
private void switchToAndFroDefaultPlugin() { |
//testing output |
System.out.println("PluginManager - method \"switchToAndFroDefaultPlugin()\" running..."); |
// return; |
|
/* get name of actual plugin for actual document */ |
String actualDocumentName = documentManagerInterface.getActualDocumentName(); |
1199,8 → 1198,8 |
/* get the TreePath for node, transferred from stopped active plugin, |
* needed by new started plugin */ |
TreePath tp = updateViewInterface.getActualSelectedPath(); |
|
System.out.println(tp); |
//testing output |
System.out.println("TreePath of node: " + tp); |
|
/* get the Node of TreePath, needed by new started plugin */ |
Node node=((AdapterNode)tp.getLastPathComponent()).toDomNode(); |
1207,11 → 1206,13 |
|
/* get environment, needed by new started plugin, and make it 'final' */ |
final Document environment = documentManagerInterface.getActualDocument(); |
|
|
Node transformedNode = null; |
|
/* case: actual plugin is the default plugin |
* -> switch to associated plugin */ |
if (actualPlugin == defaultPluginName) { |
|
/* get associated plugin for node */ |
String elementName = node.getNodeName(); |
String associatedPlugin = getAssociatedPlugin(elementName); |
1218,9 → 1219,18 |
//testing output |
System.out.println("name of transferred node: " + elementName + ", associated plugin: " + associatedPlugin); |
|
/* transform node for assosciated plugin */ |
OurTransformer transformer = (OurTransformer) ((Hashtable) plugins.get(associatedPlugin)).get("xslTo"); |
Node transformedNode = transformer.transformNode(node); |
/* case: node has 'normal' type -> transform it */ |
if( node.getNodeType() == Node.ELEMENT_NODE |
|| node.getNodeType() == Node.ENTITY_NODE) |
{ |
/* transform node for assosciated plugin */ |
OurTransformer transformer = (OurTransformer) ((Hashtable) plugins.get(associatedPlugin)).get("xslTo"); |
transformedNode = transformer.transformNode(node); |
} |
/* node of 'unnormal' type -> must not be transformed */ |
else { |
transformedNode = node.cloneNode(true); |
} |
|
/* get 'PluginLoader' of default plugin */ |
PluginLoader associatedPL = (PluginLoader) ((Hashtable) plugins.get(associatedPlugin)).get("loader"); |
1233,9 → 1243,19 |
* is not available if the default plugin was started after selecting a element) |
* -> switch to default plugin */ |
else { |
/* transform node for default plugin */ |
OurTransformer transformer = (OurTransformer) ((Hashtable) plugins.get(defaultPluginName)).get("xslTo"); |
Node transformedNode = transformer.transformNode(node); |
|
/* case: node has 'normal' type -> transform it */ |
if( node.getNodeType() == Node.ELEMENT_NODE |
|| node.getNodeType() == Node.ENTITY_NODE) |
{ |
/* transform node for default plugin */ |
OurTransformer transformer = (OurTransformer) ((Hashtable) plugins.get(actualDocumentName)).get("xslTo"); |
transformedNode = transformer.transformNode(node); |
} |
/* node of 'unnormal' type -> must not be transformed */ |
else { |
transformedNode = node.cloneNode(true); |
} |
|
/* get 'PluginLoader' of default plugin */ |
PluginLoader defaultPL = (PluginLoader) ((Hashtable) plugins.get(defaultPluginName)).get("loader"); |