Changed the view menu items into checkbox menu items.

The two view menu toggles are now checkbox menu items. The default state is enabled and is toggled when the option is selected.
This commit is contained in:
Christopher LaChance 2017-06-16 12:31:40 -05:00 committed by dbankieris
parent 70369fdb71
commit 12e74744b6

View File

@ -43,6 +43,7 @@ import javax.swing.Box;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JDialog; import javax.swing.JDialog;
@ -378,6 +379,7 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
else { else {
variableTree.getParent().getParent().setVisible(true); variableTree.getParent().getParent().setVisible(true);
} }
} }
protected void toggleSearchPane() { protected void toggleSearchPane() {
@ -1617,7 +1619,7 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
//CTL //CTL
menuBar.add(new JMenu("View") {{ menuBar.add(new JMenu("View") {{
add(new JMenuItem("Toggle Tree Pane") {{ add(new JCheckBoxMenuItem("Toggle Tree Pane", true) {{
addActionListener(new ActionListener() { addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
toggleTreePane(); toggleTreePane();
@ -1625,7 +1627,7 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
}); });
}}); }});
add(new JMenuItem("Toggle Search Pane") {{ add(new JCheckBoxMenuItem("Toggle Search Pane", true) {{
addActionListener(new ActionListener() { addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
toggleSearchPane(); toggleSearchPane();