Browse Source

Merge pull request #588 in BA/design from ~ZACK/design:dev to dev

* commit '3ae0adb1c0e8c54e9b3f0750acb208e204f47421':
  REPORT-1097 pmd
  REPORT-1097 超链支持在平台内标签打开
master
superman 8 years ago
parent
commit
2dd43cd67d
  1. 17
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  2. 49
      designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
  3. 25
      designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  4. 34
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java

17
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.NameJavaScript;
import com.fr.js.NameJavaScriptGroup; import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.PluginManager; import com.fr.plugin.PluginManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeMap;
/** /**
* 超级链接 界面. * 超级链接 界面.
@ -34,23 +34,26 @@ public class HyperlinkGroupPane extends JListControlPane {
* @return 返回Nameable按钮数组. * @return 返回Nameable按钮数组.
*/ */
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
Map<String, NameableCreator> nameCreators = new TreeMap<String, NameableCreator>();
NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators();
for (NameableCreator creator : creators) {
nameCreators.put(creator.menuName(), creator);
}
PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG); PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG);
ArrayList<UpdateAction> templateArrayLisy = PluginManager.getInstance().getResultList(); ArrayList<UpdateAction> templateArrayLisy = PluginManager.getInstance().getResultList();
// if (templateArrayLisy.isEmpty()) { // if (templateArrayLisy.isEmpty()) {
// return creators; // return creators;
// } // }
NameableCreator[] pluginCreators = new NameableCreator[templateArrayLisy.size()];
for (int i = 0; i < templateArrayLisy.size(); i++) { 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<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
List<NameableCreator> creatorList = new ArrayList<NameableCreator>();
for (HyperlinkProvider provider : providers) { for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator(); 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()]);
} }
/** /**

49
designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

@ -1,27 +1,19 @@
package com.fr.design.hyperlink; 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.base.Utils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; 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.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.Hyperlink; 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<T extends Hyperlink> extends BasicBeanPane<T> { public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBeanPane<T> {
public static final int NEW_WINDOW = 0; public static final int NEW_WINDOW = 0;
public static final int DIALOG = 1; public static final int DIALOG = 1;
@ -46,7 +38,7 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
headerPane = this.setHeaderPanel(); headerPane = this.setHeaderPanel();
this.add(headerPane, BorderLayout.NORTH); this.add(headerPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); 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() { targetFrameComboBox.setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
@ -86,6 +78,9 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
this.add(this.setFootPanel(), BorderLayout.SOUTH); 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(); protected abstract JPanel setHeaderPanel();
@ -93,6 +88,30 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
protected abstract void populateSubHyperlinkBean(T link); 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 @Override
public void populateBean(T link) { public void populateBean(T link) {
String name = link.getTargetFrame(); String name = link.getTargetFrame();

25
designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java

@ -104,7 +104,7 @@ public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> {
} }
private class HyperlinkParametersAction extends UITableEditAction { protected class HyperlinkParametersAction extends UITableEditAction {
public HyperlinkParametersAction() { public HyperlinkParametersAction() {
this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"})); this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"}));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"));
@ -207,4 +207,27 @@ public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> {
} }
} }
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;
}
} }

34
designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java

@ -40,7 +40,7 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"), null)); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null));
useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter")); useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter"));
extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters")); extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters"));
@ -167,4 +167,36 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
return ParameterTableModel.CHART_METER_USE; 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;
}
} }
Loading…
Cancel
Save