changeset 11635:3f8bb25fb0a1

IGV: workaround for disappearing search bar.
author Andreas Woess <andreas.woess@jku.at>
date Sat, 14 Sep 2013 20:30:47 +0200
parents bff2b88444f5
children 136eaa90ef41
files src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java	Sat Sep 14 17:31:25 2013 -0400
+++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java	Sat Sep 14 20:30:47 2013 +0200
@@ -69,7 +69,7 @@
 import org.openide.windows.WindowManager;
 
 /**
- * 
+ *
  * @author Thomas Wuerthinger
  */
 public final class EditorTopComponent extends TopComponent implements PropertyChangeListener {
@@ -140,7 +140,7 @@
     };
 
     private ChangedEvent<DiagramProvider> diagramChangedEvent = new ChangedEvent<>(diagramProvider);
-    
+
 
     private void updateDisplayName() {
         setDisplayName(getDiagram().getName());
@@ -254,6 +254,11 @@
         toolBar.add(Box.createHorizontalGlue());
         Action action = Utilities.actionsForPath("QuickSearchShadow").get(0);
         Component quicksearch = ((Presenter.Toolbar) action).getToolbarPresenter();
+        try {
+            // (aw) workaround for disappearing search bar due to reparenting one shared component instance.
+            quicksearch = (Component) quicksearch.getClass().getConstructor(KeyStroke.class).newInstance(new Object[]{null});
+        } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
+        }
         quicksearch.setMinimumSize(quicksearch.getPreferredSize()); // necessary for GTK LAF
         toolBar.add(quicksearch);
 
@@ -420,7 +425,7 @@
             graphContent.set(list, null);
             diagramProvider.getChangedEvent().fire();
         }
-        
+
     };
 
     public boolean showPredSucc() {