TwoStepSignStep1Dialog1.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.layout.GridLayout;
  14. import org.eclipse.swt.widgets.Composite;
  15. import org.eclipse.swt.widgets.Control;
  16. import org.eclipse.swt.widgets.Shell;
  17. import com.intel.sgx.handlers.TwoStepSignHandlerBase;
  18. public class TwoStepSignStep1Dialog1 extends TwoStepSignDialogBase {
  19. final private TwoStepSignHandlerBase handler;
  20. public TwoStepSignStep1Dialog1(Shell parentShell, TwoStepSignHandlerBase handler) {
  21. super(parentShell);
  22. this.handler = handler;
  23. }
  24. @Override
  25. protected Control createDialogArea(Composite parent) {
  26. Composite composite = (Composite) super.createDialogArea(parent);
  27. final GridLayout gridLayout = new GridLayout(1, false);
  28. composite.setLayout(gridLayout);
  29. enclaveFileField = addGroup(composite, "Unsigned Enclave Path:",
  30. "Select Enclave for which to generate the Hash.",
  31. "Enclave Path:", "Select Enclave", enclaveFileSelectionListener);
  32. hashFileField = addGroup(composite, "Generate Hash:",
  33. "Select Location to Output Hash File.", "Hash File Location:",
  34. "Select File Path", hashFileSelectionListener);
  35. configFileField = addGroup(composite, "Configuration File:",
  36. "Select Input Configuration XML File. ",
  37. "Configuration File:", "Select Config",
  38. configFileSelectionListener);
  39. composite.pack(true);
  40. return composite;
  41. }
  42. @Override
  43. protected void okPressed() {
  44. handler.enclaveFile = enclaveFileField.getText();
  45. handler.hashFile = hashFileField.getText();
  46. handler.configFile = configFileField.getText();
  47. super.okPressed();
  48. }
  49. @Override
  50. protected void configureShell(Shell newShell) {
  51. super.configureShell(newShell);
  52. newShell.setText("Two Step Enclave Sign - Generate Hash");
  53. }
  54. }