diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-03 15:00:52 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-03 15:00:52 +0100 |
commit | 1835bf6f84516b74bbd6334dda56a9f3953c5590 (patch) | |
tree | fe4257424f075db2d18868246e5e4d06d9ccc33f /pdf-over-gui/src | |
parent | adf9c7f968c387b8b5641e4fcf253a2b3512db4d (diff) | |
download | pdf-over-1835bf6f84516b74bbd6334dda56a9f3953c5590.tar.gz pdf-over-1835bf6f84516b74bbd6334dda56a9f3953c5590.tar.bz2 pdf-over-1835bf6f84516b74bbd6334dda56a9f3953c5590.zip |
misc cleanups
Diffstat (limited to 'pdf-over-gui/src')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index b93c262f..85b950a6 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -107,25 +107,17 @@ public class PositioningComposite extends StateComposite { Constants.MAINBAR_ACTIVE_BACK_DARK.getBlue())); this.frame.add(this.viewer, BorderLayout.CENTER); - this.btnNewPage.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (PositioningComposite.this.currentPage > PositioningComposite.this.numPages) - showPage(PositioningComposite.this.numPages); - else - showPage(PositioningComposite.this.numPages + 1); - requestFocus(); - } + SWTUtils.addSelectionListener(btnNewPage, () -> { + if (this.currentPage > this.numPages) + showPage(this.numPages); + else + showPage(this.numPages + 1); + requestFocus(); }); - this.btnSign.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - setFinalPosition(); - } - }); + SWTUtils.addSelectionListener(btnSign, this::setFinalPosition); - this.scrollbar.addSelectionListener(this.selectionListener); + SWTUtils.addSelectionListener(scrollbar, () -> { this.showPage(this.scrollbar.getSelection()); }); reloadResources(); requestFocus(); @@ -277,13 +269,6 @@ public class PositioningComposite extends StateComposite { } }; - private SelectionListener selectionListener = new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - PositioningComposite.this.showPage(PositioningComposite.this.scrollbar.getSelection()); - } - }; - private Button btnSign; void showPage(final int page) { |