TwoStepSignStep1Dialog2.java 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ///////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) 2018 Intel Corporation. //
  3. // //
  4. // All rights reserved. This program and the accompanying materials //
  5. // are made available under the terms of the Eclipse Public License v1.0 //
  6. // which accompanies this distribution, and is available at //
  7. // http://www.eclipse.org/legal/epl-v10.html //
  8. // //
  9. // Contributors: //
  10. // Intel Corporation - initial implementation and documentation //
  11. ///////////////////////////////////////////////////////////////////////////
  12. package com.intel.sgx.dialogs;
  13. import org.eclipse.swt.SWT;
  14. import org.eclipse.swt.layout.GridData;
  15. import org.eclipse.swt.layout.GridLayout;
  16. import org.eclipse.swt.widgets.Composite;
  17. import org.eclipse.swt.widgets.Control;
  18. import org.eclipse.swt.widgets.Group;
  19. import org.eclipse.swt.widgets.Label;
  20. import org.eclipse.swt.widgets.Shell;
  21. public class TwoStepSignStep1Dialog2 extends TwoStepSignDialogBase {
  22. final private String hashFile;
  23. public TwoStepSignStep1Dialog2(Shell parentShell, String hashFile) {
  24. super(parentShell);
  25. this.hashFile = hashFile;
  26. }
  27. @Override
  28. protected Control createDialogArea(Composite parent) {
  29. Composite composite = (Composite) super.createDialogArea(parent);
  30. final GridLayout gridLayout = new GridLayout(1,false);
  31. composite.setLayout(gridLayout);
  32. addGroup1(composite);
  33. addGroup3(composite);
  34. return composite;
  35. }
  36. private void addGroup1(Composite composite) {
  37. final Group container = new Group(composite, SWT.None);
  38. container.setLayout(new GridLayout(3,false));
  39. GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
  40. innergrid1.horizontalSpan = 3;
  41. container.setLayoutData(innergrid1);
  42. container.setText("Hash File:");
  43. final Label messageLabel = new Label(container, SWT.NONE);
  44. messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
  45. messageLabel.setText("Hash File Generated at Location:");
  46. final Label messageLabel1 = new Label(container, SWT.NONE);
  47. messageLabel1.setText(hashFile);
  48. messageLabel1.setLayoutData(new GridData(GridData.BEGINNING));
  49. }
  50. private void addGroup3(Composite composite) {
  51. final Group container3 = new Group(composite, SWT.None);
  52. container3.setLayout(new GridLayout(3,false));
  53. GridData innergrid3 = new GridData(GridData.FILL_HORIZONTAL);
  54. innergrid3.horizontalSpan = 3;
  55. container3.setLayoutData(innergrid3);
  56. container3.setText("Generate Signed Enclave (Step-2):");
  57. final Label messageLabel4 = new Label(container3, SWT.NONE);
  58. messageLabel4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
  59. messageLabel4.setText("To Generate Signed Enclave Now: Click OK");
  60. final Label messageLabel5 = new Label(container3, SWT.NONE);
  61. messageLabel5.setLayoutData(new GridData(GridData.CENTER, GridData.END, false, false, 3, 1));
  62. messageLabel5.setText("To Generate Signed Enclave Later: Click Cancel");
  63. }
  64. @Override
  65. protected void configureShell(Shell newShell) {
  66. super.configureShell(newShell);
  67. newShell.setText("Two Step Enclave Sign - Generate Hash");
  68. }
  69. }