Skip to content

Commit 4946737

Browse files
8297047: IGV: graphContent not set when opening a new tab
Reviewed-by: chagedorn, rcastanedalo
1 parent 8b1ff9e commit 4946737

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ public EditorTopComponent(InputGraph graph) {
148148
setToolTipText(diagramViewModel.getGroup().getDisplayName());
149149
});
150150

151-
diagramViewModel.getGraphChangedEvent().addListener(model -> {
152-
setDisplayName(model.getGraph().getDisplayName());
153-
setToolTipText(model.getGroup().getDisplayName());
154-
graphContent.set(Collections.singletonList(new EditorInputGraphProvider(this)), null);
155-
});
151+
diagramViewModel.getGraphChangedEvent().addListener(model -> graphChanged(model));
156152

157153
cardLayout = new CardLayout();
158154
centerPanel = new JPanel();
@@ -244,6 +240,14 @@ public void mouseMoved(MouseEvent e) {}
244240
topPanel.add(toolbarPanel);
245241
topPanel.add(quickSearchToolbar);
246242
container.add(BorderLayout.NORTH, topPanel);
243+
244+
graphChanged(diagramViewModel);
245+
}
246+
247+
private void graphChanged(DiagramViewModel model) {
248+
setDisplayName(model.getGraph().getDisplayName());
249+
setToolTipText(model.getGroup().getDisplayName());
250+
graphContent.set(Collections.singletonList(new EditorInputGraphProvider(this)), null);
247251
}
248252

249253
public DiagramViewModel getModel() {

0 commit comments

Comments
 (0)