View Javadoc

1   package org.eparapher.rcp.wizards;
2   
3   import org.eclipse.jface.wizard.IWizardPage;
4   import org.eclipse.jface.wizard.WizardPage;
5   import org.eclipse.swt.layout.GridData;
6   import org.eclipse.swt.widgets.Button;
7   import org.eclipse.swt.widgets.Composite;
8   import org.eclipse.swt.widgets.Group;
9   import org.eparapher.rcp.tools.BaseWidgetUtils;
10  import org.eparapher.rcp.tools.GUIIcons;
11  
12  public class ImportKeysCertificatesWizardPageOne extends WizardPage implements
13  		IWizardPage {
14  
15  	private Button importX509fromCSR;
16  	private Button importTrustedX509;
17  	private Button importfromKeystore;
18  
19  	protected ImportKeysCertificatesWizardPageOne() {
20  		super("Importing keys and/or certificates");
21  		setTitle("Importing keys and/or certificates 1/2");
22  		setDescription("This wizard helps you importing certificates, keys and existing keystore.");
23  		setImageDescriptor(GUIIcons.WIZARD_IMPORT_IMG);
24  	}
25  
26  	public void createControl(Composite parent) {
27  		
28  		Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
29  
30  		Group importKC = BaseWidgetUtils.createGroup( composite, "Choose what to import : ", 1 );
31  		
32          GridData gd = new GridData( GridData.FILL_HORIZONTAL );
33          gd.horizontalSpan = 2;
34          importKC.setLayoutData( gd );
35          
36  		importX509fromCSR  = BaseWidgetUtils.createRadiobutton( importKC, "certificate chain (from CSR).", 1 );
37  		importX509fromCSR.setSelection(true);
38  		importTrustedX509  = BaseWidgetUtils.createRadiobutton( importKC, "trusted certificate.", 1 );
39  		importTrustedX509.setEnabled(false);
40  		importfromKeystore = BaseWidgetUtils.createRadiobutton( importKC, "Key(s) and certificate(s) from another keystore.", 1 );
41  		importfromKeystore.setEnabled(false);
42  		
43          setControl(composite);
44  		setPageComplete(true);
45  	}
46  	
47  	public boolean isCertChainFromCSR() {
48  		return importX509fromCSR.getSelection();
49  	}
50  
51  	public boolean isTrustedCert() {
52  		return importTrustedX509.getSelection();
53  	}
54  
55  	public boolean isFromAnotherKeystore() {
56  		return importfromKeystore.getSelection();
57  	}
58  }