Browse Source

REPORT-4494 && REPORT-4373 区分按钮控件初始化和重新选择按钮类型

master
kerry 7 years ago
parent
commit
0a74642788
  1. 4
      designer/src/com/fr/design/widget/WidgetPane.java
  2. 10
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  3. 4
      designer_base/src/com/fr/design/widget/component/CheckBoxDictPane.java
  4. 17
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  5. 14
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

4
designer/src/com/fr/design/widget/WidgetPane.java

@ -92,7 +92,9 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
AttributeChangeListener listener = new AttributeChangeListener() { AttributeChangeListener listener = new AttributeChangeListener() {
@Override @Override
public void attributeChange() { public void attributeChange() {
CellWidgetPropertyPane.getInstance().update(); if(shouldFireSelectedEvent){
CellWidgetPropertyPane.getInstance().update();
}
} }
}; };

10
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java

@ -28,6 +28,12 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
private void resetDetailPane(Button btn, Class cls) { private void resetDetailPane(Button btn, Class cls) {
initDetailPane(btn, cls);
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
}
public void initDetailPane(Button btn, Class cls){
if (detailPane != null) { if (detailPane != null) {
remove(detailPane); remove(detailPane);
} }
@ -40,13 +46,11 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
}); });
this.updateUI(); this.updateUI();
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
} }
@Override @Override
public void populateBean(Button btn) { public void populateBean(Button btn) {
resetDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null); initDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null);
} }
@Override @Override

4
designer_base/src/com/fr/design/widget/component/CheckBoxDictPane.java

@ -7,7 +7,8 @@ import java.awt.event.ActionListener;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
@ -51,6 +52,7 @@ public class CheckBoxDictPane extends JPanel {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(headPane, BorderLayout.NORTH); jPanel.add(headPane, BorderLayout.NORTH);
jPanel.add(returnStringPane, BorderLayout.CENTER); jPanel.add(returnStringPane, BorderLayout.CENTER);
returnStringPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
this.add(jPanel); this.add(jPanel);
} }

17
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -2,13 +2,11 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane; import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -18,7 +16,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
private UIButtonGroup returnType; private CheckBoxDictPane checkBoxDictPane;
private UICheckBox checkbox; private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) { public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -42,15 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){ public JPanel createOtherPane(){
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"})); checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")}; checkBoxDictPane = new CheckBoxDictPane();
returnType = new UIButtonGroup(tabTitles);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{checkbox, null }, new Component[]{checkbox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType}, new Component[]{checkBoxDictPane, null},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -62,7 +57,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) { protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0); this.checkBoxDictPane.populate(ob);
this.dictPane.populateBean(ob.getDictionary()); this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
} }
@ -72,7 +67,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected CheckBoxGroup updateSubButtonGroupBean() { protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData(); CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
ob.setReturnString(returnType.getSelectedIndex() == 1); checkBoxDictPane.update(ob);
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
return ob; return ob;

14
designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -2,12 +2,12 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -16,7 +16,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType; private CheckBoxDictPane checkBoxDictPane;
private UITextField waterMarkDictPane; private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
@ -38,15 +38,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){ public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true); supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
checkBoxDictPane = new CheckBoxDictPane();
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIButtonGroup(tabTitles) ;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null }, new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType}, new Component[]{checkBoxDictPane, null},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -57,7 +55,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
} }
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){ protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0); this.checkBoxDictPane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark()); waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob); formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag()); this.supportTagCheckBox.setSelected(ob.isSupportTag());
@ -66,7 +64,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
protected ComboCheckBox updateSubDictionaryEditorBean(){ protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData(); ComboCheckBox combo = (ComboCheckBox) creator.toData();
combo.setReturnString(returnType.getSelectedIndex() == 1); checkBoxDictPane.update(combo);
formWidgetValuePane.update(combo); formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText()); combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());

Loading…
Cancel
Save