diff options
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
9 files changed, 290 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java index 5484d4c54..c508a37a5 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/Messages.java @@ -85,6 +85,8 @@ public class Messages extends NLS { public static String TaskListNotificationManager_Open_Notification_Job; + public static String TaskRepositoryLocationUi_Enter_CLIENTCERTIFICATE_password; + public static String TaskRepositoryLocationUi_Enter_HTTP_password; public static String TaskRepositoryLocationUi_Enter_proxy_password; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java index 4632b6a54..6932be1e4 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskRepositoryLocationUi.java @@ -7,6 +7,7 @@ * * Contributors: * Tasktop Technologies - initial API and implementation + * BREDEX GmbH - fix for bug 295050 *******************************************************************************/ package org.eclipse.mylyn.internal.tasks.ui; @@ -21,8 +22,8 @@ import org.eclipse.mylyn.commons.net.Policy; import org.eclipse.mylyn.commons.net.UnsupportedRequestException; import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil; import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta; -import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryLocation; import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta.Type; +import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryLocation; import org.eclipse.mylyn.internal.tasks.ui.dialogs.TaskRepositoryCredentialsDialog; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.swt.widgets.Shell; @@ -124,7 +125,7 @@ public class TaskRepositoryLocationUi extends TaskRepositoryLocation { private void initializeDialog(TaskRepositoryCredentialsDialog dialog) { dialog.setTaskRepository(taskRepository); - + dialog.setFileDialog(AuthenticationType.CERTIFICATE.equals(authType)); AuthenticationCredentials credentials = taskRepository.getCredentials(authType); if (credentials != null) { dialog.setUsername(credentials.getUserName()); @@ -142,6 +143,8 @@ public class TaskRepositoryLocationUi extends TaskRepositoryLocation { private String getDefaultMessage() { if (AuthenticationType.REPOSITORY.equals(authType)) { return Messages.TaskRepositoryLocationUi_Enter_repository_password; + } else if (AuthenticationType.CERTIFICATE.equals(authType)) { + return Messages.TaskRepositoryLocationUi_Enter_CLIENTCERTIFICATE_password; } else if (AuthenticationType.HTTP.equals(authType)) { return Messages.TaskRepositoryLocationUi_Enter_HTTP_password; } else if (AuthenticationType.PROXY.equals(authType)) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java index 231de57a2..58127b488 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java @@ -43,8 +43,12 @@ public class Messages extends NLS { public static String TaskListSortDialog_Title; + public static String TaskRepositoryCredentialsDialog_ChooseCertificateFile; + public static String TaskRepositoryCredentialsDialog_Enter_Credentials; + public static String TaskRepositoryCredentialsDialog_Enter_repository_certificate; + public static String TaskRepositoryCredentialsDialog_Enter_repository_credentials; public static String TaskRepositoryCredentialsDialog_HTML_Open_Repository_Properties; @@ -61,6 +65,8 @@ public class Messages extends NLS { public static String TaskRepositoryCredentialsDialog_User_ID; + public static String TaskRepositoryCredentialsDialog_Filename; + public static String UiLegendControl_Active_task; public static String UiLegendControl_Adjust_Colors_and_Fonts_; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/TaskRepositoryCredentialsDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/TaskRepositoryCredentialsDialog.java index 90c58e001..911cf89f9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/TaskRepositoryCredentialsDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/TaskRepositoryCredentialsDialog.java @@ -8,6 +8,7 @@ * Contributors: * Frank Becker - initial API and implementation * Tasktop Technologies - improvements + * BREDEX GmbH - fix for bug 295050 *******************************************************************************/ package org.eclipse.mylyn.internal.tasks.ui.dialogs; @@ -34,6 +35,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Shell; @@ -43,6 +45,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; /** * @author Frank Becker * @author Steffen Pingel + * @author Torsten Kalix */ public class TaskRepositoryCredentialsDialog extends TitleAreaDialog { @@ -72,6 +75,10 @@ public class TaskRepositoryCredentialsDialog extends TitleAreaDialog { private String username = ""; //$NON-NLS-1$ + private Button certBrowseButton; + + private boolean isFileDialog; + private TaskRepositoryCredentialsDialog(Shell parentShell) { super(parentShell); } @@ -112,7 +119,7 @@ public class TaskRepositoryCredentialsDialog extends TitleAreaDialog { private void createCenterArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout(2, false)); + composite.setLayout(new GridLayout(3, false)); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); if (taskRepository != null) { @@ -137,7 +144,11 @@ public class TaskRepositoryCredentialsDialog extends TitleAreaDialog { label.setText(taskRepository.getRepositoryLabel()); } - new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_User_ID); + if (isFileDialog) { + new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_Filename); + } else { + new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_User_ID); + } final Text usernameField = new Text(composite, SWT.BORDER); usernameField.addModifyListener(new ModifyListener() { @@ -155,6 +166,25 @@ public class TaskRepositoryCredentialsDialog extends TitleAreaDialog { .grab(true, false) .applyTo(usernameField); + if (isFileDialog) { + certBrowseButton = new Button(composite, SWT.PUSH); + certBrowseButton.setText(Messages.TaskRepositoryCredentialsDialog_ChooseCertificateFile); + certBrowseButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); + fileDialog.setFilterPath(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$ + String returnFile = fileDialog.open(); + if (returnFile != null) { + username = returnFile; + usernameField.setText(returnFile); + } + } + }); + } else { + new Label(composite, SWT.NONE).setText(""); //$NON-NLS-1$ + } + new Label(composite, SWT.NONE).setText(Messages.TaskRepositoryCredentialsDialog_Password); final Text passwordField = new Text(composite, SWT.BORDER | SWT.PASSWORD); @@ -302,4 +332,13 @@ public class TaskRepositoryCredentialsDialog extends TitleAreaDialog { this.username = username; } + /** + * switch from asking for username / password to asking for certificate-file / password + * + * @param isFileDialog + */ + public void setFileDialog(boolean isFileDialog) { + this.isFileDialog = isFileDialog; + } + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties index 3d9e86cf6..49c06ea12 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties @@ -18,15 +18,18 @@ TaskListSortDialog_Queries_and_Categories=Queries and Categories TaskListSortDialog_Grouped_by=Group by: TaskListSortDialog_Title=Task List Sorting +TaskRepositoryCredentialsDialog_ChooseCertificateFile=Browse... TaskRepositoryCredentialsDialog_Enter_Credentials=Enter Credentials TaskRepositoryCredentialsDialog_Enter_repository_credentials=Enter repository credentials +TaskRepositoryCredentialsDialog_Enter_repository_certificate=Enter certificate details TaskRepositoryCredentialsDialog_HTML_Open_Repository_Properties=<a href="properties">Open Repository Properties</a> to disable background synchronization by disconnecting the repository. TaskRepositoryCredentialsDialog_Password=&Password: TaskRepositoryCredentialsDialog_Repository_Authentication=Repository Authentication TaskRepositoryCredentialsDialog_Save_Password=&Save Password TaskRepositoryCredentialsDialog_Saved_passwords_are_stored_that_is_difficult=Saved passwords are stored on your computer in a file that is difficult, but not impossible, for an intruder to read. TaskRepositoryCredentialsDialog_Task_Repository=Task Repository\: -TaskRepositoryCredentialsDialog_User_ID=&User ID: +TaskRepositoryCredentialsDialog_User_ID=&User ID: +TaskRepositoryCredentialsDialog_Filename=&Filename: UiLegendControl_Active_task=Active task UiLegendControl_Adjust_Colors_and_Fonts_=Adjust Colors and Fonts... diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties index 71ba8fcae..e8e7a5698 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/messages.properties @@ -52,6 +52,7 @@ TaskListBackupManager_Scheduled_task_data_backup=Scheduled task data backup TaskListNotificationManager_Open_Notification_Job=Open Notification Job TaskRepositoryLocationUi_Enter_HTTP_password=Enter HTTP password +TaskRepositoryLocationUi_Enter_CLIENTCERTIFICATE_password=Enter certificate password TaskRepositoryLocationUi_Enter_proxy_password=Enter proxy password TaskRepositoryLocationUi_Enter_repository_password=Enter repository password diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java index 7955103a2..11d4dc2f9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java @@ -207,6 +207,16 @@ public class Messages extends NLS { public static String AbstractRepositorySettingsPage_Password_; + public static String AbstractRepositorySettingsPage_certificate_settings; + + public static String AbstractRepositorySettingsPage_Enable_certificate_authentification; + + public static String AbstractRepositorySettingsPage_CertificateFile_; + + public static String AbstractRepositorySettingsPage_ChooseCertificateFile_; + + public static String AbstractRepositorySettingsPage_CertificatePassword_; + public static String AbstractRepositorySettingsPage_Problems_encountered_determining_available_charsets; public static String AbstractRepositorySettingsPage_Proxy_host_address_; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties index e33b8e296..df887c38f 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties @@ -114,6 +114,11 @@ AbstractRepositorySettingsPage_Label_=Label\:\ AbstractRepositorySettingsPage_Other=Other\: AbstractRepositorySettingsPage_Password_=Password\:\ AbstractRepositorySettingsPage_Problems_encountered_determining_available_charsets=Problems encountered determining available charsets +AbstractRepositorySettingsPage_certificate_settings=Certificate Authentication +AbstractRepositorySettingsPage_Enable_certificate_authentification=Enable certificate authentification +AbstractRepositorySettingsPage_ChooseCertificateFile_=Browse... +AbstractRepositorySettingsPage_CertificateFile_=Keystore file\:\ +AbstractRepositorySettingsPage_CertificatePassword_=Keystore password\:\ AbstractRepositorySettingsPage_Proxy_host_address_=Proxy host address\:\ AbstractRepositorySettingsPage_Proxy_host_port_=Proxy host port\:\ AbstractRepositorySettingsPage_Proxy_Server_Configuration=Proxy Server Configuration diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java index 8f0645150..dfe24ccca 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java @@ -60,6 +60,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbench; @@ -120,6 +121,12 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit protected StringFieldEditor httpAuthPasswordEditor; + private StringFieldEditor certAuthFileNameEditor; + + private Button certBrowseButton; + + private StringFieldEditor certAuthPasswordEditor; + protected StringFieldEditor proxyHostnameEditor; protected StringFieldEditor proxyPortEditor; @@ -147,12 +154,18 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit private String oldHttpAuthPassword; + private String oldCertAuthFileName; + + private String oldCertAuthPassword; + private boolean needsAnonymousLogin; private boolean needsTimeZone; private boolean needsEncoding; + private boolean needsCertAuth; + private boolean needsHttpAuth; private boolean needsValidation; @@ -163,6 +176,8 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit private Composite advancedComp; + private Composite certAuthComp; + private Composite httpAuthComp; private Composite proxyAuthComp; @@ -173,6 +188,8 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit private Button otherEncoding; + private Button certAuthButton; + private Button httpAuthButton; private boolean needsProxy; @@ -202,6 +219,8 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit private Button saveHttpPasswordButton; + private Button saveCertPasswordButton; + private Button saveProxyPasswordButton; private Button disconnectedButton; @@ -505,6 +524,10 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit createAdvancedSection(); } + if (needsCertAuth()) { + createCertAuthSection(); + } + if (needsHttpAuth()) { createHttpAuthSection(); } @@ -668,6 +691,101 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } } + private void createCertAuthSection() { + ExpandableComposite section = createSection(compositeContainer, + Messages.AbstractRepositorySettingsPage_certificate_settings); + + certAuthComp = toolkit.createComposite(section, SWT.NONE); + certAuthComp.setBackground(compositeContainer.getBackground()); + section.setClient(certAuthComp); + + certAuthButton = new Button(certAuthComp, SWT.CHECK); + GridDataFactory.fillDefaults() + .indent(0, 5) + .align(SWT.LEFT, SWT.TOP) + .span(3, SWT.DEFAULT) + .applyTo(certAuthButton); + + certAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_certificate_authentification); + + certAuthButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + setCertAuth(certAuthButton.getSelection()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + // ignore + } + }); + + certAuthFileNameEditor = new StringFieldEditor( + "", Messages.AbstractRepositorySettingsPage_CertificateFile_, StringFieldEditor.UNLIMITED, certAuthComp) { //$NON-NLS-1$ + + @Override + protected boolean doCheckState() { + return true; + } + + @Override + protected void valueChanged() { + super.valueChanged(); + if (getWizard() != null) { + getWizard().getContainer().updateButtons(); + } + } + + @Override + public int getNumberOfControls() { + return 2; + } + }; + + certBrowseButton = new Button(certAuthComp, SWT.PUSH); + certBrowseButton.setText(Messages.AbstractRepositorySettingsPage_ChooseCertificateFile_); + certBrowseButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN); + fileDialog.setFilterPath(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$ + String returnFile = fileDialog.open(); + if (returnFile != null) { + certAuthFileNameEditor.setStringValue(returnFile); + } + } + }); + + certAuthPasswordEditor = new RepositoryStringFieldEditor( + "", Messages.AbstractRepositorySettingsPage_CertificatePassword_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ + certAuthComp) { + @Override + public int getNumberOfControls() { + return 2; + } + }; + ((RepositoryStringFieldEditor) certAuthPasswordEditor).getTextControl().setEchoChar('*'); + + saveCertPasswordButton = new Button(certAuthComp, SWT.CHECK); + saveCertPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); + + certAuthFileNameEditor.setEnabled(certAuthButton.getSelection(), certAuthComp); + certBrowseButton.setEnabled(certAuthButton.getSelection()); + certAuthPasswordEditor.setEnabled(certAuthButton.getSelection(), certAuthComp); + saveCertPasswordButton.setEnabled(certAuthButton.getSelection()); + + if (repository != null) { + saveCertPasswordButton.setSelection(repository.getSavePassword(AuthenticationType.CERTIFICATE)); + } else { + saveCertPasswordButton.setSelection(false); + } + setCertAuth(oldCertAuthPassword != null || oldCertAuthFileName != null); + section.setExpanded(certAuthButton.getSelection()); + + GridLayout gridLayout2 = new GridLayout(); + gridLayout2.numColumns = 3; + gridLayout2.marginWidth = 0; + certAuthComp.setLayout(gridLayout2); + } + private void createHttpAuthSection() { ExpandableComposite section = createSection(compositeContainer, Messages.AbstractRepositorySettingsPage_Http_Authentication); @@ -760,6 +878,15 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit oldPassword = ""; //$NON-NLS-1$ } + AuthenticationCredentials oldCertCredentials = repository.getCredentials(AuthenticationType.CERTIFICATE); + if (oldCertCredentials != null) { + oldCertAuthFileName = oldCertCredentials.getUserName(); + oldCertAuthPassword = oldCertCredentials.getPassword(); + } else { + oldCertAuthPassword = null; + oldCertAuthFileName = null; + } + AuthenticationCredentials oldHttpCredentials = repository.getCredentials(AuthenticationType.HTTP); if (oldHttpCredentials != null) { oldHttpAuthUserId = oldHttpCredentials.getUserName(); @@ -792,6 +919,8 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit oldPassword = ""; //$NON-NLS-1$ oldHttpAuthPassword = null; oldHttpAuthUserId = null; + oldCertAuthFileName = null; + oldCertAuthPassword = null; } } @@ -1048,6 +1177,29 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } /** + * @since 3.6 + */ + public void setCertAuth(boolean selected) { + if (!needsCertAuth) { + return; + } + certAuthButton.setSelection(selected); + if (!selected) { + oldCertAuthFileName = certAuthFileNameEditor.getStringValue(); + oldCertAuthPassword = certAuthPasswordEditor.getStringValue(); + certAuthFileNameEditor.setStringValue(null); + certAuthPasswordEditor.setStringValue(null); + } else { + certAuthFileNameEditor.setStringValue(oldCertAuthFileName); + certAuthPasswordEditor.setStringValue(oldCertAuthPassword); + } + certAuthFileNameEditor.setEnabled(selected, certAuthComp); + certBrowseButton.setEnabled(selected); + certAuthPasswordEditor.setEnabled(selected, certAuthComp); + saveCertPasswordButton.setEnabled(selected); + } + + /** * @since 2.2 */ public boolean getHttpAuth() { @@ -1055,6 +1207,13 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } /** + * @since 3.6 + */ + public boolean getCertAuth() { + return certAuthButton.getSelection(); + } + + /** * @since 2.0 */ public void setUseDefaultProxy(boolean selected) { @@ -1217,6 +1376,28 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } /** + * @since 3.6 + */ + public String getCertAuthFileName() { + if (needsCertAuth()) { + return certAuthFileNameEditor.getStringValue(); + } else { + return ""; //$NON-NLS-1$ + } + } + + /** + * @since 3.6 + */ + public String getCertAuthPassword() { + if (needsCertAuth()) { + return certAuthPasswordEditor.getStringValue(); + } else { + return ""; //$NON-NLS-1$ + } + } + + /** * @since 2.0 */ public String getProxyHostname() { @@ -1453,6 +1634,16 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } repository.setRepositoryLabel(getRepositoryLabel()); + if (needsCertAuth()) { + if (getCertAuth()) { + AuthenticationCredentials webCredentials = new AuthenticationCredentials(getCertAuthFileName(), + getCertAuthPassword()); + repository.setCredentials(AuthenticationType.CERTIFICATE, webCredentials, getSaveCertPassword()); + } else { + repository.setCredentials(AuthenticationType.CERTIFICATE, null, getSaveCertPassword()); + } + } + if (needsHttpAuth()) { if (getHttpAuth()) { AuthenticationCredentials webCredentials = new AuthenticationCredentials(getHttpAuthUserId(), @@ -1540,6 +1731,20 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } /** + * @since 3.6 + */ + public boolean needsCertAuth() { + return this.needsCertAuth; + } + + /** + * @since 3.6 + */ + public void setNeedsCertAuth(boolean needsCertificate) { + this.needsCertAuth = needsCertificate; + } + + /** * @since 2.0 */ public boolean needsHttpAuth() { @@ -1646,6 +1851,17 @@ public abstract class AbstractRepositorySettingsPage extends AbstractTaskReposit } /** + * @since 3.6 + */ + public Boolean getSaveCertPassword() { + if (needsCertAuth()) { + return saveCertPasswordButton.getSelection(); + } else { + return false; + } + } + + /** * @since 2.2 */ public Boolean getSaveHttpPassword() { |