summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-11-03 15:00:52 +0100
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-11-03 15:00:52 +0100
commit1835bf6f84516b74bbd6334dda56a9f3953c5590 (patch)
treefe4257424f075db2d18868246e5e4d06d9ccc33f /pdf-over-gui/src
parentadf9c7f968c387b8b5641e4fcf253a2b3512db4d (diff)
downloadpdf-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.java31
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) {