From 7372131084d65042e22ee99b0a3527a8ff71b1f0 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:07:52 +0000 Subject: Allow more emblem file types git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@148 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../gui/composites/DataSourceSelectComposite.java | 2 +- .../pdfover/gui/composites/OutputComposite.java | 2 +- .../composites/SimpleConfigurationComposite.java | 26 ++++++++-------------- 3 files changed, 11 insertions(+), 19 deletions(-) (limited to 'pdf-over-gui/src/main/java/at') 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 3ee71997..feb350bf 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 @@ -70,7 +70,7 @@ public class DataSourceSelectComposite extends StateComposite { dialog.setFilterExtensions(new String[] { "*.pdf", "*" }); //$NON-NLS-1$ //$NON-NLS-2$ dialog.setFilterNames(new String[] { Messages.getString("common.PDFExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.ALLExtension_Description") }); //$NON-NLS-1$ + Messages.getString("common.AllExtension_Description") }); //$NON-NLS-1$ String fileName = dialog.open(); File file = null; if (fileName != null) { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java index abbed9e7..0ad7617a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java @@ -107,7 +107,7 @@ public class OutputComposite extends StateComposite { save.setFilterExtensions(new String[] { "*.pdf", "*" }); //$NON-NLS-1$ //$NON-NLS-2$ save.setFilterNames(new String[] { Messages.getString("common.PDFExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.ALLExtension_Description")}); //$NON-NLS-1$ + Messages.getString("common.AllExtension_Description")}); //$NON-NLS-1$ String proposed = OutputComposite.this.getInputFile().getAbsolutePath(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index c4e1f03a..50661b29 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -88,10 +88,13 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog( SimpleConfigurationComposite.this.getShell(), SWT.OPEN); - dialog.setFilterExtensions(new String[] { "*.jpg", "*.gif" }); //$NON-NLS-1$ //$NON-NLS-2$ + dialog.setFilterExtensions(new String[] { "*.jpg;*.png;*.gif", "*.jpg", "*.png", "*.gif", "*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ dialog.setFilterNames(new String[] { + Messages.getString("common.ImageExtension_Description"), //$NON-NLS-1$ Messages.getString("common.JPGExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.GIFExtension_Description") }); //$NON-NLS-1$ + Messages.getString("common.PNGExtension_Description"), //$NON-NLS-1$ + Messages.getString("common.GIFExtension_Description"), //$NON-NLS-1$ + Messages.getString("common.AllExtension_Description")}); //$NON-NLS-1$ String fileName = dialog.open(); File file = null; if (fileName != null) { @@ -192,8 +195,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } } - private void setEmblemFileInternal(final String filename) throws Exception { - this.setEmblemFileInternal(filename, false); + private void setEmblemFile(final String filename) throws Exception { + setEmblemFileInternal(filename, false); } private void setEmblemFileInternal(final String filename, boolean force) @@ -256,8 +259,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { void processEmblemChanged(String filename) { try { - // String filename = this.txtEmblemFile.getText(); - plainEmblemSetter(filename); + setEmblemFile(filename); } catch (Exception ex) { log.error("processEmblemChanged: ", ex); //$NON-NLS-1$ ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, @@ -266,16 +268,6 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } } - /** - * @param filename - * @throws Exception - */ - private void plainEmblemSetter(String filename) throws Exception { - //this.emblemFile = filename; - this.setEmblemFileInternal(filename); - // this.btnClearImage.setSelection(true); - } - void processNumberChanged() { try { this.txtMobileNumberErrorMarker.setVisible(false); @@ -871,7 +863,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { // this.txtEmblemFile.setText(emblemFile); this.emblemFile = emblemFile; try { - this.setEmblemFileInternal(emblemFile, true); + setEmblemFileInternal(emblemFile, true); this.btnClearImage.setSelection(true); } catch (Exception e1) { log.error("Failed to load emblem: ", e1); //$NON-NLS-1$ -- cgit v1.2.3