|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
package com.fr.design.widget.ui; |
|
|
|
|
|
|
|
|
|
import com.fr.data.Dictionary; |
|
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
|
|
|
import com.fr.design.gui.frpane.TreeSettingPane; |
|
|
|
|
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.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; |
|
|
|
|
import com.fr.form.ui.TreeEditor; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
@ -16,8 +19,8 @@ import java.awt.*;
|
|
|
|
|
* richer:tree editor |
|
|
|
|
*/ |
|
|
|
|
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> { |
|
|
|
|
protected TreeSettingPane treeSettingPane; |
|
|
|
|
protected TreeRootPane treeRootPane; |
|
|
|
|
private AccessibleTreeModelEditor accessibleTreeModelEditor; |
|
|
|
|
|
|
|
|
|
private UICheckBox removeRepeatCheckBox; |
|
|
|
|
|
|
|
|
@ -27,7 +30,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void populateSubFieldEditorBean(TreeEditor e) { |
|
|
|
|
this.treeSettingPane.populate(e); |
|
|
|
|
this.accessibleTreeModelEditor.setValue(e.getDictionary()); |
|
|
|
|
treeRootPane.populate(e.getTreeAttr()); |
|
|
|
|
if (this.removeRepeatCheckBox != null) { |
|
|
|
|
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); |
|
|
|
@ -36,7 +39,8 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected TreeEditor updateSubFieldEditorBean() { |
|
|
|
|
TreeEditor editor = treeSettingPane.updateTreeEditor(); |
|
|
|
|
TreeEditor editor = new TreeEditor(); |
|
|
|
|
editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue()); |
|
|
|
|
editor.setTreeAttr(treeRootPane.update()); |
|
|
|
|
if (this.removeRepeatCheckBox != null) { |
|
|
|
|
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected()); |
|
|
|
@ -50,13 +54,17 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel setSecondContentPane() { |
|
|
|
|
accessibleTreeModelEditor = new AccessibleTreeModelEditor(); |
|
|
|
|
JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); |
|
|
|
|
createTree.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
|
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); |
|
|
|
|
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
|
|
contentPane.add(contenter,BorderLayout.NORTH); |
|
|
|
|
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); |
|
|
|
|
contenter.add(removeRepeatCheckBox); |
|
|
|
|
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
contenter.add(createTree, BorderLayout.NORTH); |
|
|
|
|
contenter.add(removeRepeatCheckBox, BorderLayout.CENTER); |
|
|
|
|
JPanel otherContentPane = this.setThirdContentPane(); |
|
|
|
|
if (otherContentPane != null) { |
|
|
|
|
contentPane.add(otherContentPane,BorderLayout.CENTER); |
|
|
|
@ -69,7 +77,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
|
|
|
|
|
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
treeRootPane = new TreeRootPane(); |
|
|
|
|
content.add(treeRootPane, BorderLayout.NORTH); |
|
|
|
|
treeSettingPane = new TreeSettingPane(true); |
|
|
|
|
return content; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -80,6 +87,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public DataCreatorUI dataUI() { |
|
|
|
|
return treeSettingPane; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |