Refined signing UX
authorkh5325.kim <kh5325.kim@samsung.com>
Thu, 21 Mar 2013 07:12:32 +0000 (16:12 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Thu, 21 Mar 2013 07:12:32 +0000 (16:12 +0900)
org.tizen.common.sign/META-INF/MANIFEST.MF
org.tizen.common.sign/src/org/tizen/common/sign/preferences/SigningPreferencePage.java
org.tizen.common.sign/src/org/tizen/common/sign/preferences/UIMessages.properties
org.tizen.common/src/org/tizen/common/TizenHelpContextIds.java

index 0dd0494..c30b2ad 100644 (file)
@@ -6,7 +6,8 @@ Bundle-Version: 2.0.0.qualifier
 Bundle-Activator: org.tizen.common.sign.Activator
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.tizen.common
+ org.tizen.common,
+ org.eclipse.help
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Import-Package: org.eclipse.core.resources
index 959b179..274e146 100755 (executable)
@@ -39,6 +39,7 @@ import org.eclipse.jface.dialogs.IInputValidator;
 import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.IFontProvider;
 import org.eclipse.jface.viewers.ISelection;
@@ -71,11 +72,14 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
 import org.eclipse.swt.widgets.ScrollBar;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+import org.tizen.common.TizenHelpContextIds;
 import org.tizen.common.sign.Activator;
 import org.tizen.common.sign.model.Certification.KeyExtension;
 import org.tizen.common.sign.util.SigningProfileUtil;
@@ -84,6 +88,8 @@ import org.tizen.common.util.FileUtil;
 public class SigningPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
 
     public static final String PREFERENCE_PAGE_ID = "org.tizen.common.sign.preferences.SigningPreferencePage"; //$NON-NLS-1$
+    private static final int GROUP_VINDENT = 5;
+
     List<SigningProfile> profileList;
     private TableViewer authorTableViewer;
     private TableViewer distributorTableViewer;
@@ -131,6 +137,8 @@ public class SigningPreferencePage extends PreferencePage implements IWorkbenchP
         if (defaultButton != null) {
             defaultButton.setVisible(false);
         }
+
+        PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, TizenHelpContextIds.HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT);
     }
     
     @Override
@@ -431,6 +439,40 @@ public class SigningPreferencePage extends PreferencePage implements IWorkbenchP
         composite.addControlListener(new ControlListenerImpl(composite, profileItemTableComposite, profileItemButtonComposite));
     }
 
+    protected Composite createNoteComposite(Font font, Composite composite,
+            String title, String message, SelectionListener listener) {
+        Composite messageComposite = new Composite(composite, SWT.NONE);
+        GridLayout messageLayout = new GridLayout();
+        messageLayout.numColumns = 2;
+        messageLayout.marginWidth = 0;
+        messageLayout.marginHeight = 0;
+        messageComposite.setLayout(messageLayout);
+        messageComposite.setLayoutData(new GridData(
+                GridData.HORIZONTAL_ALIGN_FILL));
+        messageComposite.setFont(font);
+
+        final Label noteLabel = new Label(messageComposite, SWT.BOLD);
+        noteLabel.setText(title);
+        noteLabel.setFont(JFaceResources.getFontRegistry().getBold(
+                JFaceResources.DIALOG_FONT));
+        noteLabel
+                .setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+
+        Link messageLabel = new Link(messageComposite, SWT.WRAP);
+        messageLabel.setText(message);
+        messageLabel.setFont(font);
+        messageLabel.addSelectionListener(listener);
+        return messageComposite;
+    }
+
+    private void addNote(Composite parent, String noteMessage, SelectionListener listener) {
+        Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), parent,
+            "Note:", noteMessage, listener);
+        GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+        gd.verticalIndent = GROUP_VINDENT;
+        noteControl.setLayoutData(gd);
+    }
+
     private void createAuthorSignatureComp(final Group profileItemComosite) {
         
         //Create author signature group
@@ -441,6 +483,17 @@ public class SigningPreferencePage extends PreferencePage implements IWorkbenchP
         Label authorLabel = new Label(authorComposite, SWT.NONE);
         authorLabel.setText(UIMessages.getString("org.tizen.common.sign.authorsigtitle")); //$NON-NLS-1$
 
+        addNote(authorComposite, UIMessages.getString("org.tizen.common.sign.note.certificate_generator"), new SelectionListener() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                PlatformUI.getWorkbench().getHelpSystem().displayHelp(TizenHelpContextIds.HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT);
+            }
+
+            @Override
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+        });
+
         final Composite composite = new Composite(authorComposite, SWT.NONE);
         composite.setLayout(createGridLayout(2));
         GridData data = new GridData(GridData.FILL_BOTH);
index 079e2f0..ef5c802 100644 (file)
@@ -3,8 +3,8 @@ org.tizen.common.sign.authorerrordialogtitle=Error generating Author Signature
 org.tizen.common.sign.distrierrordialogtitle=Error generating Distributor Signature
 org.tizen.common.sign.authcerterror=Problem generating Author signature. Aborting Author Signature generation.
 org.tizen.common.sign.checkauthorcertificate=Please check the signing configurations at
-org.tizen.common.sign.preference=Signing Preferences
-org.tizen.common.sign.profileerrormsg=Active signing profile is not set. Please check the signing configurations at <a>{0}</a>
+org.tizen.common.sign.preference=Preferences > Secure Profiles
+org.tizen.common.sign.profileerrormsg=Active secure profile is not set. Please check the signing configurations at <a>{0}</a>.
 org.tizen.common.sign.authkeyerror=Problem loading Author private key. Aborting Author Signature generation.
 org.tizen.common.sign.authcertkeyerror=Problem generating Author Signature. Aborting Author Signature generation.
 org.tizen.common.sign.districerterror=Problem generating Distributor signature. Aborting Distributor Signature generation.
@@ -30,3 +30,5 @@ org.tizen.common.sign.certificatevalidityerror=There was an error in certificate
 org.tizen.common.sign.certificatevaliditymessage1=The certificate corresponding to 
 org.tizen.common.sign.certificatevaliditymessage2=is not valid.\nThe certificate is not valid before
 org.tizen.common.sign.certificatevaliditymessage3=and after
+
+org.tizen.common.sign.note.certificate_generator=See <a>'Certificate Generator'</a> documentation to generate an author signature.
index 38ce5c7..da6608c 100644 (file)
@@ -30,6 +30,7 @@ public class TizenHelpContextIds
     private static final String HELP_COMMON = "org.tizen.ide.common.";
     public static final String HELP_COMMON_CONNECTION_EXPLORER_CONTEXT = HELP_COMMON + "connection_explorer_context";
     public static final String HELP_COMMON_LOG_CONTEXT = HELP_COMMON + "log_context";
+    public static final String HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT = HELP_COMMON + "certificate_generator_context";
 
     private static final String HELP_NATIVE = "org.tizen.ide.native.";
     public static final String HELP_NATIVE_CODECOVERAGE_CONTEXT = HELP_NATIVE + "codecoverage_context";
@@ -48,5 +49,4 @@ public class TizenHelpContextIds
     public static final String HELP_WEB_SIMULATOR_PREFERENCES_CONTEXT = HELP_WEB + "simulator_preferences_context";
     public static final String HELP_WEB_NEW_PROJECT_WIZARD_CONTEXT = HELP_WEB + "new_project_wizard_context";
     public static final String HELP_WEB_USER_TEMPLATE_CONTEXT = HELP_WEB + "user_template_context";
-    
 }