Added menu options to toggle the visibility of Trick View panes.

This currently doesn't work 100% properly. It will toggle fine, but when showing the panels it starts them collapsed. Resizing the pane causes them to appear for some reason.
This commit is contained in:
Christopher LaChance 2017-06-13 11:50:30 -05:00 committed by dbankieris
parent 7171288aa8
commit 70369fdb71

View File

@ -370,6 +370,22 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
}
};
// CTL Actions
protected void toggleTreePane() {
if(variableTree.getParent().getParent().isVisible()) {
variableTree.getParent().getParent().setVisible(false);
}
else {
variableTree.getParent().getParent().setVisible(true);
}
}
protected void toggleSearchPane() {
if(searchPanel.isVisible())
searchPanel.setVisible(false);
else
searchPanel.setVisible(true);
}
@Override
protected void initialize(final String[] args) {
@ -1599,6 +1615,25 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
add(new JMenuItem(clearLogsAction));
}}, 1);
//CTL
menuBar.add(new JMenu("View") {{
add(new JMenuItem("Toggle Tree Pane") {{
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
toggleTreePane();
}
});
}});
add(new JMenuItem("Toggle Search Pane") {{
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
toggleSearchPane();
}
});
}});
}}, 1);
return menuBar;
}