Browse Source

Merge pull request #572 in BA/design from ~XIAOHU/design:dev to dev

* commit 'e5425abb440e5898e4aab78df86a8d082e8e1900':
  下拉树自定义是否可选择接口
master
superman 8 years ago
parent
commit
968c22e0d6
  1. 15
      designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java

15
designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -91,6 +91,15 @@ public class FRTreeComboBox extends UIComboBox {
return this.tree;
}
/**
* 自定义那些那些node可以选中默认情况下所有node节点都可以选中
* @param node
* @return
*/
protected boolean customSelectable(DefaultMutableTreeNode node){
return true;
}
public void setTree(JTree tree) {
this.tree = tree;
if (tree != null) {
@ -403,6 +412,12 @@ public class FRTreeComboBox extends UIComboBox {
if (comboBox.onlyLeafSelectable && !node.isLeaf()) {
return;
}
//自定义node是否可选择
if (!comboBox.customSelectable(node)){
return;
}
comboBox.setSelectedItem(treePath);
togglePopup();
MenuSelectionManager.defaultManager().clearSelectedPath();

Loading…
Cancel
Save