From 016a70ee471d74aa3ea5b9a9f8498108fada5180 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Fri, 9 Jun 2017 16:00:35 +0800 Subject: [PATCH] fix --- .../design/gui/frpane/HyperlinkGroupPane.java | 13 -- .../src/com/fr/plugin/PluginManager.java | 128 ------------------ 2 files changed, 141 deletions(-) delete mode 100644 designer_base/src/com/fr/plugin/PluginManager.java diff --git a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java index 99fc5948e..3408bf371 100644 --- a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java @@ -1,8 +1,6 @@ package com.fr.design.gui.frpane; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.actions.HyperlinkPluginAction; -import com.fr.design.actions.UpdateAction; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; @@ -12,14 +10,12 @@ import com.fr.general.NameObject; import com.fr.js.JavaScript; import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScriptGroup; -import com.fr.plugin.PluginManager; import com.fr.stable.ListMap; import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.Map; import java.util.Set; -import java.util.TreeMap; /** * 超级链接 界面. @@ -40,15 +36,6 @@ public class HyperlinkGroupPane extends JListControlPane { for (NameableCreator creator : creators) { nameCreators.put(creator.menuName(), creator); } - PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG); - ArrayList templateArrayLisy = PluginManager.getInstance().getResultList(); -// if (templateArrayLisy.isEmpty()) { -// return creators; -// } - for (int i = 0; i < templateArrayLisy.size(); i++) { - NameableCreator nameableCreator = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); - nameCreators.put(nameableCreator.menuName(), nameableCreator); - } Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); diff --git a/designer_base/src/com/fr/plugin/PluginManager.java b/designer_base/src/com/fr/plugin/PluginManager.java deleted file mode 100644 index c539db874..000000000 --- a/designer_base/src/com/fr/plugin/PluginManager.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.fr.plugin; - -import com.fr.design.actions.UpdateAction; -import com.fr.file.XMLFileManager; -import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; -import com.fr.general.GeneralUtils; -import com.fr.stable.StringUtils; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLReadable; -import com.fr.stable.xml.XMLableReader; - -import java.util.ArrayList; - -/** - * Created by IntelliJ IDEA. - * Author : daisy - * Version: 6.5.6 - * Date: 13-12-20 - * Time: 下午5:05 - */ -public class PluginManager extends XMLFileManager { - - private static PluginManager pluginManager = null; - - private String extensionPoint = StringUtils.EMPTY; - - private ArrayList resultList = new ArrayList(); - - - public synchronized static PluginManager getInstance() { - if (pluginManager == null) { - pluginManager = new PluginManager(); - } - return pluginManager; - } - - - public PluginManager() { - - } - - /** - * 文件名 - * @return 文件名 - */ - public String fileName() { - return "plugin.xml"; - } - - - public void setExtensionPoint(String point) { - extensionPoint = point; - resultList.clear(); - pluginManager.readXMLFile(); - } - - - @Override - public void readXML(XMLableReader reader) { - if (extensionPoint == StringUtils.EMPTY) { - return; - } - if (reader.getTagName().equals("PluginManager")) { - reader.readXMLObject(new XMLReadable() { - @Override - public void readXML(XMLableReader reader) { - readExtension(reader); - } - }); - } - - - } - - private void readExtension(XMLableReader reader) { - if (reader.isChildNode()) { - if (reader.getTagName().equals("Extension")) { - String name = null, tmpVal = null; - if ((tmpVal = reader.getAttrAsString("position", null)) != null) { - name = tmpVal; - } - if (!ComparatorUtils.equals(name, extensionPoint)) { - return; - } - reader.readXMLObject(new XMLReadable() { - @Override - public void readXML(XMLableReader reader) { - readActions(reader); - } - }); - - } - } - } - - private void readActions(XMLableReader reader) { - if (reader.isChildNode()) { - if (reader.getTagName().equals("Action")) { - String name = null, tmpVal = null; - if ((tmpVal = reader.getAttrAsString("class", null)) != null) { - name = tmpVal; - } - //读取模板数据集菜单 - if (name.isEmpty()) { - return; - } - try { - UpdateAction action = (UpdateAction) GeneralUtils.classForName(name).newInstance(); - PluginManager.this.resultList.add(action); - } catch (Exception exp) { - FRLogger.getLogger().error(exp.getMessage(), exp); - } - } - } - - } - - - public ArrayList getResultList() { - return resultList; - } - - @Override - public void writeXML(XMLPrintWriter writer) { - } - -} \ No newline at end of file