use of java.awt.event.ActionListener in project checkstyle by checkstyle.
the class OperatorHelper method myMethod.
//indent:4 exp:4
private void myMethod() {
//indent:4 exp:4
class localFoo {
}
class localFoo2 {
//indent:12 exp:12
int x;
//indent:12 exp:12
int func() {
return 3;
}
}
//indent:8 exp:8
// : this is broken right now: //indent:8 exp:8
// 1) this is both an expression and an OBJBLOCK //indent:8 exp:8
// 2) methods aren't yet parsed //indent:8 exp:8
// 3) only CLASSDEF is handled now, not OBJBLOCK //indent:8 exp:8
new JButton().addActionListener(new //indent:8 exp:8
ActionListener() {
//indent:8 exp:8
public void actionPerformed(ActionEvent e) {
//indent:12 exp:12
}
});
//indent:8 exp:8
new JButton().addActionListener(new //indent:8 exp:8
ActionListener() {
public void actionPerformed(ActionEvent e) {
//indent:12 exp:12
//indent:16 exp:16
int i = 2;
}
});
//indent:8 exp:8
Object o = new //indent:8 exp:8
ActionListener() {
//indent:8 exp:8
public void actionPerformed(ActionEvent e) {
//indent:12 exp:12
}
};
//indent:8 exp:8
myfunc2(//indent:8 exp:8
10, //indent:8 exp:8
10, //indent:8 exp:8
10, myfunc3(//indent:12 exp:>=12
11, //indent:12 exp:>=12
11, 11, //indent:16 exp:>=16
11), //indent:12 exp:>=12
10, //indent:12 exp:>=12
10, //indent:12 exp:>=12
10);
}
use of java.awt.event.ActionListener in project folding-plugin by dmytrodanylyk.
the class SettingConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
useCustomPatternCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
boolean selected = getCheckBoxStatus(actionEvent);
customPattern.setEnabled(selected);
isModified = true;
}
});
customPattern.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
isModified = true;
}
@Override
public void removeUpdate(DocumentEvent e) {
isModified = true;
}
@Override
public void changedUpdate(DocumentEvent e) {
isModified = true;
}
});
hideFoldingPrefix.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
isModified = true;
}
});
reset();
return mPanel;
}
use of java.awt.event.ActionListener in project qi4j-sdk by Qi4j.
the class Main method main.
public static void main(String[] args) throws Exception {
SingletonAssembler assembler = new SingletonAssembler() {
public void assemble(ModuleAssembly module) throws AssemblyException {
module.transients(BoundPersonComposite.class);
module.transients(AddressTransient.class);
module.values(CityValue.class, CountryValue.class);
new SwingBindingAssembler().assemble(module);
}
};
module = assembler.module();
Address address1 = createAddress("Vista Damai", "Jalan Tun Razak");
Address address2 = createAddress("Mutiara", "Jalan Ceylon");
TransientBuilder<BoundPersonComposite> builder = module.newTransientBuilder(BoundPersonComposite.class);
PersonComposite prototype = builder.prototype();
prototype.address().set(address1);
prototype.firstName().set("Niclas");
final BoundPersonComposite p1 = builder.newInstance();
prototype.address().set(address2);
prototype.firstName().set("Edward");
final BoundPersonComposite p2 = builder.newInstance();
final StateModel<BoundPersonComposite> model = module.newObject(StateModel.class, BoundPersonComposite.class);
Form form = new Form<BoundPersonComposite>(model);
JFrame frame = new JFrame("testing");
frame.add(form, BorderLayout.CENTER);
JPanel checkBoxPanel = new JPanel();
checkBoxPanel.setFocusable(true);
checkBoxPanel.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
System.out.println("Gained!");
}
public void focusLost(FocusEvent e) {
System.out.println("LOst!");
}
});
JCheckBox sw = new JCheckBox("Toggle");
sw.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
model.use(p1);
System.out.println(p1.firstName().get());
} else {
model.use(p2);
System.out.println(p2.firstName().get());
}
}
});
checkBoxPanel.add(sw);
frame.add(checkBoxPanel, BorderLayout.EAST);
frame.pack();
System.out.println(model);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
use of java.awt.event.ActionListener in project SKMCLauncher by SKCraft.
the class VersionListDialog method initComponents.
private void initComponents() {
JPanel mainPanel = new JPanel();
versionsList = new JList();
JScrollPane versionsScroll = new JScrollPane(versionsList);
LinedBoxPanel buttonsPanel = new LinedBoxPanel(true).fullyPadded();
JButton cancelButton = new JButton(_("button.cancel"));
JButton selectButton = new JButton(_("button.select"));
mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
mainPanel.setLayout(new BorderLayout());
mainPanel.add(versionsScroll, BorderLayout.CENTER);
buttonsPanel.addGlue();
buttonsPanel.addElement(selectButton);
buttonsPanel.addElement(cancelButton);
add(mainPanel, BorderLayout.CENTER);
add(buttonsPanel, BorderLayout.SOUTH);
cancelButton.addActionListener(ActionListeners.dispose(this));
selectButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Object selected = versionsList.getSelectedValue();
if (selected != null && selected instanceof Version) {
version = (Version) selected;
}
dispose();
}
});
getRootPane().setDefaultButton(selectButton);
versionsList.addMouseListener(new DoubleClickToButtonAdapter(selectButton));
ListenableFuture<?> future = executor.submit(new AbstractWorker<Object>() {
@Override
protected void run() throws Exception {
try {
setVersions(application.getAvailable());
} catch (IOException e) {
dispose();
throw new LauncherException(e, _("versionList.failedFetchError"));
} catch (InterruptedException e) {
dispose();
}
}
@Override
public String getLocalizedTitle() {
return _("selectVersions.fetchingVersionsTitle");
}
@Override
public boolean shouldConfirmInterrupt() {
return false;
}
});
SwingHelper.addErrorDialogCallback(future, this);
}
use of java.awt.event.ActionListener in project SKMCLauncher by SKCraft.
the class ConsoleFrame method initComponents.
/**
* Add components to the frame.
*/
private void initComponents() {
JButton pastebinButton = new JButton(_("console.uploadLog"));
buttonsPanel = new LinedBoxPanel(true);
buttonsPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
buttonsPanel.addElement(pastebinButton);
add(buttonsPanel, BorderLayout.NORTH);
add(messageLog, BorderLayout.CENTER);
pastebinButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
pastebinLog();
}
});
}
Aggregations