mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
Removed boilerplate code from example with lambdas
Given the advent of Java 8, anonymous classes for one-line commands are more visual distraction than they are helpful. I replaced the two used here as action listeners for buttons with equivalent lambdas.
This commit is contained in:
parent
3124f8674d
commit
0dca50d851
@ -16,16 +16,8 @@ public class MyToolWindow {
|
||||
private JPanel myToolWindowContent;
|
||||
|
||||
public MyToolWindow(ToolWindow toolWindow) {
|
||||
hideToolWindowButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
toolWindow.hide(null);
|
||||
}
|
||||
});
|
||||
refreshToolWindowButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
currentDateTime();
|
||||
}
|
||||
});
|
||||
hideToolWindowButton.addActionListener(e -> toolWindow.hide(null));
|
||||
refreshToolWindowButton.addActionListener(e -> currentDateTime());
|
||||
|
||||
this.currentDateTime();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user