Link Here
|
78 |
import org.openide.nodes.NodeMemberEvent; |
78 |
import org.openide.nodes.NodeMemberEvent; |
79 |
import org.openide.nodes.NodeReorderEvent; |
79 |
import org.openide.nodes.NodeReorderEvent; |
80 |
import org.openide.util.Exceptions; |
80 |
import org.openide.util.Exceptions; |
|
|
81 |
import org.openide.util.ImageUtilities; |
81 |
import org.openide.util.NbBundle; |
82 |
import org.openide.util.NbBundle; |
82 |
import org.openide.util.Task; |
83 |
import org.openide.util.Task; |
83 |
import org.openide.util.Utilities; |
84 |
import org.openide.util.Utilities; |
Link Here
|
506 |
} |
507 |
} |
507 |
|
508 |
|
508 |
private void updateProps() { |
509 |
private void updateProps() { |
509 |
if (master.isValid()) { |
510 |
Object prev = DONT_BLOCK.get(); |
510 |
// set the text and be aware of mnemonics |
511 |
try { |
511 |
Node n = master.getNodeDelegate (); |
512 |
DONT_BLOCK.set(Boolean.TRUE); |
512 |
Mnemonics.setLocalizedText(this, n.getDisplayName()); |
513 |
if (master.isValid()) { |
513 |
if (icon) setIcon (new ImageIcon ( |
514 |
// set the text and be aware of mnemonics |
514 |
n.getIcon (java.beans.BeanInfo.ICON_COLOR_16x16))); |
515 |
Node n = master.getNodeDelegate (); |
515 |
} else { |
516 |
Mnemonics.setLocalizedText(this, n.getDisplayName()); |
516 |
setText(master.getName()); |
517 |
if (icon) { |
517 |
setIcon(null); |
518 |
setIcon (ImageUtilities.image2Icon( |
|
|
519 |
n.getIcon (java.beans.BeanInfo.ICON_COLOR_16x16) |
520 |
)); |
521 |
} |
522 |
} else { |
523 |
setText(master.getName()); |
524 |
setIcon(null); |
525 |
} |
526 |
} finally { |
527 |
DONT_BLOCK.set(prev); |
518 |
} |
528 |
} |
519 |
} |
529 |
} |
520 |
|
530 |
|
Link Here
|
554 |
selected = true; |
564 |
selected = true; |
555 |
doInitialize(); |
565 |
doInitialize(); |
556 |
dynaModel.checkSubmenu(this); |
566 |
dynaModel.checkSubmenu(this); |
557 |
|
|
|
558 |
} |
567 |
} |
559 |
} |
568 |
} |
560 |
|
569 |
|
Link Here
|
576 |
// } |
585 |
// } |
577 |
// super.setPopupMenuVisible(b); |
586 |
// super.setPopupMenuVisible(b); |
578 |
// } |
587 |
// } |
579 |
|
588 |
|
|
|
589 |
private static ThreadLocal DONT_BLOCK = new ThreadLocal(); |
580 |
private void doInitialize() { |
590 |
private void doInitialize() { |
|
|
591 |
if (Boolean.TRUE.equals(DONT_BLOCK.get())) { |
592 |
return; |
593 |
} |
581 |
slave.waitFinishedSuper(); |
594 |
slave.waitFinishedSuper(); |
582 |
} |
595 |
} |
583 |
|
596 |
|