Example usage for javax.swing JCheckBoxMenuItem setActionCommand

List of usage examples for javax.swing JCheckBoxMenuItem setActionCommand

Introduction

In this page you can find the example usage for javax.swing JCheckBoxMenuItem setActionCommand.

Prototype

public void setActionCommand(String actionCommand) 

Source Link

Document

Sets the action command for this button.

Usage

From source file:it.unibas.spicygui.controllo.provider.MyPopupProviderJoinCondition.java

private void createPopupMenu() {
    bindingGroup = new BindingGroup();

    menu = new JPopupMenu("Popup menu");
    JMenuItem item1;/* w  w  w. j  ava2  s  .  com*/
    JCheckBoxMenuItem item2;
    JCheckBoxMenuItem item3;
    JCheckBoxMenuItem item4;

    item1 = new JMenuItem(NbBundle.getMessage(Costanti.class, Costanti.GENERIC_DELETE));
    item1.setActionCommand(DELETE);
    item1.addActionListener(this);

    item2 = new JCheckBoxMenuItem(NbBundle.getMessage(Costanti.class, Costanti.TOGGLE_MANDATORY));
    Binding binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, joinCondition,
            ELProperty.create("${mandatory}"), item2, BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);
    item2.setActionCommand(TOGGLE_MANDATORY);
    item2.addActionListener(this);

    item3 = new JCheckBoxMenuItem(NbBundle.getMessage(Costanti.class, Costanti.TOGGLE_FOREIGN));
    Binding binding2 = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, joinCondition,
            ELProperty.create("${monodirectional}"), item3, BeanProperty.create("selected"));
    bindingGroup.addBinding(binding2);
    item3.setActionCommand(TOGGLE_FOREIGN);
    item3.addActionListener(this);

    item4 = new JCheckBoxMenuItem(NbBundle.getMessage(Costanti.class, Costanti.TOGGLE_MATCH_STRING));
    Binding binding3 = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, joinCondition,
            ELProperty.create("${matchString}"), item4, BeanProperty.create("selected"));
    bindingGroup.addBinding(binding3);
    item4.setActionCommand(TOGGLE_MATCH_STRING);
    item4.addActionListener(this);

    menu.add(item1);
    menu.add(item2);
    menu.add(item3);
    menu.add(item4);

    bindingGroup.bind();
}

From source file:org.executequery.gui.editor.QueryEditorPopupMenu.java

private JMenuItem createUseKeywordAutoComplete() {

    JCheckBoxMenuItem menuItem = MenuItemFactory.createCheckBoxMenuItem(action());
    menuItem.setText("Auto-complete keywords");
    menuItem.setSelected(SystemProperties.getBooleanProperty(Constants.USER_PROPERTIES_KEY,
            "editor.autocomplete.keywords.on"));
    menuItem.setActionCommand("updateAutoCompleteKeywordUsage");
    executeActionButtons().add(menuItem);
    return menuItem;
}

From source file:org.executequery.gui.editor.QueryEditorPopupMenu.java

private JMenuItem createUseSchemaAutoComplete() {

    JCheckBoxMenuItem menuItem = MenuItemFactory.createCheckBoxMenuItem(action());
    menuItem.setText("Auto-complete database objects");
    menuItem.setSelected(SystemProperties.getBooleanProperty(Constants.USER_PROPERTIES_KEY,
            "editor.autocomplete.schema.on"));
    menuItem.setActionCommand("updateAutoCompleteSchemaUsage");
    executeActionButtons().add(menuItem);
    return menuItem;
}

From source file:org.executequery.gui.editor.QueryEditorPopupMenu.java

private JMenuItem createRecycleResultSetTabMenuItem() {
    JCheckBoxMenuItem menuItem = MenuItemFactory.createCheckBoxMenuItem(action());
    menuItem.setText("Use single resut set tab");
    menuItem.setSelected(UserPreferencesManager.isResultSetTabSingle());
    menuItem.setActionCommand("recycleResultSetTabs");
    executeActionButtons().add(menuItem);
    return menuItem;
}

From source file:org.executequery.gui.editor.QueryEditorPopupMenu.java

private JMenuItem createShowHideToolsPanelMenuItem() {
    JCheckBoxMenuItem menuItem = MenuItemFactory.createCheckBoxMenuItem(action());
    menuItem.setText("Display tools panel");
    menuItem.setSelected(//from w w  w  .  j  a  v a2  s.  com
            SystemProperties.getBooleanProperty(Constants.USER_PROPERTIES_KEY, "editor.display.toolsPanel"));
    menuItem.setActionCommand("toggleToolsPanelVisible");
    executeActionButtons().add(menuItem);
    return menuItem;
}

From source file:org.executequery.gui.editor.QueryEditorPopupMenu.java

private JMenuItem createShowRowNumberHeaderMenuItem() {
    JCheckBoxMenuItem menuItem = MenuItemFactory.createCheckBoxMenuItem(action());
    menuItem.setText("Show row number header ");
    menuItem.setSelected(// w w  w  .j  a v  a 2 s.c o  m
            SystemProperties.getBooleanProperty(Constants.USER_PROPERTIES_KEY, "results.table.row.numbers"));
    menuItem.setActionCommand("toggleRowNumbersVisible");
    executeActionButtons().add(menuItem);
    return menuItem;
}

From source file:org.executequery.gui.editor.QueryEditorPopupMenu.java

private JMenuItem createRemoveCommentsForQueryMenuItem() {
    JCheckBoxMenuItem menuItem = MenuItemFactory.createCheckBoxMenuItem(action());
    menuItem.setText("Remove comments for execution");
    menuItem.setSelected(SystemProperties.getBooleanProperty(Constants.USER_PROPERTIES_KEY,
            "editor.execute.remove.comments"));
    menuItem.setActionCommand("removeCommentsPriorToQueryExecution");
    executeActionButtons().add(menuItem);
    return menuItem;
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.AnnotationDataUI.java

/**
 * Creates a menu item.//from  w  w w .  j  a v  a 2  s .  c  om
 * 
 * @param index The index associated to the item.
 * @return See above.
 */
private JCheckBoxMenuItem createMenuItem(int index) {
    JCheckBoxMenuItem item = new JCheckBoxMenuItem(NAMES[index]);
    Font f = item.getFont();
    item.setFont(f.deriveFont(f.getStyle(), f.getSize() - 2));
    item.setSelected(filter == index);
    item.addActionListener(this);
    item.setActionCommand("" + index);
    return item;
}