public void addItemListener(ItemListener listener, KeyStoreType ... types) { for(KeyStoreType type: types) { switch(type) { case JKS: jrb_jks.addItemListener(listener); break; case PKCS12: jrb_pkcs12.addItemListener(listener); break; case PEM: jrb_pem.addItemListener(listener); break; default: throw new IllegalArgumentException("Unknown keystore-type: " + type); } } } }
modesPanel.add(singleCheckbox); checkboxGroup.add(singleCheckbox); singleCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged (ItemEvent e) { modesPanel.add(randomCheckbox); checkboxGroup.add(randomCheckbox); randomCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged (ItemEvent e) { modesPanel.add(animatedCheckbox); checkboxGroup.add(animatedCheckbox); animatedCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged (ItemEvent e) {
modesPanel.add(singleCheckbox); checkboxGroup.add(singleCheckbox); singleCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged (ItemEvent e) { modesPanel.add(randomCheckbox); checkboxGroup.add(randomCheckbox); randomCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged (ItemEvent e) { modesPanel.add(animatedCheckbox); checkboxGroup.add(animatedCheckbox); animatedCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged (ItemEvent e) {
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (value == null) return null; button = (JRadioButton) value; button.addItemListener(this); return (Component) value; }
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (value == null) return null; button = (JRadioButton) value; button.addItemListener(this); return (Component) value; }
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (value == null) return null; button = (JRadioButton) value; button.addItemListener(this); return (Component) value; }
@Override protected void setupListener() { button.addItemListener(this); }
private void initCodeCompletionForVariables() { VariablesScope variablesScope = VariablesScope.resolve(preferences.get(PHP_CODE_COMPLETION_VARIABLES_SCOPE, null)); switch (variablesScope) { case ALL: allVariablesRadioButton.setSelected(true); break; case CURRENT_FILE: currentFileVariablesRadioButton.setSelected(true); break; default: throw new IllegalArgumentException("Unknown variables scope: " + variablesScope); } allVariablesRadioButton.addItemListener(defaultRadioButtonListener); currentFileVariablesRadioButton.addItemListener(defaultRadioButtonListener); }
private void createPacUrlProxy(JPanel panel, ButtonGroup group) { pacUrlProxy = new JRadioButton("Automatic proxy configuration URL"); group.add(pacUrlProxy); panel.add(pacUrlProxy); pacUrlProxy.addItemListener(this); JPanel pacUrlPanel = new HorizontalPanel(); pacUrl = new JTextField(); pacUrl.setEnabled(false); pacUrlPanel.add(pacUrl, BorderLayout.CENTER); pacUrlPanel.setBorder(BorderFactory.createEmptyBorder(0, PROXY_FIELD_INDENT, 0, 0)); panel.add(pacUrlPanel); }
// Formats the item for the display... protected String toString(Item item) { return item.getText() + " (" + NumberFormat.getCurrencyInstance().format(item.getPrice()) + ")"; } // Creates a radio button for the specified Item... protected JRadioButton createRadioButton(ButtonGroup group, Item item) { JRadioButton rb = new JRadioButton(toString(item)); rb.addItemListener(new ItemHandler(order, item)); group.add(rb); return rb; }
/** Creates new form DependantOriginalColorPanel */ public DependantOriginalColorPanel() { initComponents(); colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { Color newColor = (Color) evt.getNewValue(); propertyEditor.setValue(new DependantOriginalColor(newColor)); } }); originalRadio.addItemListener(this); parentRadio.addItemListener(this); customRadio.addItemListener(this); }
/** Creates new form DependantColorPanel */ public DependantColorPanel() { initComponents(); colorButton.addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { Color newColor = (Color) evt.getNewValue(); propertyEditor.setValue(new DependantColor(newColor)); } }); parentRadio.addItemListener(this); customRadio.addItemListener(this); }
/** * Constructor, using a group of option radio buttons to control the collapsible panel. The buttons should be * created, grouped, and then used to construct their own collapsible panels. * * @param component Radio button that expands and collapses the panel based on if it is selected or not */ public CollapsiblePanel(JRadioButton component) { component.addItemListener(new CollapsiblePanel.ExpandAndCollapseAction()); titleComponent = component; collapsed = !component.isSelected(); commonConstructor(); }
private void bgAdd (String name, int y) { JRadioButton rb = new JRadioButton (name); rb.setLocation (0, y); rb.addItemListener (this); rb.setSize (110, 19); bg1.add (rb); radioPanel.add (rb); }
/** * Constructor for an option button controlled collapsable panel. * This is useful when a group of options each have unique sub contents. The radio buttons should be created, * grouped, and then used to construct their own collapsable panels. This way choosing a different option in * the same option group will collapse all unselected options. Expanded panels draw a border around the * contents and through the radio button in the fashion of a titled border. * * @param component Radio button that expands and collapses the panel based on if it is selected or not */ public CollapsiblePanel(JRadioButton component) { component.addItemListener(new CollapsiblePanel.ExpandAndCollapseAction()); titleComponent = component; collapsed = !component.isSelected(); commonConstructor(); }
/** * Constructor for an option button controlled collapsable panel. * This is useful when a group of options each have unique sub contents. The radio buttons should be created, * grouped, and then used to construct their own collapsable panels. This way choosing a different option in * the same option group will collapse all unselected options. Expanded panels draw a border around the * contents and through the radio button in the fashion of a titled border. * * @param component Radio button that expands and collapses the panel based on if it is selected or not */ public CollapsiblePanel(JRadioButton component) { component.addItemListener(new CollapsiblePanel.ExpandAndCollapseAction()); titleComponent = component; collapsed = !component.isSelected(); commonConstructor(); }
/** * Constructor for an option button controlled collapsable panel. * This is useful when a group of options each have unique sub contents. The radio buttons should be created, * grouped, and then used to construct their own collapsable panels. This way choosing a different option in * the same option group will collapse all unselected options. Expanded panels draw a border around the * contents and through the radio button in the fashion of a titled border. * * @param component Radio button that expands and collapses the panel based on if it is selected or not */ public CyCollapsiblePanel(JRadioButton component) { component.addItemListener(new CyCollapsiblePanel.ExpandAndCollapseAction()); titleComponent = component; collapsed = !component.isSelected(); commonConstructor(); }
/** * Constructor for an option button controlled collapsable panel. * This is useful when a group of options each have unique sub contents. The radio buttons should be created, * grouped, and then used to construct their own collapsable panels. This way choosing a different option in * the same option group will collapse all unselected options. Expanded panels draw a border around the * contents and through the radio button in the fashion of a titled border. * * @param component Radio button that expands and collapses the panel based on if it is selected or not */ public CollapsiblePanel(JRadioButton component) { component.addItemListener(new CollapsiblePanel.ExpandAndCollapseAction()); titleComponent = component; collapsed = !component.isSelected(); commonConstructor(); }
protected void createFieldSpeciesDynamicAge() { $objectMap.put("fieldSpeciesDynamicAge", fieldSpeciesDynamicAge = new JRadioButton()); fieldSpeciesDynamicAge.setName("fieldSpeciesDynamicAge"); fieldSpeciesDynamicAge.setText(t("isisfish.species.age")); fieldSpeciesDynamicAge.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__fieldSpeciesDynamicAge")); }
/** Creates new form DebugProjectPanel */ public DebugProjectPanel(Project project) { this.project = project; initComponentMessages(project); initComponents(); this.ffBrowserSupported = WebClientToolsProjectUtils.isFirefoxSupported(); this.ieBrowserSupported = WebClientToolsProjectUtils.isInternetExplorerSupported(); adjustBrowserRadioButtons(true); clientServerRadioButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { adjustBrowserRadioButtons(false); } }); }