Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 783 → Rev 784

/sun/xmleditor/trunk/src/plugins/PluginManager.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.53 $
* @version $Revision: 1.54 $
*
* Last modification: $Date: 2003/07/23 15:16:10 $
* $Id: PluginManager.java,v 1.53 2003/07/23 15:16:10 swalkenh Exp $
* Last modification: $Date: 2003/07/24 14:19:48 $
* $Id: PluginManager.java,v 1.54 2003/07/24 14:19:48 smcsporr Exp $
*/
 
package src.plugins;
56,7 → 56,7
*
* @author Sascha Walkenhorst
*
* @version $Revision: 1.53 $ Last modification: $Date: 2003/07/23 15:16:10 $
* @version $Revision: 1.54 $ Last modification: $Date: 2003/07/24 14:19:48 $
*/
public class PluginManager implements TreeSelectionListener,
PluginManagerInterface,
63,13 → 63,13
OurEventListener,
ActionListener {
 
/** for the path of the configuration file */
/** The path of the configuration file. */
private String configurationFilePath;
/** for the parsed configuration file */
/** The parsed configuration file (an XML file). */
private Document configuration;
 
/** directory-path where the jar-archives of plugins are located */
/** The directory-path where the jar-archives of the plugins are stored. */
private String pluginsPath;
 
/** list for found plugins, contains the name of a plugin as key and
78,7 → 78,7
* this plugin (key: "loader") */
private Hashtable plugins;
 
/** for associations of elements (keys) and plugins (values) */
/** For associations of elements (keys) and plugins (values). */
private Hashtable associations;
 
/** list for loaded documents as keys and as value all names of plugins which
86,7 → 86,7
* in a LinkedList */
private Hashtable documents;
 
/** name of the default plugin */
/** The name of the default plugin is stored here. */
private String defaultPluginName;
/** needed to get the actual document */
95,7 → 95,7
/** needed to get the selected node in method <code>switchToAndFroDefaultPlugin</code> */
private UpdateViewInterface updateViewInterface;
/** for messages to a log area */
/** A reference variable to the log panel, used for sending messages to the log area. */
private LogInterface logInterfaceReference;
/** needed for the plugins */
113,8 → 113,6
/** needed for correct updating nodes */
private Node lastUpdatedNode;
private Node retransformedNode = null;
 
143,6 → 141,7
GuiInterface newGuiInterface,
OurEventListener newOurEventListener,
LogInterface newLogInterface) {
/* set the internal variable for the path of the configuration file,
* GuiInterface, OurEventListener and LogInterface */
configurationFilePath = configFilePath;
181,6 → 180,7
* Last Revision: 21-Jul-2003 by Sascha W.
*/
public void reset(String configFilePath) {
/* get file with configuration informations as a document */
File configFile = new File(configFilePath);
configuration = readConfigurationFile(configFile);
192,7 → 192,7
plugins = lookupPlugins(pluginsPath);
/* get associations of elements with plugins */
// associations = readPluginAssociationsFromConfiguration();
//associations = readPluginAssociationsFromConfiguration();
associations = readPluginAssociations();
/* get name of default plugin out of configuration */
455,7 → 455,7
}
catch (NullPointerException nPE) {
System.out.println(nPE);
nPE.printStackTrace();
nPE.printStackTrace();
///log(LogInterface.TYPE_ERROR, nPE.toString());
}
// Exceptions thrown by 'new JarFile()' and its method 'getManifest()'
644,8 → 644,7
hashtable.put(element, pluginName);
//testing output
System.out.println(" " + element + " <-> " + pluginName);
}
else {
} else {
System.out.println(" " + element + " already associated");
}
}
653,11 → 652,9
else {
System.out.println(" " + pluginName + " not available"
+ " (should be associated to \"" + element + "\")");
}
}
}
}
return hashtable;
}
 
709,8 → 706,8
* -> user should choose another plugin as default plugin */
if ( (candidate == null)
|| (candidate == "")
|| !plugins.containsKey(candidate)
) {
|| !plugins.containsKey(candidate)) {
candidate = chooseDefaultPluginName();
//testing output
722,10 → 719,10
/**
* Shows a dialog to let the user choose a default plugin. The dialog has
* a list of loaded plugins, made of <code>plugins</code>.
* Shows a dialog to let the user choose a default plugin.
* The dialog has a list of loaded plugins, made of <code>plugins</code>.
*
* @return The chosen plugin. <code>null</code> if none is selected.
* @return The chosen plugin. <code>null</code> if none was selected.
*
* author Sascha Walkenhorst
*
1025,15 → 1022,14
/**
* This method sets the internal reference of LogInterface. With the
* <code>log</code>-method it enables this class to fire messages to
* the logging area of the XMLEditor.
* This method sets an internal reference to the log panel that is used to
* output logging messages to inform the user about program events.
*
* @param log The instance of the interface.
* @param log A log panel implementation compliant to src.gui.LogInterface.
*
* author Sascha Walkenhorst
* author S. McSporran
*
* Last revision: 21-Jul-2003 by Sascha W.
* Last Revision: 11-Jul-2003
*/
public void setLogInterface (LogInterface log) {
logInterfaceReference = log;
1107,7 → 1103,7
* Last Revision: 19-Jul-2003 by Matthias D.
*/
public void firedOurEvent(OurEvent e) {
// Node retransformedNode = null;
Node retransformedNode = null;
/* read out the event contents */
Object[] oldMessage = (Object[]) e.getSource();