summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-06 13:13:43 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-06 13:13:43 +0200
commit023e5398387cbe0869c1c47cb3f2914dfab623d3 (patch)
treeed575dc45b62c74406b36c7bb8618a5550e248b0
parent82c045d786ef4a0728c1e89fb365afda81aef303 (diff)
downloadpdf-over-023e5398387cbe0869c1c47cb3f2914dfab623d3.tar.gz
pdf-over-023e5398387cbe0869c1c47cb3f2914dfab623d3.tar.bz2
pdf-over-023e5398387cbe0869c1c47cb3f2914dfab623d3.zip
more lambda refactors
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java23
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java8
3 files changed, 13 insertions, 22 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
index 3576d8b9..b93a458c 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
@@ -381,26 +381,25 @@ public class MainWindow {
*/
private void hookupOSXMenu() {
log.debug("Hooking up OS X menu");
- CocoaUIEnhancer.hookApplicationMenu(getShell().getDisplay(), new Listener() {
- @Override
- public void handleEvent(Event arg0) {
+ CocoaUIEnhancer.hookApplicationMenu(
+ getShell().getDisplay(),
+ /* quitListener */
+ (Event arg0) -> {
MainWindow.this.stateMachine.exit();
- }
- }, new Listener() {
- @Override
- public void handleEvent(Event arg0) {
+ },
+ /* aboutListener */
+ (Event arg0) -> {
Dialog dialog = new Dialog(getShell(),
String.format(Messages.getString("main.about"), Constants.APP_NAME),
Constants.APP_NAME_VERSION, BUTTONS.OK, ICON.INFORMATION);
dialog.open();
- }
- }, new Listener() {
- @Override
- public void handleEvent(Event arg0) {
+ },
+ /* preferencesListener */
+ (Event arg0) -> {
if (MainWindow.this.stateMachine.getStatus().getBehavior().getEnabled(Buttons.CONFIG))
MainWindow.this.stateMachine.jumpToState(new ConfigurationUIState(MainWindow.this.stateMachine));
}
- });
+ );
}
/**
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java
index c00fa151..0aaf52a6 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java
@@ -111,11 +111,8 @@ public class PlaceholderSelectionGui extends Dialog {
this.btnCancel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
-
-
PlaceholderSelectionGui.this.returnValue = -1;
PlaceholderSelectionGui.this.shlInfo.dispose();
-
}
});
this.btnCancel.setBounds(175, 118, 75, 25);
@@ -126,7 +123,6 @@ public class PlaceholderSelectionGui extends Dialog {
this.btnOk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
-
PlaceholderSelectionGui.this.returnValue = PlaceholderSelectionGui.this.placeholderNameDropDown.getSelectionIndex();
PlaceholderSelectionGui.this.shlInfo.dispose();
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java
index e2246761..b34f32dc 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ClickableCanvas.java
@@ -51,12 +51,8 @@ public class ClickableCanvas extends Canvas {
final Cursor hand = new Cursor(this.getDisplay(), SWT.CURSOR_HAND);
- this.addListener(SWT.Resize, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- ClickableCanvas.this.redraw();
- }
+ this.addListener(SWT.Resize, (Event event) -> {
+ ClickableCanvas.this.redraw();
});
this.setCursor(hand);