diff --git a/designer/src/com/fr/design/condition/PresentHighlightPane.java b/designer/src/com/fr/design/condition/PresentHighlightPane.java index d00515501..f306ec0f7 100644 --- a/designer/src/com/fr/design/condition/PresentHighlightPane.java +++ b/designer/src/com/fr/design/condition/PresentHighlightPane.java @@ -97,21 +97,21 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane { + + private List radioButtons = new ArrayList(); + + public MobileUseHtmlGroupPane() { + initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(UITitledBorder.createBorderWithTitle(this.title4PopupWindow())); + + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p}; + double[] columnSize = {p, p, p}; + + UIRadioButton useApp = new UIRadioButton(Inter.getLocText("FR-mobile_native_analysis")); + useApp.setSelected(true); + UIRadioButton useHTML5 = new UIRadioButton(Inter.getLocText("FR-mobile_html_analysis")); + + addToButtonGroup(useApp, useHTML5); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_style")), useApp, useHTML5}, + new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_annotation")), null, null} + }; + JPanel usePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + usePane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); + + this.add(usePane); + } + + private void addToButtonGroup(UIRadioButton... radios) { + ButtonGroup buttonGroup = new ButtonGroup(); + for (UIRadioButton radio : radios) { + radioButtons.add(radio); + buttonGroup.add(radio); + } + } + + /** + * 设置按钮状态 + */ + public void setEnabled(boolean enabled) { + for (UIRadioButton radioButton : radioButtons) { + radioButton.setEnabled(enabled); + } + } + + /** + * 获取当前选中的按钮index + * + * @return 按钮index + */ + public int getSelectRadioIndex() { + for (int i = 0, len = radioButtons.size(); i < len; i++) { + if (radioButtons.get(i).isSelected()) { + return i; + } + } + + return 0; + } + + /** + * 选中指定index的按钮 + */ + public void selectIndexButton(int index) { + if (index < 0 || index > radioButtons.size() - 1) { + return; + } + + UIRadioButton button = radioButtons.get(index); + button.setSelected(true); + } + + /** + * 给所有的按钮加上监听 + */ + public void addActionListener(ActionListener actionListener) { + for (UIRadioButton radioButton : radioButtons) { + radioButton.addActionListener(actionListener); + } + } + + @Override + public void populateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + selectIndexButton(mobileAttr.isUseHTML() ? 1 : 0); + } + } + + @Override + public ElementCaseMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setUseHTML(getSelectRadioIndex() == 1); + } + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-mobile_report_analysis"); + } +} diff --git a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java index 1d2d39931..3c0023219 100644 --- a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -14,6 +14,8 @@ public class ReportMobileAttrPane extends BasicBeanPane{ private AppFitBrowserPane appFitBrowserPane; + private MobileUseHtmlGroupPane htmlGroupPane; + public ReportMobileAttrPane() { initComponents(); } @@ -27,6 +29,8 @@ public class ReportMobileAttrPane extends BasicBeanPane{ appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); this.add(appFitBrowserPane); + this.add(htmlGroupPane = new MobileUseHtmlGroupPane()); + this.add(appFitPreviewPane); } @@ -37,11 +41,17 @@ public class ReportMobileAttrPane extends BasicBeanPane{ } appFitBrowserPane.populateBean(ob); + htmlGroupPane.populateBean(ob); + } @Override public ElementCaseMobileAttr updateBean() { - return appFitBrowserPane.updateBean(); + ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); + + htmlGroupPane.updateBean(caseMobileAttr); + + return caseMobileAttr; } @Override diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index b2d206c91..d1c81d53a 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -86,7 +86,12 @@ public class CellWidgetCardPane extends BasicPane { attriPane.remove(widgetPropertyPane); widgetPropertyPane = new BasicWidgetPropertySettingPane(); - attriPane.add(widgetPropertyPane, BorderLayout.NORTH); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); + JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Form-Basic_Properties")); + northPane.add(basic); + basic.add(widgetPropertyPane); + attriPane.add(northPane, BorderLayout.NORTH); WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { @Override diff --git a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java index b7dd0fdf5..5d5c8d2fa 100644 --- a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java @@ -24,7 +24,7 @@ public class ButtonDefinePane extends AbstractDataModify