Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-07-03 15:09:17 +0000
committerAlexander Kurtakov2017-07-03 15:09:17 +0000
commitd6c862cc5a2b20d5577e41baf513d01fbf6f80ac (patch)
treed29bd384a6f45dd8b60bde0bc37464bb23b95b0e
parente250999da1710f5c6b5804a5d35a0ee23dda49c3 (diff)
downloadrt.equinox.p2-d6c862cc5a2b20d5577e41baf513d01fbf6f80ac.tar.gz
rt.equinox.p2-d6c862cc5a2b20d5577e41baf513d01fbf6f80ac.tar.xz
rt.equinox.p2-d6c862cc5a2b20d5577e41baf513d01fbf6f80ac.zip
Bug 474099 - Require certificate selection to confirm dialog
Fix copyright year and use lambdas in TrustCertificateDialog. Change-Id: I40c4772410df32cccef70e0c31cd94913d42521c Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/TrustCertificateDialog.java49
1 files changed, 20 insertions, 29 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/TrustCertificateDialog.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/TrustCertificateDialog.java
index 721f0a54c..5abc05796 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/TrustCertificateDialog.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/TrustCertificateDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -185,13 +185,10 @@ public class TrustCertificateDialog extends SelectionDialog {
}
private ISelectionChangedListener getChainSelectionListener() {
- return new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof StructuredSelection) {
- selectedCertificate = ((StructuredSelection) selection).getFirstElement();
- }
+ return event -> {
+ ISelection selection = event.getSelection();
+ if (selection instanceof StructuredSelection) {
+ selectedCertificate = ((StructuredSelection) selection).getFirstElement();
}
};
}
@@ -201,32 +198,26 @@ public class TrustCertificateDialog extends SelectionDialog {
}
private IDoubleClickListener getDoubleClickListener() {
- return new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- StructuredSelection selection = (StructuredSelection) event.getSelection();
- Object selectedElement = selection.getFirstElement();
- if (selectedElement instanceof TreeNode) {
- TreeNode treeNode = (TreeNode) selectedElement;
- // create and open dialog for certificate chain
- X509CertificateViewDialog certificateViewDialog = new X509CertificateViewDialog(getShell(), (X509Certificate) treeNode.getValue());
- certificateViewDialog.open();
- }
+ return event -> {
+ StructuredSelection selection = (StructuredSelection) event.getSelection();
+ Object selectedElement = selection.getFirstElement();
+ if (selectedElement instanceof TreeNode) {
+ TreeNode treeNode = (TreeNode) selectedElement;
+ // create and open dialog for certificate chain
+ X509CertificateViewDialog certificateViewDialog = new X509CertificateViewDialog(getShell(), (X509Certificate) treeNode.getValue());
+ certificateViewDialog.open();
}
};
}
private ISelectionChangedListener getParentSelectionListener() {
- return new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection instanceof StructuredSelection) {
- TreeNode firstElement = (TreeNode) ((StructuredSelection) selection).getFirstElement();
- getCertificateChainViewer().setInput(new TreeNode[] {firstElement});
- getOkButton().setEnabled(listViewer.getChecked(firstElement));
- getCertificateChainViewer().refresh();
- }
+ return event -> {
+ ISelection selection = event.getSelection();
+ if (selection instanceof StructuredSelection) {
+ TreeNode firstElement = (TreeNode) ((StructuredSelection) selection).getFirstElement();
+ getCertificateChainViewer().setInput(new TreeNode[] {firstElement});
+ getOkButton().setEnabled(listViewer.getChecked(firstElement));
+ getCertificateChainViewer().refresh();
}
};
}

Back to the top