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;
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;
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;
if (defaultButton != null) {
defaultButton.setVisible(false);
}
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, TizenHelpContextIds.HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT);
}
@Override
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
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);
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.
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.