Browse Source

Merge pull request #1209 in BA/design from ~KERRY/design:release/9.0 to release/9.0

* commit '5cdb85c345baa7cd43ed3197bc48e47002372fe5':
  REPORT-4494 && REPORT-4373 区分按钮控件初始化和重新选择按钮类型
master
superman 7 years ago
parent
commit
edcc33c3b3
  1. 2
      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

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

@ -92,8 +92,10 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
AttributeChangeListener listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
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) {
initDetailPane(btn, cls);
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
}
public void initDetailPane(Button btn, Class cls){
if (detailPane != null) {
remove(detailPane);
}
@ -40,13 +46,11 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
}
});
this.updateUI();
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
}
@Override
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

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.gui.ibutton.UIButtonGroup;
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.DictionaryConstants;
@ -51,6 +52,7 @@ public class CheckBoxDictPane extends JPanel {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(headPane, BorderLayout.NORTH);
jPanel.add(returnStringPane, BorderLayout.CENTER);
returnStringPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
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.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.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
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.form.ui.CheckBoxGroup;
import com.fr.general.Inter;
@ -18,7 +16,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane;
private UIButtonGroup returnType;
private CheckBoxDictPane checkBoxDictPane;
private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -42,15 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIButtonGroup(tabTitles);
checkBoxDictPane = new CheckBoxDictPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
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[] columnSize = {p, f};
@ -62,7 +57,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0);
this.checkBoxDictPane.populate(ob);
this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll());
}
@ -72,7 +67,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
ob.setReturnString(returnType.getSelectedIndex() == 1);
checkBoxDictPane.update(ob);
ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected());
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.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter;
@ -16,7 +16,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType;
private CheckBoxDictPane checkBoxDictPane;
private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
@ -38,15 +38,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIButtonGroup(tabTitles) ;
checkBoxDictPane = new CheckBoxDictPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
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[] columnSize = {p, f};
@ -57,7 +55,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
}
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0);
this.checkBoxDictPane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag());
@ -66,7 +64,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData();
combo.setReturnString(returnType.getSelectedIndex() == 1);
checkBoxDictPane.update(combo);
formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected());

Loading…
Cancel
Save