zhouping 8 years ago
parent
commit
63c4ca272c
  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