mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 09:47:50 +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;
|
private JPanel myToolWindowContent;
|
||||||
|
|
||||||
public MyToolWindow(ToolWindow toolWindow) {
|
public MyToolWindow(ToolWindow toolWindow) {
|
||||||
hideToolWindowButton.addActionListener(new ActionListener() {
|
hideToolWindowButton.addActionListener(e -> toolWindow.hide(null));
|
||||||
public void actionPerformed(ActionEvent e) {
|
refreshToolWindowButton.addActionListener(e -> currentDateTime());
|
||||||
toolWindow.hide(null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
refreshToolWindowButton.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
currentDateTime();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.currentDateTime();
|
this.currentDateTime();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user