From 00cc0ec45a0204dc99825444ebf886f1a4f047a3 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Tue, 12 Jul 2016 10:45:04 +0800 Subject: [PATCH 1/4] rt --- .../com/fr/{plugin => }/PluginManager.java | 254 +++++++++--------- .../mainframe/toolbar/ToolBarMenuDock.java | 39 +-- 2 files changed, 138 insertions(+), 155 deletions(-) rename designer_base/src/com/fr/{plugin => }/PluginManager.java (95%) diff --git a/designer_base/src/com/fr/plugin/PluginManager.java b/designer_base/src/com/fr/PluginManager.java similarity index 95% rename from designer_base/src/com/fr/plugin/PluginManager.java rename to designer_base/src/com/fr/PluginManager.java index c539db874f..d2bdd20a7f 100644 --- a/designer_base/src/com/fr/plugin/PluginManager.java +++ b/designer_base/src/com/fr/PluginManager.java @@ -1,128 +1,128 @@ -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) { - } - +package com.fr; + +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 diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index b372156d7f..f0b1eac9fb 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -8,31 +8,10 @@ import com.fr.base.FRContext; import com.fr.design.DesignState; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; -import com.fr.design.actions.community.BBSAction; -import com.fr.design.actions.community.BugAction; -import com.fr.design.actions.community.NeedAction; -import com.fr.design.actions.community.QuestionAction; -import com.fr.design.actions.community.SignAction; -import com.fr.design.actions.community.UpAction; -import com.fr.design.actions.community.VideoAction; -import com.fr.design.actions.file.CloseCurrentTemplateAction; -import com.fr.design.actions.file.ExitDesignerAction; -import com.fr.design.actions.file.OpenRecentReportMenuDef; -import com.fr.design.actions.file.OpenTemplateAction; -import com.fr.design.actions.file.PreferenceAction; -import com.fr.design.actions.file.SwitchExistEnv; -import com.fr.design.actions.help.AboutAction; -import com.fr.design.actions.help.FeedBackAction; -import com.fr.design.actions.help.ForumAction; -import com.fr.design.actions.help.SupportQQAction; -import com.fr.design.actions.help.TutorialAction; -import com.fr.design.actions.help.WebDemoAction; -import com.fr.design.actions.server.ConnectionListAction; -import com.fr.design.actions.server.FunctionManagerAction; -import com.fr.design.actions.server.GlobalParameterAction; -import com.fr.design.actions.server.GlobalTableDataAction; -import com.fr.design.actions.server.PlatformManagerAction; -import com.fr.design.actions.server.PluginManagerAction; +import com.fr.design.actions.community.*; +import com.fr.design.actions.file.*; +import com.fr.design.actions.help.*; +import com.fr.design.actions.server.*; import com.fr.design.file.NewTemplatePane; import com.fr.design.fun.MenuHandler; import com.fr.design.fun.TableDataPaneProcessor; @@ -55,7 +34,10 @@ import com.fr.stable.ProductConstants; import javax.swing.*; import java.awt.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Locale; +import java.util.Set; /** * @author richer @@ -151,10 +133,11 @@ public abstract class ToolBarMenuDock { // 添加服务器菜单 menuList.add(createServerMenuDef(plus)); + // 添加帮助菜单 menuList.add(createHelpMenuDef()); - // 添加社区菜单 + // 添加社区菜单 menuList.add(createCommunityMenuDef()); return menuList.toArray(new MenuDef[menuList.size()]); } @@ -359,7 +342,7 @@ public abstract class ToolBarMenuDock { for (ShortCut shortCut : otherCommunityShortCuts) { menuDef.addShortCut(shortCut); } - insertMenu(menuDef, MenuHandler.HELP); + insertMenu(menuDef, MenuHandler.BBS); return menuDef; } /** From 7a0ee1d55566a5cc5228a3772d47fd1fce6f4869 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Tue, 12 Jul 2016 10:46:09 +0800 Subject: [PATCH 2/4] rt --- designer_base/src/com/fr/design/fun/MenuHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_base/src/com/fr/design/fun/MenuHandler.java b/designer_base/src/com/fr/design/fun/MenuHandler.java index 740a7f6e8c..9573b11ddf 100644 --- a/designer_base/src/com/fr/design/fun/MenuHandler.java +++ b/designer_base/src/com/fr/design/fun/MenuHandler.java @@ -25,6 +25,7 @@ public interface MenuHandler extends Mutable { String TEMPLATE = "template"; String INSERT = "insert"; String CELL = "cell"; + String BBS = "bbs"; /** * 插入菜单的位置 From d3fbca4592f6c18c43e12638a5bfc4bdcb1dc4bc Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Tue, 12 Jul 2016 10:48:53 +0800 Subject: [PATCH 3/4] rt --- designer_base/src/com/fr/PluginManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/PluginManager.java b/designer_base/src/com/fr/PluginManager.java index d2bdd20a7f..271002aa12 100644 --- a/designer_base/src/com/fr/PluginManager.java +++ b/designer_base/src/com/fr/PluginManager.java @@ -1,4 +1,4 @@ -package com.fr; +package com.fr.plugin; import com.fr.design.actions.UpdateAction; import com.fr.file.XMLFileManager; From d77d991667f57ad35070d09936810a21ca66174e Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Tue, 12 Jul 2016 11:15:43 +0800 Subject: [PATCH 4/4] rt --- .../com/fr/{ => plugin}/PluginManager.java | 254 +++++++++--------- 1 file changed, 127 insertions(+), 127 deletions(-) rename designer_base/src/com/fr/{ => plugin}/PluginManager.java (96%) diff --git a/designer_base/src/com/fr/PluginManager.java b/designer_base/src/com/fr/plugin/PluginManager.java similarity index 96% rename from designer_base/src/com/fr/PluginManager.java rename to designer_base/src/com/fr/plugin/PluginManager.java index 271002aa12..c539db874f 100644 --- a/designer_base/src/com/fr/PluginManager.java +++ b/designer_base/src/com/fr/plugin/PluginManager.java @@ -1,128 +1,128 @@ -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) { - } - +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