Search in sources :

Example 71 with ItemListener

use of java.awt.event.ItemListener in project qi4j-sdk by Qi4j.

the class EntityViewer method initUI.

private void initUI() {
    propertiesPanel = new PropertiesPanel();
    propertiesPanel.initializeQi4J(qi4jspi);
    propertiesAreaPane.add(propertiesPanel, BorderLayout.CENTER);
    treePanel = new TreePanel();
    treePanel.initializeQi4J(qi4jspi, model);
    treePanel.reload();
    splitPane.setLeftComponent(treePanel);
    splitPane.setDividerLocation(200);
    DefaultComboBoxModel entityComboModel = new DefaultComboBoxModel();
    entitiesCombo.setModel(entityComboModel);
    entitiesCombo.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent evt) {
            entitiesComboItemStateChanged(evt);
        }
    });
    treePanel.getTreeComponent().addTreeSelectionListener(new TreeSelectionListener() {

        @Override
        public void valueChanged(TreeSelectionEvent evt) {
            treePanelValueChanged(evt);
        }
    });
    initEntityCombo(entityComboModel);
}
Also used : ItemEvent(java.awt.event.ItemEvent) ItemListener(java.awt.event.ItemListener) TreeSelectionListener(javax.swing.event.TreeSelectionListener) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent)

Example 72 with ItemListener

use of java.awt.event.ItemListener in project jadx by skylot.

the class SearchDialog method makeOptionsCheckBox.

private JCheckBox makeOptionsCheckBox(String name, final SearchOptions opt) {
    final JCheckBox chBox = new JCheckBox(name);
    chBox.setAlignmentX(LEFT_ALIGNMENT);
    chBox.setSelected(options.contains(opt));
    chBox.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            if (chBox.isSelected()) {
                options.add(opt);
            } else {
                options.remove(opt);
            }
            performSearch();
        }
    });
    return chBox;
}
Also used : JCheckBox(javax.swing.JCheckBox) ItemEvent(java.awt.event.ItemEvent) ItemListener(java.awt.event.ItemListener)

Example 73 with ItemListener

use of java.awt.event.ItemListener in project jadx by skylot.

the class JadxSettingsWindow method makeOtherGroup.

private SettingsGroup makeOtherGroup() {
    JCheckBox update = new JCheckBox();
    update.setSelected(settings.isCheckForUpdates());
    update.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            settings.setCheckForUpdates(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    JCheckBox cfg = new JCheckBox();
    cfg.setSelected(settings.isCFGOutput());
    cfg.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            settings.setCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
            needReload();
        }
    });
    JCheckBox rawCfg = new JCheckBox();
    rawCfg.setSelected(settings.isRawCFGOutput());
    rawCfg.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            settings.setRawCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
            needReload();
        }
    });
    SettingsGroup other = new SettingsGroup(NLS.str("preferences.other"));
    other.addRow(NLS.str("preferences.check_for_updates"), update);
    other.addRow(NLS.str("preferences.cfg"), cfg);
    other.addRow(NLS.str("preferences.raw_cfg"), rawCfg);
    return other;
}
Also used : JCheckBox(javax.swing.JCheckBox) ItemEvent(java.awt.event.ItemEvent) ItemListener(java.awt.event.ItemListener)

Example 74 with ItemListener

use of java.awt.event.ItemListener in project jadx by skylot.

the class JadxSettingsWindow method makeDeobfuscationGroup.

private SettingsGroup makeDeobfuscationGroup() {
    JCheckBox deobfOn = new JCheckBox();
    deobfOn.setSelected(settings.isDeobfuscationOn());
    deobfOn.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            settings.setDeobfuscationOn(e.getStateChange() == ItemEvent.SELECTED);
            needReload();
        }
    });
    JCheckBox deobfForce = new JCheckBox();
    deobfForce.setSelected(settings.isDeobfuscationForceSave());
    deobfForce.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            settings.setDeobfuscationForceSave(e.getStateChange() == ItemEvent.SELECTED);
            needReload();
        }
    });
    final JSpinner minLen = new JSpinner();
    minLen.setValue(settings.getDeobfuscationMinLength());
    minLen.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            settings.setDeobfuscationMinLength((Integer) minLen.getValue());
            needReload();
        }
    });
    final JSpinner maxLen = new JSpinner();
    maxLen.setValue(settings.getDeobfuscationMaxLength());
    maxLen.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            settings.setDeobfuscationMaxLength((Integer) maxLen.getValue());
            needReload();
        }
    });
    JCheckBox deobfSourceAlias = new JCheckBox();
    deobfSourceAlias.setSelected(settings.useSourceNameAsClassAlias());
    deobfSourceAlias.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            settings.setUseSourceNameAsClassAlias(e.getStateChange() == ItemEvent.SELECTED);
            needReload();
        }
    });
    SettingsGroup deobfGroup = new SettingsGroup(NLS.str("preferences.deobfuscation"));
    deobfGroup.addRow(NLS.str("preferences.deobfuscation_on"), deobfOn);
    deobfGroup.addRow(NLS.str("preferences.deobfuscation_force"), deobfForce);
    deobfGroup.addRow(NLS.str("preferences.deobfuscation_min_len"), minLen);
    deobfGroup.addRow(NLS.str("preferences.deobfuscation_max_len"), maxLen);
    deobfGroup.addRow(NLS.str("preferences.deobfuscation_source_alias"), deobfSourceAlias);
    deobfGroup.end();
    return deobfGroup;
}
Also used : JCheckBox(javax.swing.JCheckBox) ItemEvent(java.awt.event.ItemEvent) ChangeEvent(javax.swing.event.ChangeEvent) JSpinner(javax.swing.JSpinner) ItemListener(java.awt.event.ItemListener) ChangeListener(javax.swing.event.ChangeListener)

Example 75 with ItemListener

use of java.awt.event.ItemListener in project azure-tools-for-java by Microsoft.

the class ApplicationInsightsNewDialog method init.

protected void init() {
    super.init();
    comboSub.addItemListener(subscriptionListener());
    final ButtonGroup resourceGroup = new ButtonGroup();
    resourceGroup.add(createNewBtn);
    resourceGroup.add(useExistingBtn);
    final ItemListener updateListener = new ItemListener() {

        public void itemStateChanged(final ItemEvent e) {
            final boolean isNewGroup = createNewBtn.isSelected();
            textGrp.setEnabled(isNewGroup);
            comboGrp.setEnabled(!isNewGroup);
        }
    };
    createNewBtn.addItemListener(updateListener);
    useExistingBtn.addItemListener(updateListener);
    //        comboReg.setRenderer(new ListCellRendererWrapper<Object>() {
    //
    //            @Override
    //            public void customize(JList jList, Object o, int i, boolean b, boolean b1) {
    //                if (o != null && (o instanceof Location)) {
    //                    setText("  " + ((Location)o).displayName());
    //                }
    //            }
    //        });
    createNewBtn.setSelected(true);
    populateValues();
}
Also used : ItemEvent(java.awt.event.ItemEvent) ItemListener(java.awt.event.ItemListener)

Aggregations

ItemListener (java.awt.event.ItemListener)120 ItemEvent (java.awt.event.ItemEvent)119 ActionEvent (java.awt.event.ActionEvent)34 ActionListener (java.awt.event.ActionListener)31 JCheckBox (javax.swing.JCheckBox)21 JPanel (javax.swing.JPanel)14 JComboBox (javax.swing.JComboBox)10 JLabel (javax.swing.JLabel)10 DocumentEvent (javax.swing.event.DocumentEvent)10 JButton (javax.swing.JButton)9 ArrayList (java.util.ArrayList)8 ChangeEvent (javax.swing.event.ChangeEvent)8 ChangeListener (javax.swing.event.ChangeListener)8 DocumentAdapter (com.intellij.ui.DocumentAdapter)7 GridBagConstraints (java.awt.GridBagConstraints)7 BorderLayout (java.awt.BorderLayout)6 GridBagLayout (java.awt.GridBagLayout)6 Insets (java.awt.Insets)5 List (java.util.List)5 BoxLayout (javax.swing.BoxLayout)5