use of java.awt.event.ItemListener in project OpenNotebook by jaltekruse.
the class BooleanAdjustmentPanel method addPanelContent.
@Override
public void addPanelContent() {
setLayout(new GridLayout(0, 1));
checkbox = new JCheckBox(mAtt.getName());
checkbox.setSelected(mAtt.getValue());
checkbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
mAtt.setValue(true);
if (notebookPanel != null) {
notebookPanel.getCurrentDocViewer().repaintDoc();
notebookPanel.getCurrentDocViewer().addUndoState();
notebookPanel.getCurrentDocViewer().updateObjectToolFrame();
}
} else {
mAtt.setValue(false);
if (notebookPanel != null) {
notebookPanel.getCurrentDocViewer().repaintDoc();
notebookPanel.getCurrentDocViewer().addUndoState();
notebookPanel.getCurrentDocViewer().updateObjectToolFrame();
}
}
}
});
add(checkbox);
}
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;
}
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;
}
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;
}
use of java.awt.event.ItemListener in project android by JetBrains.
the class TwoRadiosToBooleanBinding method addActionListener.
@Override
public void addActionListener(@NotNull final ActionListener listener, @NotNull final JPanel component) {
ItemListener itemListener = (ItemEvent e) -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
String actionCommand = ((JRadioButton) e.getItem()).getActionCommand();
ActionEvent event = new ActionEvent(component, e.getID(), actionCommand);
listener.actionPerformed(event);
}
};
myButtonTrue.addItemListener(itemListener);
myButtonFalse.addItemListener(itemListener);
}
Aggregations