From 719ca5ac3ab2cb2f581bf8c9e2e9bcb75c719c8d Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 23 Nov 2018 12:44:41 +0800 Subject: [PATCH] =?UTF-8?q?ui=E9=83=A8=E5=88=86=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/mobile/ParaMobileDefinePane.java | 47 +++++-------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 8b0aec95f..7e0f3b940 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -22,12 +22,10 @@ import com.fr.form.ui.container.WSortLayout; import com.fr.general.ComparatorUtils; import com.fr.general.SiteCenter; import com.fr.json.JSONException; -import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.report.ExtraReportClassManager; -import com.fr.report.fun.LocationAttrProvider; -import com.fr.report.fun.impl.AbstractLocationAttrProvider; - +import com.fr.report.fun.MobileParamStyleProvider; +import com.fr.report.mobile.DefaultMobileParamStyle; import javax.swing.BorderFactory; @@ -90,10 +88,10 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { double[] rowSize = {p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}}; - if (ExtraReportClassManager.getInstance().getArray(LocationAttrProvider.MARK_STRING).size() != 0) { + if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).size() != 0) { tipLabel = null; } else { - ((WParameterLayout) (paraCreator.toData())).setProvider((LocationAttrProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue()); + ((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue()); } Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), paramLocationComboBox}, @@ -107,9 +105,9 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { } private Item[] getItems() { - Set pluginCreators = ExtraReportClassManager.getInstance().getArray(LocationAttrProvider.MARK_STRING); + Set pluginCreators = ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING); Item[] items = new Item[pluginCreators.size() + 1]; - LocationAttrProvider provider = getDefaultLocationAttr(); + MobileParamStyleProvider provider = new DefaultMobileParamStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); items[0] = new Item(provider.descriptor(), provider); for (int i = 0; i < pluginCreators.size(); i++) { provider = pluginCreators.iterator().next(); @@ -120,11 +118,10 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { private UILabel getTipLabel() { UILabel tipLabel = new UILabel(); - String[] strings = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_Tip").split("\\|"); StringBuilder text = new StringBuilder(); - text.append("").append(strings[0]) - .append("").append(strings[1]) - .append("").append(strings[2]) + text.append("").append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_Tip")) + .append("").append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_Install_Parameter_Pane_Plugin")) + .append("").append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_To_Get_More_Style")) .append(""); tipLabel.setText(text.toString()); tipLabel.addMouseListener(new MouseAdapter() { @@ -169,33 +166,13 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { - ((WParameterLayout) (paraCreator.toData())).setProvider((LocationAttrProvider) ((Item) e.getItem()).getValue()); + ((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) e.getItem()).getValue()); } } }); return paramLocationComoBox; } - private LocationAttrProvider getDefaultLocationAttr() { - return new AbstractLocationAttrProvider() { - @Override - public String descriptor() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"); - } - - @Override - public JSONObject createJSON() { - JSONObject jo = JSONObject.create(); - try { - jo.put("queryType", "default"); - } catch (JSONException e) { - - } - return jo; - } - }; - } - // 控件顺序 private UIExpandablePane getMobileWidgetListPane() { mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); @@ -232,10 +209,10 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { this.addAttributeChangeListener(changeListener); int index = 0; try { - LocationAttrProvider provider = ((WParameterLayout) paraCreator.toData()).getProvider(); + MobileParamStyleProvider provider = ((WParameterLayout) paraCreator.toData()).getProvider(); String currentQueryType = provider.createJSON().getString("queryType"); for (int i = 0; i < items.length; i++) { - String existedQueryType = ((LocationAttrProvider) items[i].getValue()).createJSON().getString("queryType"); + String existedQueryType = ((MobileParamStyleProvider) items[i].getValue()).createJSON().getString("queryType"); if (ComparatorUtils.equals(existedQueryType, currentQueryType)) { index = i; break;