diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/AuthorizationManager.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/AuthorizationManager.java index 6e15ae7d27e..fefa14757bb 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/AuthorizationManager.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/AuthorizationManager.java @@ -17,34 +17,34 @@ import org.eclipse.ui.IWorkbenchWindow; /** - * The AuthorizationManager is the facility by which the end user - * is informed of the current state of the system with respect to - * bundle authorization based security. + * The AuthorizationManager is the facility by which the end user is informed of + * the current state of the system with respect to bundle authorization based + * security. */ public abstract class AuthorizationManager { public AuthorizationManager() { - //no content + // no content } /** * Query whether the authorization system is enabled for the system. * - * @return true if and only if authorization is enabled + * @return true if and only if authorization is enabled */ abstract public boolean isEnabled(); /** - * Returns true when the system is in need of attention from the end - * user. This means that some unauthorized content has been encountered, and the - * user has not yet inspected the situation. + * Returns true when the system is in need of attention from the end user. This + * means that some unauthorized content has been encountered, and the user has + * not yet inspected the situation. * * @return true if user attention is required */ abstract public boolean needsAttention(); /** - * Return an Eclipse IStatus object representing the current state of the + * Return an Eclipse IStatus object representing the current state of the * authorization system. * * @return IStatus code representing the system status @@ -52,8 +52,8 @@ public AuthorizationManager() { abstract public IStatus getStatus(); /** - * Open the authorization manager user interface so that the end - * user can view and edit the system's authorization state. + * Open the authorization manager user interface so that the end user can view + * and edit the system's authorization state. * * @param workbenchWindow the workbench window */ diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/SecurityContributionItemFactory.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/SecurityContributionItemFactory.java index 87fe11fa584..40a1cdab3ca 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/SecurityContributionItemFactory.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/SecurityContributionItemFactory.java @@ -33,15 +33,18 @@ public abstract class SecurityContributionItemFactory { private final String contributionItemId; /** - * Creates a new contribution item factory with the given id. - * @param contributionItemId the id of contribution items created by this factory - */ + * Creates a new contribution item factory with the given id. + * + * @param contributionItemId the id of contribution items created by this + * factory + */ protected SecurityContributionItemFactory(String contributionItemId) { this.contributionItemId = contributionItemId; } /** * Returns the id of this contribution item factory. + * * @return the id of contribution items created by this factory */ public String getId() { @@ -49,7 +52,7 @@ public String getId() { } /** - * Workbench contribution item (id "securityStatus"): An icon for + * Workbench contribution item (id "securityStatus"): An icon for * evaluating and inspecting the security status of the system. */ public static final ContributionItemFactory SECURITY_STATUS = new ContributionItemFactory("securityStatus") {//$NON-NLS-1$ diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java index 53f217f5fe9..fafc9abef38 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X500PrincipalHelper.java @@ -21,15 +21,16 @@ /** * X500PrincipalHelper *

- * Helper class to extract pieces (attributes) of an X500Principal object for display - * in the UI. + * Helper class to extract pieces (attributes) of an X500Principal object for + * display in the UI. *

- * This helper uses the X500Principal.RFC2253 format of X500Principal.getname() to parse an X500Principal name - * into it's component parts. - *

- * In principals which contain multiple occurrences of the same attribute,the default for all the methods - * is to return the most significant (first) attribute found. - * + * This helper uses the X500Principal.RFC2253 format of X500Principal.getname() + * to parse an X500Principal name into it's component parts. + *

+ * In principals which contain multiple occurrences of the same attribute,the + * default for all the methods is to return the most significant (first) + * attribute found. + * */ public class X500PrincipalHelper { @@ -60,8 +61,9 @@ public X500PrincipalHelper(X500Principal principal) { } /** - * Set the X500Principal name object to be parsed. - *

+ * Set the X500Principal name object to be parsed. + *

+ * * @param principal - X500Principal */ public void setPrincipal(X500Principal principal) { @@ -69,11 +71,11 @@ public void setPrincipal(X500Principal principal) { } /** - * Gets the most significant common name (CN) attribute from the given - * X500Principal object. - * For names that contains multiple attributes of this type. The first - * (most significant) one will be returned - *

+ * Gets the most significant common name (CN) attribute from the given + * X500Principal object. For names that contains multiple attributes of this + * type. The first (most significant) one will be returned + *

+ * * @return the Most significant common name attribute. * */ @@ -82,11 +84,10 @@ public String getCN() { } /** - * Gets the most significant Organizational Unit (OU) attribute from the given - * X500Principal object. - * For names that contains multiple attributes of this type. The first - * (most significant) one will be returned - *

+ * Gets the most significant Organizational Unit (OU) attribute from the given + * X500Principal object. For names that contains multiple attributes of this + * type. The first (most significant) one will be returned + *

* * @return the Most significant OU attribute. * @@ -98,11 +99,10 @@ public String getOU() { } /** - * Gets the most significant Organization (O) attribute from the given - * X500Principal object. - * For names that contains multiple attributes of this type. The first - * (most significant) one will be returned - *

+ * Gets the most significant Organization (O) attribute from the given + * X500Principal object. For names that contains multiple attributes of this + * type. The first (most significant) one will be returned + *

* * @return the Most significant O attribute. * @@ -114,9 +114,8 @@ public String getO() { } /** - * Gets the Country (C) attribute from the given - * X500Principal object. - *

+ * Gets the Country (C) attribute from the given X500Principal object. + *

* * @return the C attribute. * @@ -126,9 +125,8 @@ public String getC() { } /** - * Gets the Locale (L) attribute from the given - * X500Principal object. - *

+ * Gets the Locale (L) attribute from the given X500Principal object. + *

* * @return the L attribute. * @@ -138,9 +136,8 @@ public String getL() { } /** - * Gets the State (ST) attribute from the given - * X500Principal object. - *

+ * Gets the State (ST) attribute from the given X500Principal object. + *

* * @return the ST attribute. * @@ -150,9 +147,8 @@ public String getST() { } /** - * Gets the Street (STREET) attribute from the given - * X500Principal object. - *

+ * Gets the Street (STREET) attribute from the given X500Principal object. + *

* * @return the STREET attribute. * @@ -162,9 +158,9 @@ public String getSTREET() { } /** - * Gets the Email Address (EMAILADDRESS) attribute from the given - * X500Principal object. - *

+ * Gets the Email Address (EMAILADDRESS) attribute from the given X500Principal + * object. + *

* * @return the EMAILADDRESS attribute. * @@ -180,8 +176,8 @@ public String getUID() { /** * Derived From: org.eclipse.osgi.internal.verifier - DNChainMatching.java * - * Takes a distinguished name in canonical form and fills in the rdnArray - * with the extracted RDNs. + * Takes a distinguished name in canonical form and fills in the rdnArray with + * the extracted RDNs. * * @param dn the distinguished name in canonical form. * @throws IllegalArgumentException if a formatting error is found. @@ -228,12 +224,14 @@ private void parseDN(String dn) throws IllegalArgumentException { } /** - * Returns an ArrayList containing all the values for the given attribute identifier. + * Returns an ArrayList containing all the values for the given attribute + * identifier. *

- * @param attributeID String containing the X500 name attribute whose values are to be - * returned - * @return ArrayList containing the string values of the requested attribute. Values are in - * the order they occur. May be empty. + * + * @param attributeID String containing the X500 name attribute whose values are + * to be returned + * @return ArrayList containing the string values of the requested attribute. + * Values are in the order they occur. May be empty. * */ public ArrayList getAllValues(String attributeID) { @@ -244,7 +242,8 @@ public ArrayList getAllValues(String attributeID) { String namePart = nameList.get(0); if (namePart.startsWith(searchPart)) { - // Return the string starting after the ID string and the = sign that follows it. + // Return the string starting after the ID string and the = sign that follows + // it. retList.add(namePart.toString().substring(searchPart.length())); } } @@ -265,9 +264,10 @@ private String findSignificantPart(String attributeID, int significance) { String namePart = nameList.get(0); if (namePart.startsWith(searchPart)) { - // Return the string starting after the ID string and the = sign that follows it. + // Return the string starting after the ID string and the = sign that follows + // it. retNamePart = namePart.toString().substring(searchPart.length()); - // By definition the first one is most significant + // By definition the first one is most significant if (significance == MOSTSIGNIFICANT) break; } diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X509CertificateViewDialog.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X509CertificateViewDialog.java index 0425cdc6403..e901f031941 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X509CertificateViewDialog.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/provisional/security/ui/X509CertificateViewDialog.java @@ -60,7 +60,8 @@ protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); TabFolder tabFolder = new TabFolder(composite, SWT.BORDER); - GridData bdata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL); + GridData bdata = new GridData( + GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL); tabFolder.setLayoutData(bdata); createBasicTab(tabFolder); @@ -177,7 +178,8 @@ private void createBasicTab(TabFolder tabFolder) { basicTab.setControl(basicTabComposite); } - protected static void configureLayout(Control c, int horizontalSpan, int verticalSpan, int horizontalIndent, int vertIndent) { + protected static void configureLayout(Control c, int horizontalSpan, int verticalSpan, int horizontalIndent, + int vertIndent) { GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = horizontalSpan; diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/DefaultAuthorizationManager.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/DefaultAuthorizationManager.java index 37d68462d04..d730cb6037b 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/DefaultAuthorizationManager.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/DefaultAuthorizationManager.java @@ -40,7 +40,7 @@ public boolean isEnabled() { @Override public boolean needsAttention() { - return needsAttention; //TODO: make it happen + return needsAttention; // TODO: make it happen } @Override @@ -51,23 +51,23 @@ public IStatus getStatus() { @Override public void displayManager(IWorkbenchWindow workbenchWindow) { - //TODO: manager UI + // TODO: manager UI } private IStatus transformStatus(int engineStatus) { Status status = null; switch (engineStatus) { - case AuthorizationStatus.OK : - status = new Status(IStatus.OK, Activator.getSymbolicName(), ""); //$NON-NLS-1$ //TODO: text - break; + case AuthorizationStatus.OK: + status = new Status(IStatus.OK, Activator.getSymbolicName(), ""); //$NON-NLS-1$ //TODO: text + break; - case AuthorizationStatus.ERROR : - status = new Status(IStatus.ERROR, Activator.getSymbolicName(), ""); //$NON-NLS-1$ //TODO: text - break; + case AuthorizationStatus.ERROR: + status = new Status(IStatus.ERROR, Activator.getSymbolicName(), ""); //$NON-NLS-1$ //TODO: text + break; - default : - status = null; - break; + default: + status = null; + break; } return status; } diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityStatusControl.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityStatusControl.java index a3d3b0dcebd..5ec445c33dd 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityStatusControl.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityStatusControl.java @@ -25,14 +25,13 @@ import org.eclipse.ui.IWorkbenchWindow; /** - * This contribution item is used to create a visual cue that informs the - * user of bundles disabled in the system for signature validation reasons. + * This contribution item is used to create a visual cue that informs the user + * of bundles disabled in the system for signature validation reasons. * - * It has the following functions: - * - Two levels of severity, represented by two distinct graphical icons - * - Visual notification when new user attention is required (e.g. throbbing) - * - An informational message when the user hovers over the icon - * - A right-click menu for contributing security related actions + * It has the following functions: - Two levels of severity, represented by two + * distinct graphical icons - Visual notification when new user attention is + * required (e.g. throbbing) - An informational message when the user hovers + * over the icon - A right-click menu for contributing security related actions * * @since 3.4 */ @@ -64,7 +63,7 @@ public SecurityStatusControl(IWorkbenchWindow window) { * Creates the contribution item. * * @param window the window - * @param id the id + * @param id the id */ public SecurityStatusControl(IWorkbenchWindow window, String id) { super(id); @@ -133,20 +132,20 @@ protected static Image getIcon(IconState iconState) { IStatus status = iconState.getStatus(); ImageDescriptor imgDesc = null; switch (status.getSeverity()) { - case IStatus.OK : - imgDesc = Activator.getImageDescriptor(IMAGE_PATH_OK); - break; + case IStatus.OK: + imgDesc = Activator.getImageDescriptor(IMAGE_PATH_OK); + break; - case IStatus.ERROR : - imgDesc = Activator.getImageDescriptor(IMAGE_PATH_ERROR); - break; + case IStatus.ERROR: + imgDesc = Activator.getImageDescriptor(IMAGE_PATH_ERROR); + break; - default : - imgDesc = Activator.getImageDescriptor(IMAGE_PATH_UNKNOWN); - break; + default: + imgDesc = Activator.getImageDescriptor(IMAGE_PATH_UNKNOWN); + break; } returnValue = imgDesc.createImage(); - //TODO: decorate for needsAttention + // TODO: decorate for needsAttention } else { ImageDescriptor imgDesc = Activator.getImageDescriptor(IMAGE_PATH_DISABLED); returnValue = imgDesc.createImage(); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityUIMsg.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityUIMsg.java index 4911093ecb2..b8c2235a2fe 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityUIMsg.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/SecurityUIMsg.java @@ -61,8 +61,8 @@ public class SecurityUIMsg extends NLS { public static String CATPAGE_LABEL_ADVANCED; // messages for default policy page - //public static String POLPAGE_LABEL_SECTION; - //public static String POLPAGE_LABEL_TITLE; + // public static String POLPAGE_LABEL_SECTION; + // public static String POLPAGE_LABEL_TITLE; public static String POLPAGE_LABEL_DESC; public static String POLPAGE_BUTTON_ALLOW_ANY; public static String POLPAGE_BUTTON_ALLOW_ANY_SIGNED; @@ -82,7 +82,7 @@ public class SecurityUIMsg extends NLS { public static String CERTPAGE_BUTTON_VIEW; public static String CERTPAGE_ERROR_UNKNOWN_FORMAT; - //messages for advanced page + // messages for advanced page public static String ADVPAGE_LABEL_PROVIDER; public static String ADVPAGE_LABEL_VERSION; public static String ADVPAGE_LABEL_DESCRIPTION; @@ -135,7 +135,7 @@ public class SecurityUIMsg extends NLS { public static String LABEL_NAMECONSTRAINTS_NOTCA; // These map to specific Extended Key Usage OIDs - // Not currently used + // Not currently used public static String LABEL_EXTKEYUSAGE_SERVERAUTH; public static String LABEL_EXTKEYUSAGE_CLIENTAUTH; public static String LABEL_EXTKEYUSAGE_CODESIGNING; diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttribute.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttribute.java index 52dc6b00dba..923aff20069 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttribute.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttribute.java @@ -16,21 +16,23 @@ /** * Used by the X509CertificateAttributeContentProvider. * - * Objects of this class contain a decomposition of an attribute in an X509 certificate so it can be - * displayed in the UI. + * Objects of this class contain a decomposition of an attribute in an X509 + * certificate so it can be displayed in the UI. * */ public class X509CertificateAttribute { // Description of the field - // NOTE: This will show in the UI so it should be loaded from a translatable properties file. + // NOTE: This will show in the UI so it should be loaded from a translatable + // properties file. private String fieldDescription; - // A String representation of the value of the field. May have undergone some - // transformation to make it "pretty" in the UI + // A String representation of the value of the field. May have undergone some + // transformation to make it "pretty" in the UI private String stringVal; - // The raw data object from inside the certificate. Most likely whatever object the getter method - // for the field returns. + // The raw data object from inside the certificate. Most likely whatever object + // the getter method + // for the field returns. private Object rawValue; public X509CertificateAttribute(String propDescription, String StringVal, Object objValue) { diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeContentProvider.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeContentProvider.java index abe4d04a144..bc57d0e8b82 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeContentProvider.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeContentProvider.java @@ -26,13 +26,15 @@ import org.eclipse.osgi.util.NLS; /** - * X509CertificateAttributeContentProvider - * Structured content provided for an X509Certificate - * object. - *

- * Currently this only supports the attributes exposed directly by X509Certificate. Some commonly used extensions - * may not be displayed. Contributions and enhancements are welcomed. - * + * X509CertificateAttributeContentProvider Structured content provided for an + * X509Certificate + * object. + *

+ * Currently this only supports the attributes exposed directly by + * X509Certificate. Some commonly used extensions may not be displayed. + * Contributions and enhancements are welcomed. + * */ public class X509CertificateAttributeContentProvider implements IStructuredContentProvider { @@ -52,8 +54,11 @@ public class X509CertificateAttributeContentProvider implements IStructuredConte private static final DateFormat _df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.FULL); - // TODO - This is a bit ugly but gets the job done... Maybe this should be a class of it's own ?? - private static String keyUsageStrings[] = {LABEL_KEYUSAGE_DIGITALSIGNATURE, LABEL_KEYUSAGE_NONREPUDIATION, LABEL_KEYUSAGE_KEYENCIPHERMENT, LABEL_KEYUSAGE_DATAENCIPHERMENT, LABEL_KEYUSAGE_KEYAGREEMENT, LABEL_KEYUSAGE_CERTSIGN, LABEL_KEYUSAGE_CRLSIGN, LABEL_KEYUSAGE_ENCIPHERONLY, LABEL_KEYUSAGE_DECIPHERONLY}; + // TODO - This is a bit ugly but gets the job done... Maybe this should be a + // class of it's own ?? + private static String keyUsageStrings[] = { LABEL_KEYUSAGE_DIGITALSIGNATURE, LABEL_KEYUSAGE_NONREPUDIATION, + LABEL_KEYUSAGE_KEYENCIPHERMENT, LABEL_KEYUSAGE_DATAENCIPHERMENT, LABEL_KEYUSAGE_KEYAGREEMENT, + LABEL_KEYUSAGE_CERTSIGN, LABEL_KEYUSAGE_CRLSIGN, LABEL_KEYUSAGE_ENCIPHERONLY, LABEL_KEYUSAGE_DECIPHERONLY }; public X509CertificateAttributeContentProvider() { super(); @@ -94,65 +99,78 @@ public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) { viewer = aViewer; clear(false); // clear the viewer. - // Be safe ... check the input + // Be safe ... check the input if (newInput instanceof X509Certificate) { X509Certificate theCert = (X509Certificate) newInput; - X509CertificateAttribute ver = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_VERSION, Integer.toString(theCert.getVersion())); + X509CertificateAttribute ver = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_VERSION, + Integer.toString(theCert.getVersion())); elements.add(ver); - X509CertificateAttribute serialNum = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_SERIAL_NUM, theCert.getSerialNumber().toString()); + X509CertificateAttribute serialNum = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_SERIAL_NUM, + theCert.getSerialNumber().toString()); elements.add(serialNum); - X509CertificateAttribute validFrom = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_VALID_FROM, _df.format(theCert.getNotBefore()), theCert.getNotBefore()); + X509CertificateAttribute validFrom = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_VALID_FROM, + _df.format(theCert.getNotBefore()), theCert.getNotBefore()); elements.add(validFrom); - X509CertificateAttribute validTo = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_VALID_TO, _df.format(theCert.getNotAfter()), theCert.getNotAfter()); + X509CertificateAttribute validTo = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_VALID_TO, + _df.format(theCert.getNotAfter()), theCert.getNotAfter()); elements.add(validTo); - X509CertificateAttribute issuedBy = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_ISSUED_BY, theCert.getIssuerX500Principal().getName(), theCert.getIssuerX500Principal()); + X509CertificateAttribute issuedBy = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_ISSUED_BY, + theCert.getIssuerX500Principal().getName(), theCert.getIssuerX500Principal()); elements.add(issuedBy); - X509CertificateAttribute IssuedToItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_ISSUED_TO, theCert.getSubjectX500Principal().getName(), theCert.getSubjectX500Principal()); + X509CertificateAttribute IssuedToItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_ISSUED_TO, + theCert.getSubjectX500Principal().getName(), theCert.getSubjectX500Principal()); elements.add(IssuedToItem); - X509CertificateAttribute sigAlgoItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_SIG_ALGO, theCert.getSigAlgName()); + X509CertificateAttribute sigAlgoItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_SIG_ALGO, + theCert.getSigAlgName()); elements.add(sigAlgoItem); boolean keyUsagesArray[] = theCert.getKeyUsage(); StringBuilder keyUsages = new StringBuilder(); // - // Only set the string field, If we got some data + // Only set the string field, If we got some data if (keyUsagesArray != null && keyUsagesArray.length > 0) { for (int i = 0; i < keyUsagesArray.length; i++) { if (keyUsagesArray[i]) keyUsages.append(keyUsageStrings[i] + listDelim); } - X509CertificateAttribute keyUsage = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_KEY_USAGE, (keyUsages.toString()).substring(0, keyUsages.length() - 2), theCert.getKeyUsage()); + X509CertificateAttribute keyUsage = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_KEY_USAGE, + (keyUsages.toString()).substring(0, keyUsages.length() - 2), theCert.getKeyUsage()); elements.add(keyUsage); } /* - * Thumbprint is not actually "in" the certificate. It is computed on the fly... + * Thumbprint is not actually "in" the certificate. It is computed on the fly... */ - X509CertificateAttribute thumbPrintItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_THMBPRINT, getThumbprint(theCert, "SHA1")); //$NON-NLS-1$ + X509CertificateAttribute thumbPrintItem = new X509CertificateAttribute( + SecurityUIMsg.CERTPROP_X509_THMBPRINT, getThumbprint(theCert, "SHA1")); //$NON-NLS-1$ elements.add(thumbPrintItem); PublicKey pubKey = theCert.getPublicKey(); - X509CertificateAttribute pubKeyInfoItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_THMBPRINTX509_PUBKEY_INFO, getHex(pubKey.getEncoded())); + X509CertificateAttribute pubKeyInfoItem = new X509CertificateAttribute( + SecurityUIMsg.CERTPROP_X509_THMBPRINTX509_PUBKEY_INFO, getHex(pubKey.getEncoded())); elements.add(pubKeyInfoItem); try { Collection> subAltNamesVctr = theCert.getSubjectAlternativeNames(); - // StringBuffer bfrSubAltNames = new StringBuffer(); + // StringBuffer bfrSubAltNames = new StringBuffer(); if (subAltNamesVctr != null && subAltNamesVctr.size() > 0) { // TODO - Make alt names into a displayable list... // For now just display that they exist.. - X509CertificateAttribute subAltItem = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_SUB_ALT_NAMES, "Has Subject Alternate Names" /*bfrSubAltNames.toString()*/, theCert.getSubjectAlternativeNames()); //$NON-NLS-1$ + X509CertificateAttribute subAltItem = new X509CertificateAttribute( + SecurityUIMsg.CERTPROP_X509_SUB_ALT_NAMES, + "Has Subject Alternate Names" /* bfrSubAltNames.toString() */, //$NON-NLS-1$ + theCert.getSubjectAlternativeNames()); elements.add(subAltItem); } } catch (CertificateParsingException e1) { @@ -169,13 +187,18 @@ public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) { basicCnstrntsBfr.append(SecurityUIMsg.LABEL_NAMECONSTRAINTS_ISCA + listDelim); if (basicCnstrnts == Integer.MAX_VALUE) { // MAX_VALUE means "no limit to the allowed length of the certification path." - basicCnstrntsBfr.append(NLS.bind(SecurityUIMsg.LABEL_NAMECONSTRAINTS_PATHLENGTH, new Object[] {SecurityUIMsg.LABEL_NAMECONSTRAINTS_PATHLENGTH_UNLIMITED}) + listDelim); + basicCnstrntsBfr.append(NLS.bind(SecurityUIMsg.LABEL_NAMECONSTRAINTS_PATHLENGTH, + new Object[] { SecurityUIMsg.LABEL_NAMECONSTRAINTS_PATHLENGTH_UNLIMITED }) + listDelim); } else { - basicCnstrntsBfr.append(NLS.bind(SecurityUIMsg.LABEL_NAMECONSTRAINTS_PATHLENGTH, new Object[] {basicConstraint}) + listDelim); + basicCnstrntsBfr.append( + NLS.bind(SecurityUIMsg.LABEL_NAMECONSTRAINTS_PATHLENGTH, new Object[] { basicConstraint }) + + listDelim); } } - X509CertificateAttribute basicConstraints = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_BASIC_CNSTRNTS, (basicCnstrntsBfr.toString()).substring(0, basicCnstrntsBfr.length() - 2), basicConstraint); + X509CertificateAttribute basicConstraints = new X509CertificateAttribute( + SecurityUIMsg.CERTPROP_X509_BASIC_CNSTRNTS, + (basicCnstrntsBfr.toString()).substring(0, basicCnstrntsBfr.length() - 2), basicConstraint); elements.add(basicConstraints); List exKeyUsg; @@ -187,7 +210,10 @@ public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) { exKeyUsgBfr.append((string) + listDelim); } - X509CertificateAttribute exKeyUsgProp = new X509CertificateAttribute(SecurityUIMsg.CERTPROP_X509_EXKEY_USAGE, (exKeyUsgBfr.toString()).substring(0, exKeyUsgBfr.length() - 2), theCert.getExtendedKeyUsage()); + X509CertificateAttribute exKeyUsgProp = new X509CertificateAttribute( + SecurityUIMsg.CERTPROP_X509_EXKEY_USAGE, + (exKeyUsgBfr.toString()).substring(0, exKeyUsgBfr.length() - 2), + theCert.getExtendedKeyUsage()); elements.add(exKeyUsgProp); } diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeLabelProvider.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeLabelProvider.java index 385bfe8466c..1c87a721f46 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeLabelProvider.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/X509CertificateAttributeLabelProvider.java @@ -22,14 +22,15 @@ /** * X509CertificateAttributeLabelProvider *

- * Label provider for a 2 column table that shows the attributes (fields) in an X509 digital - * certificate. - * See X509Certificate + * Label provider for a 2 column table that shows the attributes (fields) in an + * X509 digital certificate. See + * X509Certificate *

- * The first column is the Attribute name and the second column is the string representation of the - * attribute's value. + * The first column is the Attribute name and the second column is the string + * representation of the attribute's value. *

- * Used by org.eclipse.equinox.security.ui.wizard.CertificateViewer + * Used by org.eclipse.equinox.security.ui.wizard.CertificateViewer * */ public class X509CertificateAttributeLabelProvider extends LabelProvider implements ITableLabelProvider { @@ -52,14 +53,14 @@ public String getColumnText(Object element, int columnIndex) { if (element instanceof X509CertificateAttribute) { X509CertificateAttribute curEntry = (X509CertificateAttribute) element; switch (columnIndex) { - // Attribute/field Name - case 0 : - text = curEntry.getDescription(); - break; - // Attribute/field string value - case 1 : - text = curEntry.getStringValue(); - break; + // Attribute/field Name + case 0: + text = curEntry.getDescription(); + break; + // Attribute/field string value + case 1: + text = curEntry.getStringValue(); + break; } } return text; diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/preferences/SecurityCategoryPage.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/preferences/SecurityCategoryPage.java index 7c690330fbe..e2bf6e1019a 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/preferences/SecurityCategoryPage.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/preferences/SecurityCategoryPage.java @@ -29,7 +29,7 @@ public class SecurityCategoryPage extends PreferencePage implements IWorkbenchPreferencePage { public SecurityCategoryPage() { - //empty + // empty } @Override @@ -43,7 +43,9 @@ protected Control createContents(Composite parent) { GridLayout layout = new GridLayout(); pageArea.setLayout(layout); - PreferenceLinkArea storageLinkArea = new PreferenceLinkArea(pageArea, SWT.NONE, "org.eclipse.equinox.security.ui.storage", SecurityUIMsg.CATPAGE_LABEL_STORAGE, (IWorkbenchPreferenceContainer) getContainer(), null); //$NON-NLS-1$ + PreferenceLinkArea storageLinkArea = new PreferenceLinkArea(pageArea, SWT.NONE, + "org.eclipse.equinox.security.ui.storage", SecurityUIMsg.CATPAGE_LABEL_STORAGE, //$NON-NLS-1$ + (IWorkbenchPreferenceContainer) getContainer(), null); storageLinkArea.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); Dialog.applyDialogFont(pageArea); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/ChallengeResponseDialog.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/ChallengeResponseDialog.java index e4d4a6d0182..735db2b7726 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/ChallengeResponseDialog.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/ChallengeResponseDialog.java @@ -140,7 +140,7 @@ protected void okPressed() { public String[][] getResult() { if (questionsText == null || answersText == null) return null; - return new String[][] {questionsText, answersText}; + return new String[][] { questionsText, answersText }; } } diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java index e315c19f6a9..953d410ec58 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java @@ -24,8 +24,8 @@ import org.eclipse.ui.PlatformUI; /** - * This password provider prompts user for the password. This provider uses the same password for - * all secure preferences. + * This password provider prompts user for the password. This provider uses the + * same password for all secure preferences. */ public class DefaultPasswordProvider extends PasswordProvider { @@ -64,7 +64,8 @@ public boolean retryOnError(Exception e, IPreferencesContainer container) { final Boolean[] result = new Boolean[1]; PlatformUI.getWorkbench().getDisplay().syncExec(() -> { - boolean reply = MessageDialog.openConfirm(StorageUtils.getShell(), SecUIMessages.exceptionTitle, SecUIMessages.exceptionDecode); + boolean reply = MessageDialog.openConfirm(StorageUtils.getShell(), SecUIMessages.exceptionTitle, + SecUIMessages.exceptionDecode); result[0] = Boolean.valueOf(reply); }); return result[0].booleanValue(); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/PasswordRecoveryDialog.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/PasswordRecoveryDialog.java index daec41f6763..668761aa3a8 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/PasswordRecoveryDialog.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/PasswordRecoveryDialog.java @@ -113,14 +113,16 @@ protected void okPressed() { answersText[i] = answers[i].getText(); } - String password = InternalExchangeUtils.recoverPassword(answersText, SecurePreferencesFactory.getDefault(), moduleID); + String password = InternalExchangeUtils.recoverPassword(answersText, SecurePreferencesFactory.getDefault(), + moduleID); if (password == null) { MessageBox prompt = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.YES | SWT.NO); prompt.setText(SecUIMessages.pswdRecoveryTitle); prompt.setMessage(SecUIMessages.pswNotRecoveredMsg); if (prompt.open() == SWT.YES) return; - } else { // even in UI case we use digested and encoded password - makes no sense to show it + } else { // even in UI case we use digested and encoded password - makes no sense to show + // it MessageBox prompt = new MessageBox(getShell(), SWT.ICON_INFORMATION | SWT.OK); prompt.setText(SecUIMessages.pswdRecoveryTitle); prompt.setMessage(SecUIMessages.pswRecoveredMsg); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StorageLoginDialog.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StorageLoginDialog.java index fb437fc87b6..559a38e3a99 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StorageLoginDialog.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StorageLoginDialog.java @@ -40,7 +40,8 @@ public class StorageLoginDialog extends TitleAreaDialog { private static final String HELP_ID = Activator.PLUGIN_ID + ".StorageLoginDialog"; //$NON-NLS-1$ - private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(StorageLoginDialog.class, "/icons/storage/login_wiz.png"); //$NON-NLS-1$ + private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(StorageLoginDialog.class, + "/icons/storage/login_wiz.png"); //$NON-NLS-1$ private static final String DIGEST_ALGORITHM = "MD5"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java index f1a2c026654..54b3b0300e5 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/StoragePreferencePage.java @@ -30,7 +30,7 @@ public class StoragePreferencePage extends PreferencePage implements IWorkbenchP protected TabAdvanced advancedTab; public StoragePreferencePage() { - //empty + // empty } @Override diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabContents.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabContents.java index 66b69f35694..e0882b8d672 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabContents.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabContents.java @@ -68,7 +68,8 @@ public TabContents(TabFolder folder, int index, final Shell shell) { new Label(rightPane, SWT.NONE).setText(SecUIMessages.keysTable); - Table tableOfValues = new Table(rightPane, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION); + Table tableOfValues = new Table(rightPane, + SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION); tableOfValues.setLinesVisible(true); tableOfValues.setHeaderVisible(true); tableOfValues.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); @@ -94,17 +95,14 @@ public TabContents(TabFolder folder, int index, final Shell shell) { validateSave(); // save could fail so re-check })); - /* Removed for the time being. In future modify/show/export operations could be - * re-introduced with some special access token required to be entered by the user - Button buttonExport = new Button(buttonBar, SWT.CENTER); - buttonExport.setText(SecUIMessages.exportButton); - setButtonSize(buttonExport, minButtonWidth); - buttonExport.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - export(); - } - }); - */ + /* + * Removed for the time being. In future modify/show/export operations could be + * re-introduced with some special access token required to be entered by the + * user Button buttonExport = new Button(buttonBar, SWT.CENTER); + * buttonExport.setText(SecUIMessages.exportButton); setButtonSize(buttonExport, + * minButtonWidth); buttonExport.addSelectionListener(new SelectionAdapter() { + * public void widgetSelected(SelectionEvent e) { export(); } }); + */ Button buttonDelete = new Button(buttonBar, SWT.PUSH); buttonDelete.setText(SecUIMessages.deleteButton); @@ -206,7 +204,7 @@ protected void deteleDefaultStorage() { defaultStorage.clear(); defaultStorage.removeNode(); - // clear it from the list of open storages, delete the file + // clear it from the list of open storages, delete the file InternalExchangeUtils.defaultStorageDelete(); if (nodesView != null) diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java index 06136f4c795..28dbe32dbc1 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/TabPassword.java @@ -204,7 +204,7 @@ private void fillProviderTable() { HashSet disabledModules = getDisabledModules(); for (PasswordProviderDescription module : InternalExchangeUtils.passwordProvidersFind()) { TableItem item = new TableItem(providerTable, SWT.NONE); - item.setText(new String[] {module.getName(), Integer.toString(module.getPriority())}); + item.setText(new String[] { module.getName(), Integer.toString(module.getPriority()) }); item.setData(module); if (disabledModules == null) item.setChecked(true); @@ -254,10 +254,11 @@ protected void enableButtons() { } protected HashSet getDisabledModules() { - IScopeContext[] scopes = {ConfigurationScope.INSTANCE, DefaultScope.INSTANCE}; + IScopeContext[] scopes = { ConfigurationScope.INSTANCE, DefaultScope.INSTANCE }; IPreferencesService preferencesService = Platform.getPreferencesService(); String defaultPreferenceValue = ""; //$NON-NLS-1$ - String tmp = preferencesService.getString(PREFERENCES_PLUGIN, IStorageConstants.DISABLED_PROVIDERS_KEY, defaultPreferenceValue, scopes); + String tmp = preferencesService.getString(PREFERENCES_PLUGIN, IStorageConstants.DISABLED_PROVIDERS_KEY, + defaultPreferenceValue, scopes); HashSet disabledModules = splitModuleIds(tmp); return disabledModules; } @@ -270,7 +271,8 @@ public void performDefaults() { TableItem[] items = providerTable.getItems(); for (TableItem item : items) { String moduleId = getModuleId(item); - boolean enabled = defaultDisabledModules == null || moduleId == null || !defaultDisabledModules.contains(moduleId); + boolean enabled = defaultDisabledModules == null || moduleId == null + || !defaultDisabledModules.contains(moduleId); if (item.getChecked() != enabled) { item.setChecked(enabled); providerModified = true; diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java index dca3ba9c1bd..68a09e538cc 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java @@ -28,8 +28,8 @@ import org.eclipse.ui.progress.UIJob; /** - * Methods on this class could be called from non-UI thread so need - * to wrap into Display.syncExec(). + * Methods on this class could be called from non-UI thread so need to wrap into + * Display.syncExec(). */ public class UICallbackProvider implements IUICallbacks { @@ -66,7 +66,8 @@ public void setupPasswordRecovery(final int size, final String moduleID, final I UIJob reciverySetupJob = new UIJob(SecUIMessages.pswJobName) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { - boolean reply = MessageDialog.openQuestion(StorageUtils.getShell(), SecUIMessages.pswdRecoveryOptionTitle, SecUIMessages.pswdRecoveryOptionMsg); + boolean reply = MessageDialog.openQuestion(StorageUtils.getShell(), + SecUIMessages.pswdRecoveryOptionTitle, SecUIMessages.pswdRecoveryOptionMsg); if (!reply) return Status.OK_STATUS; ChallengeResponseDialog dialog = new ChallengeResponseDialog(size, StorageUtils.getShell()); @@ -108,7 +109,8 @@ public void execute(final IStorageTask callback) throws StorageException { } exception[0] = task.getException(); }); - } else { // we are running in non-UI thread, use Job to show small progress indicator on the status bar + } else { // we are running in non-UI thread, use Job to show small progress indicator on + // the status bar Job job = new Job(SecUIMessages.secureStorageInitialization) { @Override protected IStatus run(IProgressMonitor monitor) { diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ExportDialog.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ExportDialog.java index f0b393acf90..04619a3b29e 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ExportDialog.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ExportDialog.java @@ -34,9 +34,10 @@ public class ExportDialog extends TitleAreaDialog { private static final String HELP_ID = Activator.PLUGIN_ID + ".ExportDialog"; //$NON-NLS-1$ - private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(ExportDialog.class, "/icons/storage/export_secure_wiz.png"); //$NON-NLS-1$ + private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(ExportDialog.class, + "/icons/storage/export_secure_wiz.png"); //$NON-NLS-1$ - protected final static String[] exportExtensions = new String[] {".txt"}; //$NON-NLS-1$ + protected final static String[] exportExtensions = new String[] { ".txt" }; //$NON-NLS-1$ protected static final String EXPORT_FILE = "org.eclipse.equinox.security.ui.exportfile"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ISecurePreferencesSelection.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ISecurePreferencesSelection.java index cff6ce12a59..1e486ae9fde 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ISecurePreferencesSelection.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ISecurePreferencesSelection.java @@ -19,6 +19,7 @@ public interface ISecurePreferencesSelection { /** * Called by child elements to inform container that current selection has been * modified + * * @param selectedNode newly selected element */ public void setSelection(ISecurePreferences selectedNode); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NewValueDialog.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NewValueDialog.java index e7ed3262b0a..5d2052d51b5 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NewValueDialog.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NewValueDialog.java @@ -28,7 +28,8 @@ public class NewValueDialog extends TitleAreaDialog { private static final String HELP_ID = Activator.PLUGIN_ID + ".NewValueDialog"; //$NON-NLS-1$ - private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/new_value_wiz.png"); //$NON-NLS-1$ + private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(NodesView.class, + "/icons/storage/new_value_wiz.png"); //$NON-NLS-1$ private final String[] existingKeys; diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NodesView.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NodesView.java index 0255c8bbb8e..03f35545249 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NodesView.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/NodesView.java @@ -32,9 +32,9 @@ public class NodesView { /** - * For tree viewer to work, the input must not be the same as the root node - * or it will get short circuit. Also input can not be null - so have to pass - * some dummy value as an input. + * For tree viewer to work, the input must not be the same as the root node or + * it will get short circuit. Also input can not be null - so have to pass some + * dummy value as an input. */ final private static String defaultPrefs = "default"; //$NON-NLS-1$ @@ -65,7 +65,7 @@ public void dispose() { @Override public Object[] getElements(Object parent) { if (defaultPrefs.equals(parent)) - return new Object[] {SecurePreferencesFactory.getDefault()}; + return new Object[] { SecurePreferencesFactory.getDefault() }; return new Object[0]; } @@ -181,7 +181,8 @@ public void run() { }; refreshNodesAction.setText(SecUIMessages.refreshNodesCommand); refreshNodesAction.setToolTipText(SecUIMessages.refreshNodesCommandTip); - refreshNodesAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/node_refresh.gif")); //$NON-NLS-1$ + refreshNodesAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/node_refresh.gif")); //$NON-NLS-1$ addNodeAction = new Action() { @Override @@ -212,7 +213,8 @@ public void run() { }; addNodeAction.setText(SecUIMessages.addNodeCommand); addNodeAction.setToolTipText(SecUIMessages.addNodeCommandTip); - addNodeAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/node_new.gif")); //$NON-NLS-1$ + addNodeAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/node_new.gif")); //$NON-NLS-1$ removeNodeAction = new Action() { @Override @@ -236,7 +238,8 @@ public void run() { }; removeNodeAction.setText(SecUIMessages.removeNodeCommand); removeNodeAction.setToolTipText(SecUIMessages.removeNodeCommandTip); - removeNodeAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/node_delete.gif")); //$NON-NLS-1$ + removeNodeAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/node_delete.gif")); //$NON-NLS-1$ } public void setFocus() { diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ValuesView.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ValuesView.java index e3e2f96161f..75a8f8bb32f 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ValuesView.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/view/ValuesView.java @@ -34,8 +34,8 @@ public class ValuesView { /** - * The default value of this variable (false, meaning "not in debug of secure storage" - * removes showValueAction, encryptValueAction, and decryptValueAction. + * The default value of this variable (false, meaning "not in debug of secure + * storage" removes showValueAction, encryptValueAction, and decryptValueAction. */ static private boolean inDevelopmentMode = false; @@ -133,12 +133,12 @@ public String getColumnText(Object obj, int index) { if (!(obj instanceof TableValuesElement)) return obj.toString(); switch (index) { - case 0 : - return ((TableValuesElement) obj).getKey(); - case 1 : - return ((TableValuesElement) obj).getValue(); - default : - return obj.toString(); + case 0: + return ((TableValuesElement) obj).getKey(); + case 1: + return ((TableValuesElement) obj).getValue(); + default: + return obj.toString(); } } @@ -246,7 +246,8 @@ public void run() { if (selectedNode == null) return; - NewValueDialog newValueDialog = new NewValueDialog(selectedNode.keys(), tableViewer.getControl().getShell()); + NewValueDialog newValueDialog = new NewValueDialog(selectedNode.keys(), + tableViewer.getControl().getShell()); if (newValueDialog.open() != Window.OK) return; String key = newValueDialog.getKey(); @@ -263,7 +264,8 @@ public void run() { }; addValueAction.setText(SecUIMessages.addValueCommand); addValueAction.setToolTipText(SecUIMessages.addValueCommandTmp); - addValueAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/value_new.gif")); //$NON-NLS-1$ + addValueAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/value_new.gif")); //$NON-NLS-1$ removeValueAction = new Action() { @Override @@ -278,7 +280,7 @@ public void run() { TableValuesElement node = (TableValuesElement) selected; String key = node.getKey(); - // "Are you sure?" dialog + // "Are you sure?" dialog MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO); dialog.setText(SecUIMessages.removeValueTitle); String msg = NLS.bind(SecUIMessages.removeValueMsg, key); @@ -292,7 +294,8 @@ public void run() { }; removeValueAction.setText(SecUIMessages.removeValueCommand); removeValueAction.setToolTipText(SecUIMessages.removeValueCommandTmp); - removeValueAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/value_delete.gif")); //$NON-NLS-1$ + removeValueAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/value_delete.gif")); //$NON-NLS-1$ if (inDevelopmentMode) addDevelopmentMenuOptions(); @@ -329,7 +332,8 @@ public void run() { }; showValueAction.setText(SecUIMessages.showValueCommand); showValueAction.setToolTipText(SecUIMessages.showValueCommandTmp); - showValueAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/value_show.gif")); //$NON-NLS-1$ + showValueAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/value_show.gif")); //$NON-NLS-1$ encryptValueAction = new Action() { @Override @@ -339,7 +343,8 @@ public void run() { }; encryptValueAction.setText(SecUIMessages.encryptValueCommand); encryptValueAction.setToolTipText(SecUIMessages.encryptValueCommandTmp); - encryptValueAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/encrypt.gif")); //$NON-NLS-1$ + encryptValueAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/encrypt.gif")); //$NON-NLS-1$ decryptValueAction = new Action() { @Override @@ -349,7 +354,8 @@ public void run() { }; decryptValueAction.setText(SecUIMessages.decryptValueCommand); decryptValueAction.setToolTipText(SecUIMessages.decryptValueCommandTmp); - decryptValueAction.setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/decrypt.gif")); //$NON-NLS-1$ + decryptValueAction + .setImageDescriptor(ImageDescriptor.createFromFile(NodesView.class, "/icons/storage/decrypt.gif")); //$NON-NLS-1$ } protected void reCodeValue(boolean encrypted) { diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportCertSelectPage.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportCertSelectPage.java index b3cc6eb7d90..ecf9ba7d326 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportCertSelectPage.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportCertSelectPage.java @@ -66,7 +66,7 @@ public void createControl(Composite parent) { certPreview = new Composite(certSelectComposite, SWT.None); certPreview.setLayout(new GridLayout()); GridData gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL); - // gd.horizontalSpan = 2; + // gd.horizontalSpan = 2; certPreview.setLayoutData(gd); } @@ -81,7 +81,8 @@ private void populateDropDown() { try { certList = new ArrayList<>(); // For a set or list - for (Certificate certificate : certFact.generateCertificates(new FileInputStream(certImportWizard.selectedImportFile))) { + for (Certificate certificate : certFact + .generateCertificates(new FileInputStream(certImportWizard.selectedImportFile))) { certList.add(certificate); } diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportFileSelectPage.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportFileSelectPage.java index d2636412f2d..53eeaa30c83 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportFileSelectPage.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportFileSelectPage.java @@ -58,7 +58,8 @@ public void createControl(Composite parent) { // browse button browseDirectoriesButton = new Button(certSelectComposite, SWT.PUSH); browseDirectoriesButton.setText(SecurityUIMsg.WIZARD_BROWSE); - browseDirectoriesButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> handleLocationFileButtonPressed())); + browseDirectoriesButton + .addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> handleLocationFileButtonPressed())); addListeners(); } @@ -75,7 +76,7 @@ protected void handleLocationFileButtonPressed() { final FileDialog certFileDialog = new FileDialog(filePathField.getShell(), SWT.OPEN); certFileDialog.setText(SecurityUIMsg.WIZARD_SELECT_FILE); certFileDialog.setFilterPath(filePathField.getText()); - certFileDialog.setFilterExtensions(new String[] {"*.cer", "*.p7b", "*.der"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + certFileDialog.setFilterExtensions(new String[] { "*.cer", "*.p7b", "*.der" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ String selectedCert = certFileDialog.open(); if (selectedCert != null) { @@ -102,7 +103,7 @@ public void handleEvent(Event e) { public IWizardPage getNextPage() { File file = new File(filePathField.getText().trim()); if (file.isDirectory() || !file.exists()) { - setErrorMessage(NLS.bind(SecurityUIMsg.WIZARD_FILE_NOT_FOUND, new String[] {filePathField.getText()})); + setErrorMessage(NLS.bind(SecurityUIMsg.WIZARD_FILE_NOT_FOUND, new String[] { filePathField.getText() })); return null; } saveFileSelection(); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportTrustEngineSelectPage.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportTrustEngineSelectPage.java index b7761433784..0438a770158 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportTrustEngineSelectPage.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportTrustEngineSelectPage.java @@ -53,7 +53,7 @@ public void createControl(Composite parent) { aliasField.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL)); /* - * create the trust engine area + * create the trust engine area */ Label targetEngineLabel = new Label(certSelectComposite, SWT.None); targetEngineLabel.setText(SecurityUIMsg.WIZARD_TARGET_TRUST_ENGINE); @@ -98,7 +98,8 @@ public void handleEvent(Event e) { setErrorMessage(SecurityUIMsg.WIZARD_ERROR_ENGINE_REQUIRED); } else { setErrorMessage(null); - ((CertificateImportWizard) getWizard()).selectTrustEngine = trustEngines.get(trustEngineCombo.getSelectionIndex()); + ((CertificateImportWizard) getWizard()).selectTrustEngine = trustEngines + .get(trustEngineCombo.getSelectionIndex()); } } getWizard().getContainer().updateButtons(); diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportWizard.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportWizard.java index 4922029b4f1..240fd1505ad 100644 --- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportWizard.java +++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/wizard/CertificateImportWizard.java @@ -23,7 +23,7 @@ public class CertificateImportWizard extends Wizard implements IImportWizard { - // ImportWizardPage mainPage; + // ImportWizardPage mainPage; CertificateImportFileSelectPage selectCertFilePage; CertificateImportCertSelectPage selectCertPage; CertificateImportTrustEngineSelectPage selectTrustEnginePage; @@ -40,13 +40,13 @@ public CertificateImportWizard() { @Override public void init(IWorkbench workbench, IStructuredSelection selection) { - //nothing + // nothing } @Override public void addPages() { - // mainPage = new ImportWizardPage(SecurityUIMsg.IMPORT_FILE); //NON-NLS-1 - // addPage(mainPage); + // mainPage = new ImportWizardPage(SecurityUIMsg.IMPORT_FILE); //NON-NLS-1 + // addPage(mainPage); selectCertFilePage = new CertificateImportFileSelectPage(SecurityUIMsg.WIZARD_PAGE_FILE_CERT_SELECT); addPage(selectCertFilePage);