Browse Source

Pull request #9392: REPORT-72384 && REPORT-72443 下拉树优化V2 /控件性能优化内置V2

Merge in DESIGN/design from ~YUAN.WANG/design:feature/x to feature/x

* commit '4cecda060c9035879f8a244efdfa038a055f70e6':
  REPORT-72384 && REPORT-72443 1、下拉树优化V2 2、控件性能优化内置V2
feature/x
Yuan.Wang 2 years ago
parent
commit
05bf097cbb
  1. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java
  3. 7
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java
  4. 50
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java
  5. 87
      designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java
  6. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  7. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  8. 68
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  9. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  10. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java
  11. 18
      designer-realize/src/main/java/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java
  12. 17
      designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -296,7 +296,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver, UIOb
return selectedIndex;
}
protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
if (selectedIndex != newSelectedIndex) {
selectedIndex = newSelectedIndex;
for (int i = 0; i < labelButtonList.size(); i++) {

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java

@ -63,7 +63,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
}
@Override
protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
super.setSelectedIndex(newSelectedIndex, false);
tabChanged(newSelectedIndex);
}

7
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java

@ -0,0 +1,7 @@
package com.fr.design.gui.itree.refreshabletree;
import com.fr.data.impl.TreeAttr;
public interface TreeAttrChangeListener {
void doChange(TreeAttr treeAttr);
}

50
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java

@ -10,21 +10,24 @@ import javax.swing.BoxLayout;
import javax.swing.JPanel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
public class TreeRootPane extends BasicPane {
private final List<TreeAttrChangeListener> listeners = new ArrayList<>();
// 是否支持多选(checkBoxTree)
//private JCheckBox multipleSelection;
private UICheckBox checkTypeCheckBox;
private final UICheckBox checkTypeCheckBox;
// richer:加载的方式,支持异步加载和完全加载
private UICheckBox loadTypeCheckBox;
private final UICheckBox loadTypeCheckBox;
private UICheckBox layerTypeCheckBox;
private final UICheckBox layerTypeCheckBox;
private UICheckBox returnFullPathCheckBox;
private final UICheckBox returnFullPathCheckBox;
public TreeRootPane() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@ -41,13 +44,6 @@ public class TreeRootPane extends BasicPane {
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async"));
loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypeCheckBox.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
UICheckBox checkBox = (UICheckBox) e.getSource();
doLoadTypeChange(checkBox.isSelected());
}
});
loadTypePane.add(loadTypeCheckBox);
this.add(loadTypePane);
@ -63,11 +59,27 @@ public class TreeRootPane extends BasicPane {
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path")));
returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
addCheckBoxListener();
this.add(returnFullPathPane);
}
private void addCheckBoxListener() {
loadTypeCheckBox.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
UICheckBox checkBox = (UICheckBox) e.getSource();
doLoadTypeChange(checkBox.isSelected());
}
});
checkTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener());
loadTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener());
layerTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener());
returnFullPathCheckBox.addActionListener(event->fireTreeAttrChangeListener());
}
private void doLoadTypeChange(Boolean selected) {
//给埋点插件提供一个方法,埋埋点用
}
@ -82,6 +94,7 @@ public class TreeRootPane extends BasicPane {
loadTypeCheckBox.setSelected(treeAttr.isAjax());
layerTypeCheckBox.setSelected(treeAttr.isSelectLeafOnly());
returnFullPathCheckBox.setSelected(treeAttr.isReturnFullPath());
fireTreeAttrChangeListener();
}
public TreeAttr update() {
@ -93,4 +106,17 @@ public class TreeRootPane extends BasicPane {
return treeAttr;
}
public void addTreeAttrChangeListener(TreeAttrChangeListener listener) {
listeners.add(listener);
}
public void fireTreeAttrChangeListener() {
TreeAttr treeAttr = new TreeAttr();
treeAttr.setMultipleSelection(checkTypeCheckBox.isSelected());
treeAttr.setAjax(loadTypeCheckBox.isSelected());
treeAttr.setSelectLeafOnly(layerTypeCheckBox.isSelected());
treeAttr.setReturnFullPath(returnFullPathCheckBox.isSelected());
listeners.forEach(listener -> listener.doChange(treeAttr));
}
}

87
designer-base/src/main/java/com/fr/design/widget/component/CheckBoxDictPane.java → designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java

@ -1,32 +1,29 @@
package com.fr.design.widget.component;
import java.awt.*;
import java.awt.event.ActionEvent;
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.*;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.CheckBoxGroup;
import com.fr.form.ui.ComboCheckBox;
import com.fr.form.ui.ReturnTypeProvider;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class CheckBoxDictPane extends JPanel {
public class ReturnTypePane extends JPanel {
private DictionaryComboBox delimiterComboBox;
private UIButtonGroup returnTypeComboBox;
private DictionaryComboBox startComboBox;
private DictionaryComboBox endComboBox;
private JPanel returnStringPane;
private final DictionaryComboBox delimiterComboBox;
private final UIButtonGroup returnTypeComboBox;
private final DictionaryComboBox startComboBox;
private final DictionaryComboBox endComboBox;
private final JPanel returnStringPane;
public CheckBoxDictPane() {
public ReturnTypePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays);
delimiterComboBox.setEditable(true);
@ -36,18 +33,13 @@ public class CheckBoxDictPane extends JPanel {
endComboBox.setEditable(true);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delimiter")), delimiterComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_Start_Symbol")),startComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_End_Symbol")),endComboBox}
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_Start_Symbol")), startComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_End_Symbol")), endComboBox}
};
returnStringPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
returnTypeComboBox = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Array"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")});
returnTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkVisible(returnTypeComboBox.getSelectedIndex());
}
});
returnTypeComboBox.addActionListener(e -> checkVisible(returnTypeComboBox.getSelectedIndex()));
JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -57,34 +49,33 @@ public class CheckBoxDictPane extends JPanel {
this.add(jPanel);
}
public void checkVisible(int selectIndex){
returnStringPane.setVisible(selectIndex == 1);
public void setReturnType(ReturnType returnType) {
int selectIndex = returnType == ReturnType.ARRAY ? 0 : 1;
returnTypeComboBox.setSelectedIndex(selectIndex,true);
checkVisible(selectIndex);
}
public void populate(ComboCheckBox comboCheckBox) {
this.delimiterComboBox.setSelectedItem(comboCheckBox.getDelimiter());
this.returnTypeComboBox.setSelectedIndex(comboCheckBox.isReturnString() ? 1 : 0);
this.startComboBox.setSelectedItem(comboCheckBox.getStartSymbol());
this.endComboBox.setSelectedItem(comboCheckBox.getEndSymbol());
checkVisible(this.returnTypeComboBox.getSelectedIndex());
public void checkVisible(int selectIndex) {
returnStringPane.setVisible(selectIndex == 1);
}
public void update(ComboCheckBox comboCheckBox) {
comboCheckBox.setDelimiter((String)this.delimiterComboBox.getSelectedItem());
comboCheckBox.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0);
comboCheckBox.setStartSymbol((String)this.startComboBox.getSelectedItem());
comboCheckBox.setEndSymbol((String)this.endComboBox.getSelectedItem());
public void update(ReturnTypeProvider returnTypeProvider) {
returnTypeProvider.setDelimiter((String) this.delimiterComboBox.getSelectedItem());
returnTypeProvider.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0);
returnTypeProvider.setStartSymbol((String) this.startComboBox.getSelectedItem());
returnTypeProvider.setEndSymbol((String) this.endComboBox.getSelectedItem());
}
public void populate(CheckBoxGroup checkBoxGroup) {
this.delimiterComboBox.setSelectedItem(checkBoxGroup.getDelimiter());
this.returnTypeComboBox.setSelectedIndex(checkBoxGroup.isReturnString() ? 1 : 0);
this.startComboBox.setSelectedItem(checkBoxGroup.getStartSymbol());
this.endComboBox.setSelectedItem(checkBoxGroup.getEndSymbol());
public void populate(ReturnTypeProvider returnTypeProvider) {
this.delimiterComboBox.setSelectedItem(returnTypeProvider.getDelimiter());
this.returnTypeComboBox.setSelectedIndex(returnTypeProvider.isReturnString() ? 1 : 0);
this.startComboBox.setSelectedItem(returnTypeProvider.getStartSymbol());
this.endComboBox.setSelectedItem(returnTypeProvider.getEndSymbol());
checkVisible(this.returnTypeComboBox.getSelectedIndex());
}
public void update(CheckBoxGroup checkBoxGroup) {
checkBoxGroup.setDelimiter((String)this.delimiterComboBox.getSelectedItem());
checkBoxGroup.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0);
checkBoxGroup.setStartSymbol((String)this.startComboBox.getSelectedItem());
checkBoxGroup.setEndSymbol((String)this.endComboBox.getSelectedItem());
public enum ReturnType {
STRING,
ARRAY
}
}

12
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -7,7 +7,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
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.component.ReturnTypePane;
import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane;
import com.fr.form.ui.CheckBoxGroup;
@ -17,7 +17,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane;
private CheckBoxDictPane checkBoxDictPane;
private ReturnTypePane returnTypePane;
private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -40,12 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){
checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Choose_Type_All"));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane();
returnTypePane = new ReturnTypePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{checkbox, null },
new Component[]{checkBoxDictPane, null},
new Component[]{returnTypePane, null},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
@ -56,7 +56,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
this.checkBoxDictPane.populate(ob);
this.returnTypePane.populate(ob);
this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll());
}
@ -66,7 +66,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
checkBoxDictPane.update(ob);
returnTypePane.update(ob);
ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected());
return ob;

12
designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -8,7 +8,7 @@ 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.design.widget.component.ReturnTypePane;
import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox;
private CheckBoxDictPane checkBoxDictPane;
private ReturnTypePane returnTypePane;
private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
@ -40,13 +40,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true);
supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane();
returnTypePane = new ReturnTypePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null },
new Component[]{checkBoxDictPane, null},
new Component[]{returnTypePane, null},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
@ -56,7 +56,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
}
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
this.checkBoxDictPane.populate(ob);
this.returnTypePane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag());
@ -65,7 +65,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData();
checkBoxDictPane.update(combo);
returnTypePane.update(combo);
formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected());

68
designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -1,78 +1,50 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
/*
* richer:tree editor
*/
public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
private ReturnTypePane returnTypePane;
protected TreeRootPane treeRootPane;
private UICheckBox mutiSelect;
private UICheckBox loadAsync;
private UICheckBox returnLeaf;
private UICheckBox returnPath;
private AccessibleTreeModelEditor accessibleTreeModelEditor;
public TreeEditorDefinePane(XCreator xCreator) {
super(xCreator);
treeRootPane = new TreeRootPane();
}
public JPanel createOtherPane() {
mutiSelect = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Mutiple_Selection_Or_Not"));
mutiSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadAsync = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async"));
loadAsync.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadAsync.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
UICheckBox checkBox = (UICheckBox) e.getSource();
doLoadTypeChange(checkBox.isSelected());
treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
JPanel panel = FRGUIPaneFactory.createBorderLayout_L_Pane();
panel.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
panel.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
if (!showReturnTypePane) {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
returnLeaf = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Return_Leaf"));
returnLeaf.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnPath = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Return_Path"));
returnPath.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{mutiSelect},
new Component[]{loadAsync},
new Component[]{returnLeaf},
new Component[]{returnPath}
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
return panel;
}
private void doLoadTypeChange(Boolean selected) {
//给埋点插件提供一个方法,埋埋点用
}
@Override
public String title4PopupWindow() {
return "tree";
@ -89,10 +61,7 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEdi
accessibleTreeModelEditor.setValue(e.getBuildModelConfig());
formWidgetValuePane.populate(e);
treeRootPane.populate(e.getTreeAttr());
mutiSelect.setSelected(e.isMultipleSelection());
loadAsync.setSelected(e.isAjax());
returnLeaf.setSelected(e.isSelectLeafOnly());
returnPath.setSelected(e.isReturnFullPath());
returnTypePane.populate(e);
}
@ -101,11 +70,8 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEdi
TreeEditor editor = (TreeEditor) creator.toData();
formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update());
editor.setMultipleSelection(mutiSelect.isSelected());
editor.setAjax(loadAsync.isSelected());
editor.setSelectLeafOnly(returnLeaf.isSelected());
editor.setReturnFullPath(returnPath.isSelected());
editor.setBuildModelConfig(accessibleTreeModelEditor.getValue());
returnTypePane.update(editor);
return editor;
}

12
designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -9,12 +9,12 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.CheckBoxGroup;
public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> {
CheckBoxDictPane checkBoxDictPane;
private ReturnTypePane returnTypePane;
private UICheckBox checkbox;
private ButtonGroupDictPane buttonGroupDictPane;
@ -40,13 +40,13 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Provide_Choose_All"));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
buttonGroupDictPane = new ButtonGroupDictPane();
checkBoxDictPane = new CheckBoxDictPane();
returnTypePane = new ReturnTypePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{buttonGroupDictPane, null },
new Component[]{checkbox, null },
new Component[]{checkBoxDictPane, null },
new Component[]{returnTypePane, null },
};
double[] rowSize = {p, p, p, p};
@ -60,7 +60,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
protected void populateSubFieldEditorBean(CheckBoxGroup ob) {
checkBoxDictPane.populate(ob);
returnTypePane.populate(ob);
checkbox.setSelected(ob.isChooseAll());
this.buttonGroupDictPane.populate(ob);
}
@ -68,7 +68,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
protected CheckBoxGroup updateSubFieldEditorBean() {
CheckBoxGroup ob = new CheckBoxGroup();
checkBoxDictPane.update(ob);
returnTypePane.update(ob);
ob.setChooseAll(checkbox.isSelected());
this.buttonGroupDictPane.update(ob);
return ob;

12
designer-realize/src/main/java/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java

@ -9,7 +9,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import javax.swing.*;
import java.awt.*;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> {
private CheckBoxDictPane checkBoxDictPane;
private ReturnTypePane returnTypePane;
private AccessibleDictionaryEditor dictPane;
private UICheckBox supportTagCheckBox;
@ -28,7 +28,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
@Override
protected JPanel setForthContentPane() {
dictPane = new AccessibleDictionaryEditor();
checkBoxDictPane = new CheckBoxDictPane();
returnTypePane = new ReturnTypePane();
supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true);
supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -37,7 +37,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane },
new Component[]{checkBoxDictPane, null },
new Component[]{returnTypePane, null },
};
double[] rowSize = {p, p, p, p};
@ -52,7 +52,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
@Override
protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) {
this.dictPane.setValue(e.getDictionary());
this.checkBoxDictPane.populate(e);
this.returnTypePane.populate(e);
this.supportTagCheckBox.setSelected(e.isSupportTag());
}
@ -61,7 +61,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
ComboCheckBox combo = new ComboCheckBox();
combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary((Dictionary) this.dictPane.getValue());
checkBoxDictPane.update(combo);
returnTypePane.update(combo);
return combo;
}

18
designer-realize/src/main/java/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java

@ -12,12 +12,15 @@ import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected AccessibleTreeModelEditor treeSettingPane;
private ReturnTypePane returnTypePane;
protected TreeRootPane treeRootPane;
public TreeComboBoxEditorDefinePane() {
@ -28,8 +31,18 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
@Override
protected JPanel setForthContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
content.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
content.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
if (!showReturnTypePane) {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
content.add(treeRootPane, BorderLayout.NORTH);
return content;
}
@ -48,7 +61,6 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
}
@Override
protected String title4PopupWindow() {
return "treecombobox";
@ -58,6 +70,7 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) {
treeSettingPane.setValue(e.getBuildModelConfig());
treeRootPane.populate(e.getTreeAttr());
returnTypePane.populate(e);
}
@Override
@ -65,6 +78,7 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
TreeComboBoxEditor editor = new TreeComboBoxEditor();
editor.setBuildModelConfig(treeSettingPane.getValue());
editor.setTreeAttr(treeRootPane.update());
returnTypePane.update(editor);
return editor;
}

17
designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -8,6 +8,7 @@ import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeEditor;
@ -19,6 +20,8 @@ import java.awt.*;
* richer:tree editor
*/
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
private ReturnTypePane returnTypePane;
protected TreeRootPane treeRootPane;
private AccessibleTreeModelEditor accessibleTreeModelEditor;
@ -32,6 +35,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected void populateSubFieldEditorBean(TreeEditor e) {
this.accessibleTreeModelEditor.setValue(e.getBuildModelConfig());
treeRootPane.populate(e.getTreeAttr());
returnTypePane.populate(e);
if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
}
@ -42,6 +46,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
TreeEditor editor = new TreeEditor();
editor.setBuildModelConfig(accessibleTreeModelEditor.getValue());
editor.setTreeAttr(treeRootPane.update());
returnTypePane.update(editor);
if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
}
@ -75,9 +80,19 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected JPanel setThirdContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
content.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
content.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
if (!showReturnTypePane) {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
//content.add(treeRootPane, BorderLayout.NORTH);
return content;
}

Loading…
Cancel
Save