You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
3.1 KiB
93 lines
3.1 KiB
package com.fr.design.widget.ui; |
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
import com.fr.design.designer.IntervalConstants; |
|
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 javax.swing.*; |
|
import java.awt.*; |
|
|
|
|
|
/* |
|
* richer:tree editor |
|
*/ |
|
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> { |
|
protected TreeRootPane treeRootPane; |
|
private AccessibleTreeModelEditor accessibleTreeModelEditor; |
|
|
|
private UICheckBox removeRepeatCheckBox; |
|
|
|
public TreeEditorDefinePane(){ |
|
this.initComponents(); |
|
} |
|
|
|
@Override |
|
protected void populateSubFieldEditorBean(TreeEditor e) { |
|
this.accessibleTreeModelEditor.setValue(e.getBuildModelConfig()); |
|
treeRootPane.populate(e.getTreeAttr()); |
|
if (this.removeRepeatCheckBox != null) { |
|
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); |
|
} |
|
} |
|
|
|
@Override |
|
protected TreeEditor updateSubFieldEditorBean() { |
|
TreeEditor editor = new TreeEditor(); |
|
editor.setBuildModelConfig(accessibleTreeModelEditor.getValue()); |
|
editor.setTreeAttr(treeRootPane.update()); |
|
if (this.removeRepeatCheckBox != null) { |
|
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected()); |
|
} |
|
return editor; |
|
} |
|
|
|
@Override |
|
protected JPanel setFirstContentPane() { |
|
return this.setSecondContentPane(); |
|
} |
|
|
|
protected JPanel setSecondContentPane() { |
|
accessibleTreeModelEditor = new AccessibleTreeModelEditor(); |
|
JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); |
|
createTree.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
contentPane.add(contenter,BorderLayout.NORTH); |
|
removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Repeat_Data"), false); |
|
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); |
|
} |
|
return contentPane; |
|
} |
|
|
|
protected JPanel setThirdContentPane() { |
|
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
treeRootPane = new TreeRootPane(); |
|
content.add(treeRootPane, BorderLayout.NORTH); |
|
return content; |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return "tree"; |
|
} |
|
|
|
@Override |
|
public DataCreatorUI dataUI() { |
|
return null; |
|
} |
|
} |