|
|
@ -10,11 +10,9 @@ import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; |
|
|
|
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; |
|
|
|
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; |
|
|
|
import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.gui.ilist.JNameEdList; |
|
|
|
import com.fr.design.gui.ilist.JNameEdList; |
|
|
|
import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.menu.LineSeparator; |
|
|
|
import com.fr.design.menu.LineSeparator; |
|
|
@ -43,19 +41,8 @@ import java.util.Comparator; |
|
|
|
|
|
|
|
|
|
|
|
public abstract class JListControlPane extends JControlPane { |
|
|
|
public abstract class JListControlPane extends JControlPane { |
|
|
|
public static final String LIST_NAME = "JControl_List"; |
|
|
|
public static final String LIST_NAME = "JControl_List"; |
|
|
|
private static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ShortCut4JControlPane[] shorts; |
|
|
|
|
|
|
|
private NameableCreator[] creators; |
|
|
|
|
|
|
|
protected JNameEdList nameableList; |
|
|
|
protected JNameEdList nameableList; |
|
|
|
protected JControlUpdatePane controlUpdatePane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ToolBarDef toolbarDef; |
|
|
|
|
|
|
|
private UIToolbar toolBar; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// peter:这是整体的一个cardLayout Pane
|
|
|
|
|
|
|
|
private CardLayout cardLayout; |
|
|
|
|
|
|
|
private JPanel cardPane; |
|
|
|
|
|
|
|
protected int editingIndex; |
|
|
|
protected int editingIndex; |
|
|
|
protected String selectedName; |
|
|
|
protected String selectedName; |
|
|
|
private boolean isNameRepeated = false; |
|
|
|
private boolean isNameRepeated = false; |
|
|
@ -64,35 +51,17 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
this.initComponentPane(); |
|
|
|
this.initComponentPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createControlUpdatePane() { |
|
|
|
|
|
|
|
return new JControlUpdatePane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 生成添加按钮的NameableCreator |
|
|
|
* 生成添加按钮的NameableCreator |
|
|
|
|
|
|
|
* |
|
|
|
* @return 按钮的NameableCreator |
|
|
|
* @return 按钮的NameableCreator |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract NameableCreator[] createNameableCreators(); |
|
|
|
public abstract NameableCreator[] createNameableCreators(); |
|
|
|
|
|
|
|
|
|
|
|
protected void initComponentPane() { |
|
|
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
this.creators = this.createNameableCreators(); |
|
|
|
|
|
|
|
this.controlUpdatePane = new JControlUpdatePane(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// p: edit card layout
|
|
|
|
|
|
|
|
this.cardLayout = new CardLayout(); |
|
|
|
|
|
|
|
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
|
|
|
|
cardPane.setLayout(this.cardLayout); |
|
|
|
|
|
|
|
// p:选择的Label
|
|
|
|
|
|
|
|
UILabel selectLabel = new UILabel(); |
|
|
|
|
|
|
|
cardPane.add(selectLabel, "SELECT"); |
|
|
|
|
|
|
|
cardPane.add(controlUpdatePane, "EDIT"); |
|
|
|
|
|
|
|
// SplitPane
|
|
|
|
|
|
|
|
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane); |
|
|
|
|
|
|
|
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor())); |
|
|
|
|
|
|
|
mainSplitPane.setOneTouchExpandable(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.add(mainSplitPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
mainSplitPane.setDividerLocation(getLeftPreferredSize()); |
|
|
|
|
|
|
|
this.checkButtonEnabled(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLeftPane() { |
|
|
|
protected JPanel getLeftPane() { |
|
|
|
// LeftPane
|
|
|
|
// LeftPane
|
|
|
@ -132,8 +101,8 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
if (hasInvalid(false)) { |
|
|
|
if (hasInvalid(false)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
JListControlPane.this.controlUpdatePane.update(); |
|
|
|
((JControlUpdatePane) JListControlPane.this.controlUpdatePane).update(); |
|
|
|
JListControlPane.this.controlUpdatePane.populate(); |
|
|
|
((JControlUpdatePane) JListControlPane.this.controlUpdatePane).populate(); |
|
|
|
JListControlPane.this.checkButtonEnabled(); |
|
|
|
JListControlPane.this.checkButtonEnabled(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -151,7 +120,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateControlUpdatePane() { |
|
|
|
public void updateControlUpdatePane() { |
|
|
|
controlUpdatePane.update(); |
|
|
|
((JControlUpdatePane) controlUpdatePane).update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void doWhenPopulate(BasicBeanPane beanPane) { |
|
|
|
protected void doWhenPopulate(BasicBeanPane beanPane) { |
|
|
@ -159,7 +128,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected int getLeftPreferredSize() { |
|
|
|
protected int getLeftPreferredSize() { |
|
|
|
return shorts.length * SHORT_WIDTH; |
|
|
|
return shorts.length * JControlPane.SHORT_WIDTH; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected ShortCut4JControlPane[] createShortcuts() { |
|
|
|
protected ShortCut4JControlPane[] createShortcuts() { |
|
|
@ -209,7 +178,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
|
|
|
|
|
|
|
|
public Nameable[] update() { |
|
|
|
public Nameable[] update() { |
|
|
|
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>(); |
|
|
|
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>(); |
|
|
|
this.controlUpdatePane.update(); |
|
|
|
((JControlUpdatePane) this.controlUpdatePane).update(); |
|
|
|
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); |
|
|
|
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); |
|
|
|
for (int i = 0, len = listModel.getSize(); i < len; i++) { |
|
|
|
for (int i = 0, len = listModel.getSize(); i < len; i++) { |
|
|
|
res.add(((ListModelElement) listModel.getElementAt(i)).wrapper); |
|
|
|
res.add(((ListModelElement) listModel.getElementAt(i)).wrapper); |
|
|
@ -257,7 +226,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
* 刷新当前的选中的UpdatePane |
|
|
|
* 刷新当前的选中的UpdatePane |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void populateSelectedValue() { |
|
|
|
protected void populateSelectedValue() { |
|
|
|
JListControlPane.this.controlUpdatePane.populate(); |
|
|
|
((JControlUpdatePane) JListControlPane.this.controlUpdatePane).populate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -327,6 +296,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 名字是否重复 |
|
|
|
* 名字是否重复 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 重复则返回true |
|
|
|
* @return 重复则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isNameRepeated() { |
|
|
|
public boolean isNameRepeated() { |
|
|
@ -353,6 +323,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否重命名 |
|
|
|
* 是否重命名 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是则true |
|
|
|
* @return 是则true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isContainsRename() { |
|
|
|
public boolean isContainsRename() { |
|
|
@ -542,7 +513,7 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
controlUpdatePane.update(); |
|
|
|
((JControlUpdatePane) controlUpdatePane).update(); |
|
|
|
|
|
|
|
|
|
|
|
Nameable selectedNameable = selectedValue.wrapper; |
|
|
|
Nameable selectedNameable = selectedValue.wrapper; |
|
|
|
|
|
|
|
|
|
|
@ -983,11 +954,11 @@ public abstract class JListControlPane extends JControlPane { |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void checkValid() throws Exception { |
|
|
|
public void checkValid() throws Exception { |
|
|
|
this.controlUpdatePane.checkValid(); |
|
|
|
((JControlUpdatePane) this.controlUpdatePane).checkValid(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int getInValidIndex() { |
|
|
|
private int getInValidIndex() { |
|
|
|
BasicBeanPane[] p = controlUpdatePane.updatePanes; |
|
|
|
BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).updatePanes; |
|
|
|
if (p != null) { |
|
|
|
if (p != null) { |
|
|
|
for (int i = 0; i < p.length; i++) { |
|
|
|
for (int i = 0; i < p.length; i++) { |
|
|
|
if (p[i] != null) { |
|
|
|
if (p[i] != null) { |
|
|
|