From 0e5916a51b082513dfb3be0ca486c046649a239d Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 18:54:53 +0000 Subject: Use SelectionAdapter to make code more concise git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@35 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../gui/composites/DataSourceSelectComposite.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java index 9b6539d2..18dcd9c2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java @@ -25,8 +25,8 @@ import org.eclipse.swt.dnd.DropTargetEvent; import org.eclipse.swt.dnd.DropTargetListener; import org.eclipse.swt.dnd.FileTransfer; import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; @@ -53,14 +53,7 @@ public class DataSourceSelectComposite extends StateComposite { /** * */ - private final class FileBrowseDialog implements SelectionListener { - /** - * - */ - public FileBrowseDialog() { - // Nothing to do here - } - + private final class FileBrowseDialogListener extends SelectionAdapter { @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(DataSourceSelectComposite.this.getShell(), SWT.OPEN); @@ -75,11 +68,6 @@ public class DataSourceSelectComposite extends StateComposite { } } } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // Nothing to do here - } } /** @@ -241,7 +229,7 @@ public class DataSourceSelectComposite extends StateComposite { fd_btn_open.bottom = new FormAttachment(100, -5); btn_open.setLayoutData(fd_btn_open); btn_open.setBackground(back); - btn_open.addSelectionListener(new FileBrowseDialog()); + btn_open.addSelectionListener(new FileBrowseDialogListener()); this.drop_area.pack(); /* -- cgit v1.2.3