diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-07-24 14:57:38 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-07-24 14:57:38 +0000 |
commit | 7b4a747d8a922cb03c8019249217dbf3ff68302a (patch) | |
tree | 7c2b483b9bc5268959300550a763b2f00af5c64a /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java | |
parent | 5e3012c796f81341d2833b92098aee4c93e28006 (diff) | |
download | mocca-7b4a747d8a922cb03c8019249217dbf3ff68302a.tar.gz mocca-7b4a747d8a922cb03c8019249217dbf3ff68302a.tar.bz2 mocca-7b4a747d8a922cb03c8019249217dbf3ff68302a.zip |
Move proxy to advanced config
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@464 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java | 214 |
1 files changed, 1 insertions, 213 deletions
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 a77d7209..eccda66c 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 @@ -63,7 +63,6 @@ import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.ErrorMarker; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.exceptions.InvalidNumberException; -import at.asit.pdfover.gui.exceptions.InvalidPortException; import at.asit.pdfover.gui.utils.ImageConverter; import at.asit.pdfover.gui.utils.Messages; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; @@ -106,16 +105,6 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { private Group grpSignatureLang; Combo cmbSignatureLang; - private Group grpProxy; - private Label lblProxyHost; - private Text txtProxyHost; - private ErrorMarker proxyHostErrorMarker; - private Label lblProxyPort; - Text txtProxyPort; - FormData fd_txtProxyPort; - ErrorMarker txtProxyPortErrorMarker; - FormData fd_txtProxyPortErrorMarker; - String logoFile; private Image origEmblem = null; private Image origlogo = null; @@ -526,130 +515,6 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } }); - - this.grpProxy = new Group(this, SWT.NONE); - FormData fd_grpProxy = new FormData(); - fd_grpProxy.right = new FormAttachment(100, -5); - fd_grpProxy.top = new FormAttachment(this.grpSignatureNote, 5); - fd_grpProxy.left = new FormAttachment(0, 5); - this.grpProxy.setLayoutData(fd_grpProxy); - this.grpProxy.setLayout(new GridLayout(2, false)); - - FontData[] fD_grpProxy = this.grpProxy.getFont().getFontData(); - fD_grpProxy[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpProxy.setFont(new Font(Display.getCurrent(), fD_grpProxy[0])); - - this.lblProxyHost = new Label(this.grpProxy, SWT.NONE); - GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, - false, 1, 1); - gd_lblNewLabel.widthHint = 66; - this.lblProxyHost.setLayoutData(gd_lblNewLabel); - this.lblProxyHost.setBounds(0, 0, 57, 15); - - FontData[] fD_lblNewLabel = this.lblProxyHost.getFont().getFontData(); - fD_lblNewLabel[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblProxyHost.setFont(new Font(Display.getCurrent(), - fD_lblNewLabel[0])); - - Composite compProxyHostContainer = new Composite(this.grpProxy, SWT.NONE); - compProxyHostContainer.setLayout(new FormLayout()); - compProxyHostContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, - 1, 1)); - this.txtProxyHost = new Text(compProxyHostContainer, SWT.BORDER); - FormData fd_txtProxyHost = new FormData(); - fd_txtProxyHost.right = new FormAttachment(100, -42); - fd_txtProxyHost.top = new FormAttachment(0); - fd_txtProxyHost.left = new FormAttachment(0, 5); - - FontData[] fD_txtProxyHost = this.txtProxyHost.getFont().getFontData(); - fD_txtProxyHost[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtProxyHost.setFont(new Font(Display.getCurrent(), - fD_txtProxyHost[0])); - - this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); //$NON-NLS-1$ - - FormData fd_proxyHostErrorMarker = new FormData(); - fd_proxyHostErrorMarker.left = new FormAttachment(100, -32); - fd_proxyHostErrorMarker.right = new FormAttachment(100); - fd_proxyHostErrorMarker.top = new FormAttachment(0); - fd_proxyHostErrorMarker.bottom = new FormAttachment(0, 32); - - this.proxyHostErrorMarker.setLayoutData(fd_proxyHostErrorMarker); - this.proxyHostErrorMarker.setVisible(false); - this.txtProxyHost.setLayoutData(fd_txtProxyHost); - - this.txtProxyHost.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - processProxyHostChanged(); - } - }); - - this.txtProxyHost.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - processProxyHostChanged(); - } - } - }); - - this.lblProxyPort = new Label(this.grpProxy, SWT.NONE); - this.lblProxyPort.setBounds(0, 0, 57, 15); - - FontData[] fD_lblProxyPort = this.lblProxyPort.getFont() - .getFontData(); - fD_lblProxyPort[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblProxyPort.setFont(new Font(Display.getCurrent(), - fD_lblProxyPort[0])); - - Composite compProxyPortContainer = new Composite(this.grpProxy, SWT.NONE); - compProxyPortContainer.setLayout(new FormLayout()); - compProxyPortContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, - 1, 1)); - - this.txtProxyPort = new Text(compProxyPortContainer, SWT.BORDER); - this.fd_txtProxyPort = new FormData(); - this.fd_txtProxyPort.top = new FormAttachment(0, 0); - this.fd_txtProxyPort.left = new FormAttachment(0, 5); - this.fd_txtProxyPort.right = new FormAttachment(100, -42); - this.txtProxyPort.setLayoutData(this.fd_txtProxyPort); - - FontData[] fD_txtProxyPort = this.txtProxyPort.getFont().getFontData(); - fD_txtProxyPort[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtProxyPort.setFont(new Font(Display.getCurrent(), - fD_txtProxyPort[0])); - - this.txtProxyPort.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - processProxyPortChanged(); - } - } - }); - - this.txtProxyPortErrorMarker = new ErrorMarker(compProxyPortContainer, SWT.NONE, ""); //$NON-NLS-1$ - this.fd_txtProxyPortErrorMarker = new FormData(); - this.fd_txtProxyPortErrorMarker.left = new FormAttachment(100, -32); - this.fd_txtProxyPortErrorMarker.right = new FormAttachment(100); - this.fd_txtProxyPortErrorMarker.top = new FormAttachment(0); - this.fd_txtProxyPortErrorMarker.bottom = new FormAttachment(0, 32); - this.txtProxyPortErrorMarker - .setLayoutData(this.fd_txtProxyPortErrorMarker); - this.txtProxyPortErrorMarker.setVisible(false); - - this.txtProxyPort.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - processProxyPortChanged(); - } - }); - // Load localized strings reloadResources(); } @@ -917,60 +782,12 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.txtMobileNumber.setText(number); } - void processProxyHostChanged() { - try { - this.proxyHostErrorMarker.setVisible(false); - plainProxyHostSetter(); - } catch (Exception ex) { - this.proxyHostErrorMarker.setVisible(true); - this.proxyHostErrorMarker.setToolTipText(ex.getMessage()); - log.error("processProxyHost: ", ex); //$NON-NLS-1$ - } - } - void processSignatureNoteChanged() { String note = this.txtSignatureNote.getText(); this.configurationContainer.setSignatureNote(note); } /** - * - */ - private void plainProxyHostSetter() { - String host = this.txtProxyHost.getText(); - this.configurationContainer.setProxyHost(host); - } - - void processProxyPortChanged() { - try { - this.txtProxyPortErrorMarker.setVisible(false); - plainProxyPortSetter(); - } catch (Exception ex) { - this.txtProxyPortErrorMarker.setVisible(true); - this.txtProxyPortErrorMarker.setToolTipText(ex.getMessage()); - log.error("processProxyPort: ", ex); //$NON-NLS-1$ - } - } - - /** - * @throws InvalidPortException - */ - private void plainProxyPortSetter() throws InvalidPortException { - String portString = this.txtProxyPort.getText(); - int port = -1; - if (portString == null || portString.trim().isEmpty()) { - port = -1; - } else { - try { - port = Integer.parseInt(portString); - } catch (NumberFormatException e) { - throw new InvalidPortException(portString, e); - } - } - this.configurationContainer.setProxyPort(port); - } - - /** * @return the configurationComposite */ public ConfigurationComposite getConfigurationComposite() { @@ -1027,25 +844,14 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } } - int port = this.configurationContainer.getProxyPort(); - if (port > 0) { - this.txtProxyPort.setText(Integer.toString(port)); - } - String note = this.configurationContainer.getSignatureNote(); if (note != null) { this.txtSignatureNote.setText(note); } - String host = this.configurationContainer.getProxyHost(); - - if (host != null) { - this.txtProxyHost.setText(host); - } - this.setVisibleImage(); - + this.performSignatureLangSelectionChanged(this.configurationContainer.getSignLocale()); } @@ -1063,11 +869,6 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.plainMobileNumberSetter(); // Fall through case 1: - this.plainProxyHostSetter(); - // Fall through - case 2: - this.plainProxyPortSetter(); - case 3: this.processSignatureNoteChanged(); } // this.plainEmblemSetter(this.emblemFile); @@ -1106,18 +907,5 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.grpSignatureLang.setText(Messages.getString("simple_config.SigBlockLang_Title")); //$NON-NLS-1$ this.cmbSignatureLang.setToolTipText(Messages.getString("simple_config.SigBlockLang_ToolTip")); //$NON-NLS-1$ - - this.grpProxy.setText(Messages.getString("simple_config.Proxy_Title")); //$NON-NLS-1$ - this.lblProxyHost.setText(Messages.getString("simple_config.ProxyHost")); //$NON-NLS-1$ - this.txtProxyHost.setToolTipText(Messages - .getString("simple_config.ProxyHost_ToolTip")); //$NON-NLS-1$ - this.txtProxyHost.setMessage(Messages - .getString("simple_config.ProxyHostTemplate")); //$NON-NLS-1$ - this.lblProxyPort.setText(Messages - .getString("simple_config.ProxyPort")); //$NON-NLS-1$ - this.txtProxyPort.setToolTipText(Messages - .getString("simple_config.ProxyPort_ToolTip")); //$NON-NLS-1$ - this.txtProxyPort.setMessage(Messages - .getString("simple_config.ProxyPortTemplate")); //$NON-NLS-1$ } } |