From ba13450bf503469436b63789553163746bab7e43 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 13:53:31 +0100 Subject: New grid layout implemented to support postfix file names --- pdf-over-gui/.gitignore | 29 +-- .../composites/AdvancedConfigurationComposite.java | 197 ++++++++++----------- .../at/asit/pdfover/gui/messages.properties | 15 +- 3 files changed, 114 insertions(+), 127 deletions(-) (limited to 'pdf-over-gui') diff --git a/pdf-over-gui/.gitignore b/pdf-over-gui/.gitignore index cc8bf14e..d344eef6 100644 --- a/pdf-over-gui/.gitignore +++ b/pdf-over-gui/.gitignore @@ -1,14 +1,15 @@ -# SVN repo files -.svn/ - -# Eclipse project files -.project -.classpath -.settings/ -.euml2 -.umlproject - -# Other -target/ -log/ -*~ +# SVN repo files +.svn/ + +# Eclipse project files +.project +.classpath +.settings/ +.euml2 +.umlproject + +# Other +target/ +log/ +*~ +/bin/ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java index c29abb33..34b6535a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java @@ -412,13 +412,11 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { }); this.grpSpeicherort = new Group(this, SWT.NONE); - layout = new FormLayout(); - layout.marginHeight = 10; - layout.marginWidth = 5; - this.grpSpeicherort.setLayout(layout); + GridLayout gl_grpSpeicherort = new GridLayout(3, false); + grpSpeicherort.setLayout(gl_grpSpeicherort); FormData fd_grpSpeicherort = new FormData(); + fd_grpSpeicherort.left = new FormAttachment(100, -499); fd_grpSpeicherort.top = new FormAttachment(this.grpBkuAuswahl, 5); - fd_grpSpeicherort.left = new FormAttachment(0, 5); fd_grpSpeicherort.right = new FormAttachment(100, -5); this.grpSpeicherort.setLayoutData(fd_grpSpeicherort); @@ -428,114 +426,101 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fD_grpSpeicherort[0])); this.lblDefaultOutputFolder = new Label(this.grpSpeicherort, SWT.NONE); - FormData fd_lblDefaultOutputFolder = new FormData(); - fd_lblDefaultOutputFolder.top = new FormAttachment(0); - fd_lblDefaultOutputFolder.left = new FormAttachment(0, 5); - this.lblDefaultOutputFolder.setLayoutData(fd_lblDefaultOutputFolder); FontData[] fD_lblDefaultOutputFolder = this.lblDefaultOutputFolder.getFont() .getFontData(); fD_lblDefaultOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.lblDefaultOutputFolder.setFont(new Font(Display.getCurrent(), fD_lblDefaultOutputFolder[0])); - - this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); - FormData fd_text = new FormData(); - fd_text.top = new FormAttachment(this.lblDefaultOutputFolder, 5); - fd_text.left = new FormAttachment(0, 15); - this.txtOutputFolder.setLayoutData(fd_text); - - FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont() - .getFontData(); + + this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); + GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + gd_txtOutputFolder.widthHint = 291; + txtOutputFolder.setLayoutData(gd_txtOutputFolder); + + FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont() + .getFontData(); + this.txtOutputFolder.setFont(new Font(Display.getCurrent(), + fD_txtOutputFolder[0])); + + this.txtOutputFolder.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + performOutputFolderChanged(AdvancedConfigurationComposite.this.txtOutputFolder + .getText()); + } + }); fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtOutputFolder.setFont(new Font(Display.getCurrent(), - fD_txtOutputFolder[0])); - - this.txtOutputFolder.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - performOutputFolderChanged(AdvancedConfigurationComposite.this.txtOutputFolder - .getText()); - } - }); - - this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); - fd_text.right = new FormAttachment(this.btnBrowse, -5); - - FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); - fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); - this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); - - FormData fd_btnBrowse = new FormData(); - fd_btnBrowse.top = new FormAttachment(this.lblDefaultOutputFolder, 5); - fd_btnBrowse.right = new FormAttachment(100, -5); - this.btnBrowse.setLayoutData(fd_btnBrowse); - - this.btnBrowse.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - DirectoryDialog dlg = new DirectoryDialog( - AdvancedConfigurationComposite.this.getShell()); - - // Set the initial filter path according - // to anything they've selected or typed in - dlg.setFilterPath(AdvancedConfigurationComposite.this.txtOutputFolder - .getText()); - - // Change the title bar text - dlg.setText(Messages - .getString("advanced_config.OutputFolder.Dialog_Title")); //$NON-NLS-1$ - - // Customizable message displayed in the dialog - dlg.setMessage(Messages - .getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ - - // Calling open() will open and run the dialog. - // It will return the selected directory, or - // null if user cancels - String dir = dlg.open(); - if (dir != null) { - // Set the text box to the new selection - performOutputFolderChanged(dir); - } - } - }); - - - this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); - FormData fd_lblSaveFilePostFix = new FormData(); - fd_lblSaveFilePostFix.top = new FormAttachment(this.lblDefaultOutputFolder); - fd_lblSaveFilePostFix.left = new FormAttachment(0, 5); - this.lblSaveFilePostFix.setLayoutData(fd_lblSaveFilePostFix); - - FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont() - .getFontData(); +// fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); + + this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); + btnBrowse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + + FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); + this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); + + this.btnBrowse.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + DirectoryDialog dlg = new DirectoryDialog( + AdvancedConfigurationComposite.this.getShell()); + + // Set the initial filter path according + // to anything they've selected or typed in + dlg.setFilterPath(AdvancedConfigurationComposite.this.txtOutputFolder + .getText()); + + // Change the title bar text + dlg.setText(Messages + .getString("advanced_config.OutputFolder.Dialog_Title")); //$NON-NLS-1$ + + // Customizable message displayed in the dialog + dlg.setMessage(Messages + .getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ + + // Calling open() will open and run the dialog. + // It will return the selected directory, or + // null if user cancels + String dir = dlg.open(); + if (dir != null) { + // Set the text box to the new selection + performOutputFolderChanged(dir); + } + } + }); + + + this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); + lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text")); + + FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont() + .getFontData(); + this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), + fD_lblSaveFilePostFix[0])); + + this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); + GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + gd_txtSaveFilePostFix.widthHint = 256; + txtSaveFilePostFix.setLayoutData(gd_txtSaveFilePostFix); + + FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont() + .getFontData(); + this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), + fD_txtPostFix[0])); + + this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + //performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix + //.getText()); + } + }); + new Label(grpSpeicherort, SWT.NONE); fD_lblSaveFilePostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), - fD_lblSaveFilePostFix[0])); - - this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.NONE); - FormData fd_PostFix = new FormData(); - fd_PostFix.top = new FormAttachment(this.lblSaveFilePostFix, 5); - fd_PostFix.left = new FormAttachment(0, 15); - this.txtSaveFilePostFix.setLayoutData(fd_text); - - FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont() - .getFontData(); - fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), - fD_txtOutputFolder[0])); - - this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - //performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix - //.getText()); - } - }); + fD_txtPostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.grpLocaleAuswahl = new Group(this, SWT.NONE); @@ -544,7 +529,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { layout_grpLocaleAuswahl.marginWidth = 5; this.grpLocaleAuswahl.setLayout(layout_grpLocaleAuswahl); FormData fd_grpLocaleAuswahl = new FormData(); - fd_grpLocaleAuswahl.top = new FormAttachment(this.grpSpeicherort, 5); + fd_grpLocaleAuswahl.top = new FormAttachment(grpSpeicherort, 5); fd_grpLocaleAuswahl.left = new FormAttachment(0, 5); fd_grpLocaleAuswahl.right = new FormAttachment(100, -5); this.grpLocaleAuswahl.setLayoutData(fd_grpLocaleAuswahl); diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index 4764a1af..2fc0713e 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -1,5 +1,6 @@ #Eclipse messages class -#Mon Dec 02 13:17:21 CET 2019 +#Thu Nov 19 13:14:07 CET 2020 +AdvancedConfigurationComposite.lblSaveFilePostFix.text=Save File Postfix BKU.KS=Keystore BKU.LOCAL=Local CCE BKU.MOBILE=Mobile CCE @@ -28,6 +29,8 @@ advanced_config.OutputFolder_Title=&Output location advanced_config.OutputFolder_ToolTip=Select the folder where the signed document will be saved automatically (clear this field to disable automatic saving, enter a single dot (".") to denote the input document directory) advanced_config.PdfACompat=PDF/A compatibility advanced_config.PdfACompat_ToolTip=Whether to make signature PDF/A compatible (increases pdf size) +advanced_config.Placeholder_Enabled=Enable placeholder search +advanced_config.Placeholder_Title=Placeholder advanced_config.ProxyHost=Host\: advanced_config.ProxyHost_Template=Hostname or IP of the proxy server advanced_config.ProxyHost_ToolTip=To use a proxy server enter the hostname or the IP here @@ -46,8 +49,6 @@ advanced_config.SigPHTransparencyMax=Opaque advanced_config.SigPHTransparencyMin=Invisible advanced_config.SigPHTransparencyTooltip=Set the transparency of the signature placeholder in the positioning step advanced_config.Signature_Title=Si&gnature -advanced_config.Placeholder_Title=Placeholder -advanced_config.Placeholder_Enabled=Enable placeholder search advanced_config.UpdateCheck=Automatically check for updates advanced_config.UpdateCheck_Title=Updates advanced_config.UpdateCheck_ToolTip=Shows a notification when a new version is available @@ -211,11 +212,14 @@ positioning.placeholder=Please select the signature placeholder\nfrom the drop d positioning.removeNewPage=Undo &new Page positioning.sign=&Sign positioning.signature=Signature +simple_config.AMTSSIGNATURBLOCK=Official Signature +simple_config.BASE_LOGO=Logo Only simple_config.ClearEmblem=Clea&r simple_config.EmblemEmpty=Drag and Drop an image here\nor use the browse button \nto select a signature logo. simple_config.Emblem_Title=Signature &logo simple_config.ExampleNumber=+43676123456789 simple_config.ExampleNumber_ToolTip=To use a default mobile phone number enter it here +simple_config.INVISIBLE=Invisible Signature simple_config.MobileBKU_Title=&Mobile signature simple_config.Note=Text\: simple_config.Note_Default=This document is signed with a qualified electronic signature. According to Art.\u00A025 para.\u00A02 of the Regulation (EU) No 910/2014 of 23. July 2014 ("eIDAS-Regulation") it shall have the equivalent legal effect of a handwritten signature. @@ -224,12 +228,9 @@ simple_config.Note_SetDefault=Restore default simple_config.Note_Title=Signature &Note simple_config.Note_Tooltip=Add an optional note to display on your Signature simple_config.PhoneNumber=Mobile number\: +simple_config.SIGNATURBLOCK_SMALL=Standard Signature Block simple_config.SigBlockLang_Title=Signature block lan&guage\: simple_config.SigBlockLang_ToolTip=Select the language to be used in the signature block displayed on the signed document -simple_config.SIGNATURBLOCK_SMALL=Standard Signature Block -simple_config.AMTSSIGNATURBLOCK=Official Signature -simple_config.BASE_LOGO=Logo Only -simple_config.INVISIBLE=Invisible Signature tanEnter.FP=Please open the Handy-Signature app\nand confirm the signature. tanEnter.QR=QR code\: tanEnter.ReferenceValue=Reference value\: -- cgit v1.2.3