From 779b71ee28e23c62b3c8b2f8c6e6a7f09faf1432 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 13 Dec 2016 14:08:58 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-1097=20=E8=B6=85=E9=93=BE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=9C=A8=E5=B9=B3=E5=8F=B0=E5=86=85=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/frpane/HyperlinkGroupPane.java | 17 ++++--- .../hyperlink/AbstractHyperlinkPane.java | 49 +++++++++++++------ .../hyperlink/ReportletHyperlinkPane.java | 25 +++++++++- .../fr/design/hyperlink/WebHyperlinkPane.java | 32 ++++++++++++ 4 files changed, 100 insertions(+), 23 deletions(-) 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 4d1028e784..112fa54dc2 100644 --- a/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java @@ -13,12 +13,12 @@ import com.fr.js.JavaScript; import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.PluginManager; -import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; -import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.TreeMap; /** * 超级链接 界面. @@ -34,23 +34,26 @@ public class HyperlinkGroupPane extends JListControlPane { * @return 返回Nameable按钮数组. */ public NameableCreator[] createNameableCreators() { + Map nameCreators = new TreeMap(); NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); + 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; // } - NameableCreator[] pluginCreators = new NameableCreator[templateArrayLisy.size()]; for (int i = 0; i < templateArrayLisy.size(); i++) { - pluginCreators[i] = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); + NameableCreator nameableCreator = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); + nameCreators.put(nameableCreator.menuName(), nameableCreator); } Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); - List creatorList = new ArrayList(); for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); - creatorList.add(nc); + nameCreators.put(nc.menuName(), nc); } - return ArrayUtils.addAll(creatorList.toArray(new NameableCreator[creatorList.size()]), ArrayUtils.addAll(creators, pluginCreators)); + return nameCreators.values().toArray(new NameableCreator[nameCreators.size()]); } /** diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 36297d1656..311eaf7d94 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -1,27 +1,19 @@ package com.fr.design.hyperlink; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; - -import com.fr.design.gui.ilable.UILabel; - -import javax.swing.JList; -import javax.swing.JPanel; - import com.fr.base.Utils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import com.fr.js.Hyperlink; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + public abstract class AbstractHyperlinkPane extends BasicBeanPane { public static final int NEW_WINDOW = 0; public static final int DIALOG = 1; @@ -46,7 +38,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe headerPane = this.setHeaderPanel(); this.add(headerPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); - targetFrameComboBox = new UIComboBox(new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}); + targetFrameComboBox = new UIComboBox(getTargetFrames()); targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @@ -86,6 +78,9 @@ public abstract class AbstractHyperlinkPane extends BasicBe this.add(this.setFootPanel(), BorderLayout.SOUTH); } + protected String[] getTargetFrames(){ + return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; + } protected abstract JPanel setHeaderPanel(); @@ -93,6 +88,30 @@ public abstract class AbstractHyperlinkPane extends BasicBe protected abstract void populateSubHyperlinkBean(T link); + public UIComboBox getTargetFrameComboBox() { + return targetFrameComboBox; + } + + public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { + this.targetFrameComboBox = targetFrameComboBox; + } + + public UINumberField getHeightTextFiled() { + return heightTextFiled; + } + + public void setHeightTextFiled(UINumberField heightTextFiled) { + this.heightTextFiled = heightTextFiled; + } + + public UINumberField getWidthTextFiled() { + return widthTextFiled; + } + + public void setWidthTextFiled(UINumberField widthTextFiled) { + this.widthTextFiled = widthTextFiled; + } + @Override public void populateBean(T link) { String name = link.getTargetFrame(); diff --git a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 1cdb3dcbb5..2664a746c9 100644 --- a/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -104,7 +104,7 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } - private class HyperlinkParametersAction extends UITableEditAction { + protected class HyperlinkParametersAction extends UITableEditAction { public HyperlinkParametersAction() { this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"})); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif")); @@ -207,4 +207,27 @@ public class ReportletHyperlinkPane extends BasicBeanPane { } } + public ReporletHyperNorthPane getNorthPane() { + return northPane; + } + + public void setNorthPane(ReporletHyperNorthPane northPane) { + this.northPane = northPane; + } + + public ReportletParameterViewPane getParameterViewPane() { + return parameterViewPane; + } + + public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { + this.parameterViewPane = parameterViewPane; + } + + public UICheckBox getExtendParametersCheckBox() { + return extendParametersCheckBox; + } + + public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { + this.extendParametersCheckBox = extendParametersCheckBox; + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java index 88bff48fb7..72a68baa9d 100644 --- a/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java @@ -167,4 +167,36 @@ public class WebHyperlinkPane extends BasicBeanPane { return ParameterTableModel.CHART_METER_USE; } } + + public WebHyperNorthPane getNorthPane() { + return northPane; + } + + public void setNorthPane(WebHyperNorthPane northPane) { + this.northPane = northPane; + } + + public ReportletParameterViewPane getParameterViewPane() { + return parameterViewPane; + } + + public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { + this.parameterViewPane = parameterViewPane; + } + + public UICheckBox getUseCJKCheckBox() { + return useCJKCheckBox; + } + + public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) { + this.useCJKCheckBox = useCJKCheckBox; + } + + public UICheckBox getExtendParametersCheckBox() { + return extendParametersCheckBox; + } + + public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) { + this.extendParametersCheckBox = extendParametersCheckBox; + } } \ No newline at end of file