@Override
  public void setActiveTab(ILaunchConfigurationTab tab) {
    if (activeTab != null) {
      activeTab.deactivated(workingCopy);
      activeTab.getControl().dispose();
    }

    activeTab = tab;

    if (activeTab != null) {
      launchConfigArea.setRedraw(false);

      configNameText.setVisible(true);

      activeTab.createControl(launchConfigArea);
      //      GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL,
      // SWT.BEGINNING).applyTo(
      //          activeTab.getControl());
      launchConfigArea.setContent(activeTab.getControl());
      activeTab.getControl().setSize(activeTab.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT));
      configUI.layout(true);

      activeTab.activated(workingCopy);

      launchConfigArea.setRedraw(true);
    } else {
      configNameText.setVisible(false);
    }

    updateButtons();
    updateMessage();
  }
 private void initTextModulename() {
   if (composer.hasCustomFilename()) {
     textModulename.setVisible(true);
     labelModulename.setVisible(true);
   } else {
     textModulename.setVisible(false);
     labelModulename.setVisible(false);
   }
 }
  private void addAutoActivationSection(final Composite composite) {
    autoActivateButton = new Button(composite, SWT.CHECK);
    autoActivateButton.setText("&Enable auto activation");
    GridData gd;
    // gd = new GridData(SWT.FILL, SWT.FILL, true,
    // false, 3, 1);
    gd = new GridData();
    gd.horizontalSpan = 3;
    autoActivateButton.setLayoutData(gd);

    autoActivateButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent e) {
            updateAutoActivationControls();
          }
        });

    delayText = addLabelledTextField(composite, "Auto activation dela&y:", 4, 0);
    erlangTriggersText =
        addLabelledTextField(composite, "Auto activation triggers for &Erlang:", 100, 4, 0);
    eDocTriggersText =
        addLabelledTextField(composite, "Auto activation triggers for E&Doc:", 100, 4, 0);
    eDocTriggersText.setVisible(false);
    labelControl.setVisible(false);
  }
Example #4
0
 protected void showStackTrace(boolean visible) {
   Point windowSize = getShell().getSize();
   Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
   GridData stackTraceGD = ((GridData) errorStackTrace.getLayoutData());
   if (visible) {
     stackTraceGD.heightHint = errorStackTrace.getLineHeight() * STACK_TRACE_LINE_COUNT;
     detailsButton.setText(CompatibleDialogConstants.get().HIDE_DETAILS_LABEL);
     errorStackTrace.setVisible(true);
   } else {
     stackTraceGD.heightHint = 0;
     detailsButton.setText(CompatibleDialogConstants.get().SHOW_DETAILS_LABEL);
     errorStackTrace.setVisible(false);
   }
   Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
   getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
 }
 private void disableSimpleFields() {
   countLbl.setVisible(false);
   count.setVisible(false);
   intervalLbl.setVisible(false);
   interval.setVisible(false);
   GridData gd = (GridData) count.getLayoutData();
   gd.exclude = true;
   GridData gdlbl = (GridData) countLbl.getLayoutData();
   gdlbl.exclude = true;
   GridData gdEvent = (GridData) interval.getLayoutData();
   gdEvent.exclude = true;
   GridData gdeventlbl = (GridData) intervalLbl.getLayoutData();
   gdeventlbl.exclude = true;
   triggerSection.setExpanded(false);
   triggerSection.setExpanded(true);
 }
Example #6
0
 void refreshObject() {
   int index = list.getSelectionIndex();
   if (index == -1) return;
   if (check.getSelection()) {
     ByteArrayOutputStream stream = new ByteArrayOutputStream();
     PrintStream s = new PrintStream(stream);
     errors[index].printStackTrace(s);
     text.setText(stream.toString());
     text.setVisible(true);
     canvas.setVisible(false);
   } else {
     canvas.setVisible(true);
     text.setVisible(false);
     canvas.redraw();
   }
 }
Example #7
0
  @Override
  protected Control createContents(final Composite parent) {
    noDefaultAndApplyButton();
    final Composite panel = new Composite(parent, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    panel.setLayout(layout);

    final Label img = new Label(panel, SWT.NONE);
    img.setLayoutData(new GridData(79, SWT.DEFAULT));
    img.setImage(
        ResourceManager.getPluginImage(ErlideUIPlugin.PLUGIN_ID, "icons/full/obj16/erlang058.gif"));

    final Group composite = new Group(panel, SWT.NONE);
    final GridData gd_composite = new GridData(SWT.FILL, SWT.CENTER, false, false);
    gd_composite.widthHint = 356;
    composite.setLayoutData(gd_composite);
    composite.setLayout(new GridLayout());

    final Label text = new Label(composite, SWT.NONE);
    text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    text.setToolTipText("Vlad Dumitrescu, Jakob Cederlund and others");
    text.setText(PreferenceMessages.ErlangPreferencePage_2);

    final Label textv = new Label(composite, SWT.NONE);
    textv.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    final String version = ErlangPlugin.getDefault().getCore().getFeatureVersion();
    textv.setText("    version " + version);

    final Link erlideorgLink = new Link(composite, SWT.NONE);
    erlideorgLink.setText(PreferenceMessages.ErlangPreferencePage_3);

    final Link updateLink = new Link(composite, SWT.NONE);
    updateLink.setText(PreferenceMessages.ErlangPreferencePage_4);
    new Label(panel, SWT.NONE);

    final Button reportButton = new Button(panel, SWT.NONE);
    reportButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent e) {
            PreferencesUtil.createPreferenceDialogOn(
                getShell(), "org.erlide.ui.reporting", null, null);
          }
        });
    reportButton.setText("Report problems");
    new Label(panel, SWT.NONE);

    txtLocalErlangNodes = new Text(panel, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI);
    txtLocalErlangNodes.setText(
        "This machine supports local Erlang nodes with only short names \nbecause of its hostname configuration. \n\nTo enable long names locally, make sure that the machine \nhas a proper FQDN on the network. ");
    final GridData gd_txtLocalErlangNodes = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_txtLocalErlangNodes.widthHint = 339;
    gd_txtLocalErlangNodes.heightHint = 87;
    txtLocalErlangNodes.setLayoutData(gd_txtLocalErlangNodes);
    txtLocalErlangNodes.setVisible(false);

    return panel;
  }
 private void disableCronFields() {
   cron.setVisible(false);
   cronLbl.setVisible(false);
   GridData gd = (GridData) cron.getLayoutData();
   gd.exclude = true;
   GridData gdlbl = (GridData) cronLbl.getLayoutData();
   gdlbl.exclude = true;
   triggerSection.setExpanded(false);
   triggerSection.setExpanded(true);
 }
Example #9
0
 protected Control createStackTraceText(Composite parent) {
   errorStackTrace = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
   applyDialogFont(errorStackTrace);
   errorStackTrace.setText(""); // $NON-NLS-1$
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.widthHint = CUSTOM_ELEMENTS_WIDTH_HINT;
   data.heightHint = 0; // stackTraceText.getLineHeight() * TEXT_LINE_COUNT;
   errorStackTrace.setVisible(false);
   // data.horizontalSpan = 2;
   errorStackTrace.setLayoutData(data);
   return errorStackTrace;
 }
Example #10
0
  @Override
  public void createControl(Composite parent) {

    composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    Text pageText = new Text(composite, SWT.CENTER);
    pageText.setBounds(composite.getBounds());
    pageText.setText("Toolchain F Wizard Page");
    pageText.setVisible(true);
  }
 private void setVisibleAlfrescoType(boolean visible, boolean isTask) {
   if (PreferencesUtil.getBooleanPreference(Preferences.ALFRESCO_ENABLE)) {
     if (visible) {
       if (isTask) {
         alfrescoTaskTypeButton.setSelection(visible);
       } else {
         alfrescoExecutionTypeButton.setSelection(visible);
       }
     } else {
       alfrescoTaskTypeButton.setSelection(visible);
       alfrescoExecutionTypeButton.setSelection(visible);
     }
   }
   scriptText.setVisible(visible);
   scriptLabel.setVisible(visible);
   runAsText.setVisible(visible);
   runAsLabel.setVisible(visible);
   scriptProcessorText.setVisible(visible);
   scriptProcessorLabel.setVisible(visible);
   extensionLabel.setVisible(!visible);
   fieldEditor.setVisible(!visible);
 }
 public void setErrorMessage(String errorMessage) {
   this.errorMessage = errorMessage;
   if (errorMessageText != null && !errorMessageText.isDisposed()) {
     errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); // $NON-NLS-1$
     boolean hasError =
         errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0;
     errorMessageText.setEnabled(hasError);
     errorMessageText.setVisible(hasError);
     errorMessageText.getParent().update();
     Control button = getButton(IDialogConstants.OK_ID);
     if (button != null) {
       button.setEnabled(errorMessage == null);
     }
   }
 }
Example #13
0
 /**
  * Sets or clears the error message. If not <code>null</code>, the OK button is disabled.
  *
  * @param errorMessage the error message, or <code>null</code> to clear
  */
 public void setErrorMessage(String errorMessage) {
   this.errorMessage = errorMessage;
   if (errorMessageText != null && !errorMessageText.isDisposed()) {
     errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); // $NON-NLS-1$
     // Disable the error message text control if there is no error, or
     // no error text (empty or whitespace only). Hide it also to avoid color change.
     boolean hasError =
         errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0;
     errorMessageText.setEnabled(hasError);
     errorMessageText.setVisible(hasError);
     errorMessageText.getParent().update();
     // Access the ok button by id, in case clients have overridden button creation.
     Control button = getButton(IDialogConstants.OK_ID);
     if (button != null) {
       button.setEnabled(errorMessage == null);
     }
   }
 }
Example #14
0
  private void checkPage() {
    boolean createBranchSelected = createBranch.getSelection();
    branchText.setEnabled(createBranchSelected);
    branchText.setVisible(createBranchSelected);
    branchTextlabel.setVisible(createBranchSelected);
    GridData gd = (GridData) branchText.getLayoutData();
    gd.exclude = !createBranchSelected;
    gd = (GridData) branchTextlabel.getLayoutData();
    gd.exclude = !createBranchSelected;

    boolean createTagSelected = createTag.getSelection();
    tagText.setEnabled(createTagSelected);
    tagText.setVisible(createTagSelected);
    tagTextlabel.setVisible(createTagSelected);
    gd = (GridData) tagText.getLayoutData();
    gd.exclude = !createTagSelected;
    gd = (GridData) tagTextlabel.getLayoutData();
    gd.exclude = !createTagSelected;
    branchText.getParent().layout(true);

    boolean showActivateAdditionalRefs = false;
    showActivateAdditionalRefs =
        (checkout.getSelection() || dontCheckout.getSelection())
            && !Activator.getDefault()
                .getPreferenceStore()
                .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS);

    gd = (GridData) warningAdditionalRefNotActive.getLayoutData();
    gd.exclude = !showActivateAdditionalRefs;
    warningAdditionalRefNotActive.setVisible(showActivateAdditionalRefs);
    warningAdditionalRefNotActive.getParent().layout(true);

    setErrorMessage(null);
    try {
      if (refText.getText().length() > 0) {
        Change change = Change.fromRef(refText.getText());
        if (change == null) {
          setErrorMessage(UIText.FetchGerritChangePage_MissingChangeMessage);
          return;
        }
      } else {
        setErrorMessage(UIText.FetchGerritChangePage_MissingChangeMessage);
        return;
      }

      boolean emptyRefName =
          (createBranchSelected && branchText.getText().length() == 0)
              || (createTagSelected && tagText.getText().length() == 0);
      if (emptyRefName) {
        setErrorMessage(UIText.FetchGerritChangePage_ProvideRefNameMessage);
        return;
      }

      boolean existingRefName =
          (createBranchSelected && repository.getRef(branchText.getText()) != null)
              || (createTagSelected && repository.getRef(tagText.getText()) != null);
      if (existingRefName) {
        setErrorMessage(
            NLS.bind(UIText.FetchGerritChangePage_ExistingRefMessage, branchText.getText()));
        return;
      }
    } catch (IOException e1) {
      // ignore here
    } finally {
      setPageComplete(getErrorMessage() == null);
    }
  }
  private void createDialogUI(Composite parent) {
    GridLayoutFactory.fillDefaults().margins(12, 6).applyTo(parent);

    SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
    GridDataFactory.fillDefaults()
        .grab(true, true)
        .align(SWT.FILL, SWT.FILL)
        .hint(725, 360)
        .applyTo(sashForm);

    Composite leftComposite = new Composite(sashForm, SWT.NONE);
    GridLayoutFactory.fillDefaults().applyTo(leftComposite);
    GridDataFactory.swtDefaults()
        .grab(false, true)
        .align(SWT.FILL, SWT.FILL)
        .applyTo(leftComposite);

    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolBar = toolBarManager.createControl(leftComposite);
    toolBar.setBackground(parent.getBackground());
    GridDataFactory.swtDefaults().grab(true, false).align(SWT.BEGINNING, SWT.FILL).applyTo(toolBar);

    launchesViewer = new TableViewer(leftComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
    launchesViewer.setLabelProvider(
        new DelegatingStyledCellLabelProvider(new LaunchConfigLabelProvider()));
    launchesViewer.setComparator(new ViewerComparator(String.CASE_INSENSITIVE_ORDER));
    launchesViewer.setContentProvider(new LaunchConfigContentProvider());
    launchesViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
    launchesViewer.getTable().setFocus();
    launchesViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          @Override
          public void selectionChanged(SelectionChangedEvent event) {
            handleSelectedConfigChanged();
          }
        });

    GridDataFactory.swtDefaults()
        .grab(false, true)
        .align(SWT.FILL, SWT.FILL)
        .hint(50, 50)
        .applyTo(launchesViewer.getControl());

    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

    for (final ILaunchConfigurationType configType : manager.getLaunchConfigurationTypes()) {
      CreateLaunchAction action = new CreateLaunchAction(this, configType);

      toolBarManager.add(action);
    }

    // toolBarManager.add(new Separator());
    toolBarManager.add(getDeleteAction());

    toolBarManager.update(true);

    configUI = new Composite(sashForm, SWT.NONE);
    GridLayoutFactory.fillDefaults().applyTo(configUI);
    GridDataFactory.swtDefaults()
        .grab(true, false)
        .align(SWT.FILL, SWT.BEGINNING)
        .applyTo(configUI);

    toolBar.pack();
    Label toolbarSpacer = new Label(configUI, SWT.NONE);
    GridDataFactory.swtDefaults().hint(SWT.NONE, toolBar.getSize().y).applyTo(toolbarSpacer);

    Composite nameComposite = new Composite(configUI, SWT.NONE);
    GridDataFactory.swtDefaults()
        .grab(true, false)
        .align(SWT.FILL, SWT.FILL)
        .applyTo(nameComposite);
    GridLayoutFactory.swtDefaults().margins(6, 0).applyTo(nameComposite);

    configNameText = new Text(nameComposite, SWT.SINGLE | SWT.BORDER);
    GridDataFactory.swtDefaults()
        .grab(true, false)
        .align(SWT.FILL, SWT.CENTER)
        .applyTo(configNameText);
    configNameText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(ModifyEvent e) {
            if (workingCopy != null) {
              workingCopy.rename(configNameText.getText());
            }
          }
        });

    launchConfigArea = new ScrolledComposite(configUI, SWT.V_SCROLL);
    GridDataFactory.swtDefaults()
        .grab(true, true)
        .align(SWT.FILL, SWT.FILL)
        .applyTo(launchConfigArea);
    launchConfigArea.setExpandVertical(false);
    launchConfigArea.setExpandHorizontal(true);

    configNameText.setVisible(false);

    sashForm.setWeights(new int[] {33, 67});

    selectLaunchConfigFromPage();
  }
  private void createGroup() {
    try {
      final GridLayout gridLayout_3 = new GridLayout();
      gridLayout_3.verticalSpacing = 10;
      gridLayout_3.marginWidth = 10;
      gridLayout_3.marginTop = 10;
      gridLayout_3.marginRight = 10;
      gridLayout_3.marginLeft = 10;
      gridLayout_3.marginHeight = 10;
      gridLayout_3.marginBottom = 10;
      gridLayout_3.numColumns = 3;

      final Group composite = JOE_G_DetailForm_MainGroup.Control(new Group(this, SWT.NONE));
      composite.addDisposeListener(
          new DisposeListener() {
            public void widgetDisposed(final DisposeEvent e) {
              if (butApply.isEnabled()) {
                save();
              }
            }
          });
      composite.setLayout(new GridLayout());
      final GridData gridData_6 = new GridData(GridData.FILL, GridData.CENTER, true, true, 3, 1);
      gridData_6.heightHint = 31;
      composite.setLayoutData(gridData_6);

      parameterGroup = JOE_G_DetailForm_ParameterGroup.Control(new Group(composite, SWT.NONE));
      parameterGroup.setEnabled(false);
      //			parameterGroup.setText("Detail Parameter");
      final GridData gridData_3 = new GridData(GridData.FILL, GridData.FILL, true, true);
      gridData_3.heightHint = 239;
      parameterGroup.setLayoutData(gridData_3);
      final GridLayout gridLayout_2 = new GridLayout();
      gridLayout_2.numColumns = 6;
      parameterGroup.setLayout(gridLayout_2);

      @SuppressWarnings("unused")
      final Label nameLabel = JOE_L_Name.Control(new Label(parameterGroup, SWT.NONE));
      //			nameLabel.setText("Name");

      txtName = JOE_T_DetailForm_Name.Control(new Text(parameterGroup, SWT.BORDER));
      //			txtName.addFocusListener(new FocusAdapter() {
      //				public void focusGained(final FocusEvent e) {
      //					txtName.selectAll();
      //				}
      //			});
      txtName.addModifyListener(
          new ModifyListener() {
            public void modifyText(final ModifyEvent e) {
              if (!txtName.getText().equals("")
                  && (tableParams.getSelectionCount() == 0
                      || (tableParams.getSelectionCount() > 0
                          && !tableParams
                              .getSelection()[0]
                              .getText(0)
                              .equalsIgnoreCase(txtName.getText())))) {
                isEditableParam = true;
                butApplyParam.setEnabled(isEditableParam);
                txtValue.setEnabled(true);
                butText.setEnabled(true);
                paramText.setText("");
                txtParamNote.setEnabled(true);
              } else {
                butText.setEnabled(false);
              }
            }
          });
      txtName.addKeyListener(
          new KeyAdapter() {
            public void keyPressed(final KeyEvent e) {
              if (e.keyCode == SWT.CR && !txtName.getText().equals("")) {
                addParam();
              }
            }
          });
      txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
      txtName.setFocus();

      @SuppressWarnings("unused")
      final Label valueLabel = JOE_L_Value.Control(new Label(parameterGroup, SWT.NONE));
      //			valueLabel.setText("Value");

      txtValue = JOE_T_DetailForm_Value.Control(new Text(parameterGroup, SWT.BORDER));
      //			txtValue.addFocusListener(new FocusAdapter() {
      //				public void focusGained(final FocusEvent e) {
      //					txtValue.selectAll();
      //				}
      //			});
      txtValue.addKeyListener(
          new KeyAdapter() {
            public void keyPressed(final KeyEvent e) {
              if (e.keyCode == SWT.CR && !txtName.getText().equals("")) {
                addParam();
              }
            }
          });
      txtValue.addModifyListener(
          new ModifyListener() {
            public void modifyText(final ModifyEvent e) {
              if (!txtName.getText().equals("")
                  && (tableParams.getSelectionCount() == 0
                      || (tableParams.getSelectionCount() > 0
                          && !tableParams
                              .getSelection()[0]
                              .getText(1)
                              .equalsIgnoreCase(txtValue.getText())))) {
                isEditableParam = true;
                butApplyParam.setEnabled(isEditableParam);
                if (txtValue.getText().trim().length() > 0) butText.setEnabled(false);
                else butText.setEnabled(true);
              }
            }
          });
      txtValue.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

      butText = JOE_B_DetailForm_Text.Control(new Button(parameterGroup, SWT.NONE));
      butText.setEnabled(false);
      butText.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              String ntext = "";
              if (tableParams.getSelectionCount() > 0) {
                TableItem item = tableParams.getSelection()[0];
                ntext = item.getText(2);
              }
              String text =
                  sos.scheduler.editor.app.Utils.showClipboard(ntext, getShell(), true, "");
              if (text != null && !text.trim().equalsIgnoreCase(ntext)) {
                paramText.setText(text);
                txtValue.setText("");
                txtValue.setEnabled(false);
                butText.setEnabled(true);
                addParam();
              } else if (text == null) {
                txtValue.setEnabled(true);
                butText.setEnabled(true);
              } else {
                txtValue.setEnabled(true);
                butText.setEnabled(false);
              }
              butApply.setEnabled(true);
            }
          });
      //			butText.setText("Text");

      butApplyParam = JOE_B_DetailForm_ApplyParam.Control(new Button(parameterGroup, SWT.NONE));
      butApplyParam.setEnabled(isEditableParam);
      butApplyParam.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              addParam();
            }
          });
      final GridData gridData_9 = new GridData(GridData.FILL, GridData.BEGINNING, false, false);
      butApplyParam.setLayoutData(gridData_9);
      //			butApplyParam.setText("Apply");

      tableParams =
          JOE_Tbl_DetailForm_Params.Control(
              new Table(parameterGroup, SWT.FULL_SELECTION | SWT.BORDER));
      tableParams.setEnabled(false);
      tableParams.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              if (tableParams.getSelectionCount() > 0) {
                TableItem item = tableParams.getSelection()[0];
                txtName.setText(item.getText(0));
                // param value ist angegeben
                if (item.getText(1) != null && item.getText(1).trim().length() > 0) {
                  paramText.setText("");
                  txtValue.setText(item.getText(1));
                  txtValue.setEnabled(true);
                  butText.setEnabled(false);
                }
                // param Textknoten ist angegeben
                if (item.getText(2) != null && item.getText(2).trim().length() > 0) {
                  paramText.setText(item.getText(2));
                  txtValue.setText("");
                  txtValue.setEnabled(false);
                  butText.setEnabled(true);
                }
                if (item.getText(1).trim().equals("") && item.getText(2).trim().equals("")) {
                  paramText.setText("");
                  txtValue.setText("");
                  txtValue.setEnabled(true);
                  butText.setEnabled(true);
                }
                txtParamNote.setText(
                    detailListener.getParamNote(item.getText(0), comboLanguage.getText()));
                butRemove.setEnabled(true);
                txtParamNote.setEnabled(true);
                isEditableParam = false;
              } else {
                butRemove.setEnabled(false);
              }
            }
          });
      tableParams.setLinesVisible(true);
      tableParams.setHeaderVisible(true);
      final GridData gridData_4 = new GridData(GridData.FILL, GridData.FILL, true, true, 5, 7);
      tableParams.setLayoutData(gridData_4);

      final TableColumn newColumnTableColumn =
          JOE_TCl_DetailForm_NameColumn.Control(new TableColumn(tableParams, SWT.NONE));
      //			newColumnTableColumn.setText("Name");
      newColumnTableColumn.setWidth(118);
      newColumnTableColumn.addControlListener(
          new ControlAdapter() {
            public void controlResized(final ControlEvent e) {
              w.saveTableColumn("tableParams", newColumnTableColumn);
            }
          });
      w.restoreTableColumn("tableParams", newColumnTableColumn, 118);

      final TableColumn newColumnTableColumn_1 =
          JOE_TCl_DetailForm_ValueColumn.Control(new TableColumn(tableParams, SWT.NONE));
      //			newColumnTableColumn_1.setText("Value");
      newColumnTableColumn_1.setWidth(150);
      newColumnTableColumn_1.addControlListener(
          new ControlAdapter() {
            public void controlResized(final ControlEvent e) {
              w.saveTableColumn("tableParams", newColumnTableColumn_1);
            }
          });
      w.restoreTableColumn("tableParams", newColumnTableColumn_1, 150);

      final TableColumn newColumnTableColumn_2 =
          JOE_TCl_DetailForm_TextColumn.Control(new TableColumn(tableParams, SWT.NONE));
      //			newColumnTableColumn_2.setText("Text");
      newColumnTableColumn_2.setWidth(100);
      newColumnTableColumn_2.addControlListener(
          new ControlAdapter() {
            public void controlResized(final ControlEvent e) {
              w.saveTableColumn("tableParams", newColumnTableColumn_2);
            }
          });
      w.restoreTableColumn("tableParams", newColumnTableColumn_2, 100);

      final Button butNew = JOE_B_DetailForm_New.Control(new Button(parameterGroup, SWT.NONE));
      butNew.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              txtName.setText("");
              txtValue.setText("");
              paramText.setText("");
              txtValue.setEnabled(true);
              paramText.setEnabled(true);
              tableParams.deselectAll();
              txtParamNote.setText("");
            }
          });
      butNew.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      //			butNew.setText("New");

      final Composite composite_2 = JOE_Composite1.Control(new Composite(parameterGroup, SWT.NONE));
      final GridData gridData_2_1 = new GridData(GridData.CENTER, GridData.CENTER, false, false);
      gridData_2_1.heightHint = 67;
      composite_2.setLayoutData(gridData_2_1);
      composite_2.setLayout(new GridLayout());

      butUp = JOE_B_DetailForm_Up.Control(new Button(composite_2, SWT.NONE));
      butUp.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              detailListener.changeUp(tableParams);
            }
          });
      butUp.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      butUp.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_up.gif"));

      butDown = JOE_B_DetailForm_Down.Control(new Button(composite_2, SWT.NONE));
      butDown.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              detailListener.changeDown(tableParams);
            }
          });
      butDown.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
      butDown.setImage(ResourceManager.getImageFromResource("/sos/scheduler/editor/icon_down.gif"));

      final Button parameterButton =
          JOE_B_DetailForm_Wizard.Control(new Button(parameterGroup, SWT.NONE));
      parameterButton.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              startWizzard();
            }
          });

      // parameterButton.setVisible(type != Editor.DETAILS);
      parameterButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      //			parameterButton.setText("Wizard");

      butRemove = JOE_B_DetailForm_Remove.Control(new Button(parameterGroup, SWT.NONE));
      butRemove.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              if (tableParams.getSelectionCount() > 0) {
                detailListener.deleteParameter(tableParams, tableParams.getSelectionIndex());
                txtParamNote.setText("");
                txtName.setText("");
                txtValue.setText("");
                tableParams.deselectAll();
                butRemove.setEnabled(false);
                txtParamNote.setText("");
                isEditableParam = false;
                butApplyParam.setEnabled(isEditableParam);
                butApply.setEnabled(isEditable);
                txtName.setFocus();
                if (gui != null) gui.updateParam();
              }
            }
          });
      final GridData gridData_8 = new GridData(GridData.FILL, GridData.BEGINNING, false, true);
      gridData_8.widthHint = 64;
      gridData_8.minimumWidth = 50;
      butRemove.setLayoutData(gridData_8);
      //			butRemove.setText("Remove");

      final Button butTemp =
          JOE_B_DetailForm_TempDocumentation.Control(new Button(parameterGroup, SWT.NONE));
      butTemp.setLayoutData(new GridData());
      //			butTemp.setText("Documentation");
      butTemp.setVisible(false);

      butApply = JOE_B_DetailForm_ApplyDetails.Control(new Button(parameterGroup, SWT.NONE));
      butApply.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      butApply.setEnabled(isEditable);
      FontData fontDatas[] = butApply.getFont().getFontData();
      FontData data = fontDatas[0];
      butApply.setFont(new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD));
      butApply.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              save();
            }
          });
      //			butApply.setText("Apply Details");

      cancelButton = JOE_B_DetailForm_Cancel.Control(new Button(parameterGroup, SWT.NONE));
      cancelButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      cancelButton.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              saveWindowPosAndSize();
              if (butApply.getEnabled()) {
                //						int count = MainWindow.message(getShell(),
                // sos.scheduler.editor.app.Messages.getLabel("detailform.close"), SWT.ICON_WARNING
                // | SWT.OK
                int count =
                    MainWindow.message(
                        getShell(), JOE_M_0008.label(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
                if (count != SWT.OK) {
                  return;
                }
              }
              getShell().dispose();
            }
          });
      //			cancelButton.setText("Cancel");

      txtParamNote =
          JOE_T_DetailForm_JobChainNote.Control(
              new Text(
                  parameterGroup, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL));
      txtParamNote.setEnabled(false);
      txtParamNote.addVerifyListener(
          new VerifyListener() {
            public void verifyText(final VerifyEvent e) {
              if (e.keyCode == 8 || e.keyCode == 127) {
                isEditableParam = true;
                butApplyParam.setEnabled(isEditableParam);
              }
            }
          });
      txtParamNote.addModifyListener(
          new ModifyListener() {
            public void modifyText(final ModifyEvent e) {
              changeParameNote();
            }
          });
      final GridData gridData_5 = new GridData(GridData.FILL, GridData.FILL, true, true, 5, 3);
      gridData_5.heightHint = 73;
      txtParamNote.setLayoutData(gridData_5);

      comboLanguage = JOE_Cbo_DetailForm_Language.Control(new Combo(parameterGroup, SWT.READ_ONLY));
      comboLanguage.setItems(new String[] {"de", "en"});
      final GridData gridData_7 = new GridData(GridData.FILL, GridData.BEGINNING, false, true);
      comboLanguage.setLayoutData(gridData_7);
      comboLanguage.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              txtJobchainNote.setText(detailListener.getNote(comboLanguage.getText()));
              if (tableParams.getSelectionCount() > 0) {
                TableItem item = tableParams.getSelection()[0];
                txtParamNote.setText(
                    detailListener.getParamNote(item.getText(0), comboLanguage.getText()));
              } else if (txtName.getText() != null && txtName.getText().length() > 0) {
                txtParamNote.setText(
                    detailListener.getParamNote(txtName.getText(), comboLanguage.getText()));
              } else if (txtParamNote.getText() != null && txtParamNote.getText().length() > 0) {
                txtParamNote.setText("");
              }
              isEditable = false;
              isEditableParam = false;
              // butApply.setEnabled(isEditable);
              butApplyParam.setEnabled(isEditableParam);
              butRemove.setEnabled(false);
            }
          });
      comboLanguage.select(0);

      butRefreshWizzardNoteParam =
          JOE_B_DetailForm_RefreshWizardNoteParam.Control(new Text(parameterGroup, SWT.CHECK));
      butRefreshWizzardNoteParam.addModifyListener(
          new ModifyListener() {
            public void modifyText(final ModifyEvent e) {
              refreshTable();
            }
          });
      butRefreshWizzardNoteParam.setVisible(false);
      butRefreshWizzardNoteParam.setLayoutData(new GridData());

      paramText = JOE_T_DetailForm_Param.Control(new Text(parameterGroup, SWT.BORDER));
      paramText.setVisible(false);
      final GridData gridData_14 = new GridData(GridData.CENTER, GridData.BEGINNING, false, false);
      gridData_14.widthHint = 27;
      paramText.setLayoutData(gridData_14);

      jobChainGroup = JOE_G_DetailForm_NoteGroup.Control(new Group(parameterGroup, SWT.NONE));
      jobChainGroup.setEnabled(false);
      //			jobChainGroup.setText("Note");
      final GridLayout gridLayout_1 = new GridLayout();
      gridLayout_1.numColumns = 2;
      jobChainGroup.setLayout(gridLayout_1);
      final GridData gridData = new GridData(GridData.FILL, GridData.FILL, false, false, 6, 1);
      gridData.horizontalIndent = -1;
      jobChainGroup.setLayoutData(gridData);

      txtJobchainNote =
          JOE_T_DetailForm_JobChainNote.Control(
              new Text(
                  jobChainGroup, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL));
      txtJobchainNote.addModifyListener(
          new ModifyListener() {
            public void modifyText(final ModifyEvent e) {
              if (detailListener != null) {
                isEditable = true;
                if (gui != null) gui.updateNote();
                detailListener.setNote(txtJobchainNote.getText(), comboLanguage.getText());
                butApply.setEnabled(isEditable);
              }
            }
          });
      final GridData gridData_2 = new GridData(GridData.FILL, GridData.FILL, true, false, 1, 2);
      txtJobchainNote.setLayoutData(gridData_2);

      butXML = JOE_B_DetailForm_XML.Control(new Button(jobChainGroup, SWT.NONE));
      butXML.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      butXML.setEnabled(false);
      butXML.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              try {
                if (dom != null && dom.isChanged()) {
                  //							MainWindow.message("Please save jobchain configuration file before
                  // opening XML Editor.", SWT.ICON_ERROR);
                  MainWindow.message(JOE_M_0020.label(), SWT.ICON_ERROR);
                  return;
                }
                if (dom == null && butApply.isEnabled()) {
                  // ungespeichert
                  //							int c = MainWindow.message("Should the current values be saved?", SWT.YES
                  // | SWT.NO | SWT.ICON_ERROR);
                  int c = MainWindow.message(JOE_M_0021.label(), SWT.YES | SWT.NO | SWT.ICON_ERROR);
                  if (c == SWT.YES) detailListener.save();
                }
                if (type == Editor.JOB_CHAINS) {
                  DetailXMLEditorDialogForm dialog =
                      new DetailXMLEditorDialogForm(
                          detailListener.getConfigurationFilename(),
                          jobChainname,
                          state,
                          _orderId,
                          type,
                          isLifeElement,
                          path);
                  dialog.showXMLEditor();
                  getShell().dispose();
                } else {
                  if (dom != null && dom.getFilename() != null && dom.getFilename().length() > 0) {
                    DetailXMLEditorDialogForm dialog =
                        new DetailXMLEditorDialogForm(dom, type, isLifeElement, path);
                    dialog.setConfigurationData(confListener, tree, parent);
                    dialog.showXMLEditor();
                  } else {
                    //								MainWindow.message("Please save jobchain configuration file before
                    // opening XML Editor.", SWT.ICON_ERROR);
                    MainWindow.message(JOE_M_0020.label(), SWT.ICON_ERROR);
                  }
                }
              } catch (Exception ex) {
                try {
                  //							System.out.println("..error in " + sos.util.SOSClassUtil.getMethodName()
                  // + ": " + ex.getMessage());
                  System.out.println(
                      JOE_M_0010.params(sos.util.SOSClassUtil.getMethodName(), ex.getMessage()));
                  new ErrorLog(JOE_M_0002.params(sos.util.SOSClassUtil.getMethodName()), ex);
                } catch (Exception ee) {
                  // tu nichts
                }
              }
            }
          });
      //			butXML.setText("Open XML");

      butDocumentation =
          JOE_B_DetailForm_Documentation.Control(new Button(jobChainGroup, SWT.NONE));
      butDocumentation.setLayoutData(
          new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
      butDocumentation.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(final SelectionEvent e) {
              String filename = null;
              try {
                if (type == Editor.JOB_CHAINS) {
                  filename = detailListener.getConfigurationFilename();
                } else {
                  if (dom != null) {
                    filename = dom.getFilename();
                  }
                }
                if (filename != null && filename.length() > 0) {
                  File file = new File(filename);
                  if (file.exists()) {
                    // Runtime.getRuntime().exec("cmd /C START iExplore ".concat(filename));
                    Program prog = Program.findProgram("html");
                    if (prog != null) {
                      prog.execute(new File(filename).toURL().toString());
                    } else {
                      String[] split =
                          Options.getBrowserExec(
                              new File(filename).toURL().toString(), Options.getLanguage());
                      Runtime.getRuntime().exec(split);
                    }
                  } else
                    MainWindow.message(JOE_M_0013.params(file.getCanonicalPath()), SWT.ICON_ERROR);
                  //								MainWindow.message("Missing documentation " + file.getCanonicalPath(),
                  // SWT.ICON_ERROR);
                } else MainWindow.message(JOE_M_0012.label(), SWT.ICON_ERROR);
                //							MainWindow.message("Please save jobchain configuration before opening
                // documentation.", SWT.ICON_ERROR);
              } catch (Exception ex) {
                try {
                  //							System.out.println("..could not open file " + filename + " " +
                  // ex.getMessage());
                  System.out.println(
                      JOE_M_0011.params(
                          sos.util.SOSClassUtil.getMethodName(), filename, ex.getMessage()));
                  new ErrorLog(
                      JOE_M_0011.params(
                          sos.util.SOSClassUtil.getMethodName(), filename, ex.getMessage()));
                } catch (Exception ee) {
                  // tu nichts
                }
              }
            }
          });
      //			butDocumentation.setText("Documentation");

      final Label fileLabel =
          JOE_L_DetailForm_JobDocumentation.Control(new Label(parameterGroup, SWT.NONE));
      fileLabel.setLayoutData(new GridData());
      //			fileLabel.setText("Job Documentation: ");

      txtParamsFile = JOE_T_DetailForm_ParamsFile.Control(new Text(parameterGroup, SWT.BORDER));
      //			txtParamsFile.addFocusListener(new FocusAdapter() {
      //				public void focusGained(final FocusEvent e) {
      //					txtParamsFile.selectAll();
      //				}
      //			});
      txtParamsFile.addModifyListener(
          new ModifyListener() {
            public void modifyText(final ModifyEvent e) {
              detailListener.setParamsFileName(txtParamsFile.getText());
              if (gui != null) gui.updateNote();
              butApply.setEnabled(isEditable);
            }
          });
      txtParamsFile.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 4, 1));

      statusBar = JOE_L_DetailForm_ConfigFile.Control(new Label(composite, SWT.BORDER));
      final GridData gridData_11 = new GridData(GridData.FILL, GridData.END, false, false);
      gridData_11.widthHint = 496;
      gridData_11.heightHint = 18;
      statusBar.setLayoutData(gridData_11);
      //			statusBar.setText("Configurations File:");
      setToolTipText();
      if (type == Editor.JOB_CHAINS) setEnabled_(false);
      setVisibility();
    } catch (Exception e) {
      try {
        //				new ErrorLog("error in " + sos.util.SOSClassUtil.getMethodName() + "cause: " +
        // e.toString(), e);
        new ErrorLog(JOE_M_0010.params(sos.util.SOSClassUtil.getMethodName(), e.toString()), e);
      } catch (Exception ee) {
        // tu nichts
      }
    }
  }
  @Override
  protected Control createContents(final Composite parent) {
    final Composite panel = new Composite(parent, SWT.NONE);
    panel.setLayout(new GridLayout(2, false));
    final Label titleLabel = new Label(panel, SWT.NONE);
    titleLabel.setAlignment(SWT.RIGHT);
    {
      final GridData gridData = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
      gridData.widthHint = 60;
      titleLabel.setLayoutData(gridData);
    }
    titleLabel.setText("Title:");
    this.ftitle = new Text(panel, SWT.BORDER);
    ftitle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    lblDescription = new Label(panel, SWT.NONE);
    lblDescription.setAlignment(SWT.RIGHT);
    lblDescription.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
    lblDescription.setText("Description:");

    this.fbody = new Text(panel, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.WRAP);
    {
      final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
      gridData.heightHint = 150;
      fbody.setLayoutData(gridData);
    }
    this.fbody.setText("(enter error description here, paste any relevant code too)");
    final Label contactoptionalLabel = new Label(panel, SWT.NONE);
    contactoptionalLabel.setAlignment(SWT.RIGHT);
    contactoptionalLabel.setText("Contact (email):");
    this.fcontact = new Text(panel, SWT.BORDER);
    fcontact.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    fcontact.setText(System.getProperty("user.name"));
    attachTechnicalDataButton = new Button(panel, SWT.CHECK);
    attachTechnicalDataButton.setLayoutData(
        new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
    attachTechnicalDataButton.setSelection(true);
    attachTechnicalDataButton.setText("   Attach technical data (eclipse and erlide logs)   ");
    sendButton = new Button(panel, SWT.NONE);
    {
      GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1);
      gridData.widthHint = 243;
      sendButton.setLayoutData(gridData);
    }
    sendButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent e) {
            postReport();
          }
        });
    sendButton.setText("Create report");
    responseLabel = new Label(panel, SWT.CENTER);
    responseLabel.setVisible(false);
    responseLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
    responseLabel.setText(
        "The report was saved in the location below, you can now close this window.");
    locationLabel = new Text(panel, SWT.CENTER | SWT.WRAP | SWT.READ_ONLY);
    locationLabel.setVisible(false);
    locationLabel.setForeground(SWTResourceManager.getColor(SWT.COLOR_DARK_BLUE));
    locationLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
    locationLabel.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    locationLabel.setText("location");
    responseLabel_1 = new Label(panel, SWT.CENTER);
    responseLabel_1.setVisible(false);
    responseLabel_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
    responseLabel_1.setText("Please attach the report if you are writing a trouble ticket.");

    noDefaultAndApplyButton();

    return panel;
  }
Example #18
0
  private void createLeftPanel() {
    Label lblType = new Label(shell, SWT.NONE);
    lblType.setBounds(155, 10, 33, 16);
    lblType.setText("Type");

    Label lblZipcode = new Label(shell, SWT.NONE);
    lblZipcode.setBounds(155, 40, 59, 16);
    lblZipcode.setText("Zipcode");

    Label lblSqft = new Label(shell, SWT.NONE);
    lblSqft.setBounds(155, 70, 31, 16);
    lblSqft.setText("SqFt");

    Label lblBr = new Label(shell, SWT.NONE);
    lblBr.setText("Number of \nBedrooms");
    lblBr.setBounds(155, 100, 65, 30);

    Label lblPrice = new Label(shell, SWT.NONE);
    lblPrice.setBounds(155, 145, 59, 16);
    lblPrice.setText("List Price");

    Label lblFace = new Label(shell, SWT.NONE);
    lblFace.setBounds(155, 175, 59, 16);
    lblFace.setText("Face");

    Label lblYearBuilt = new Label(shell, SWT.NONE);
    lblYearBuilt.setBounds(155, 205, 59, 16);
    lblYearBuilt.setText("Year Built");

    textZip = new Text(shell, SWT.BORDER);
    textZip.setBounds(245, 40, 64, 19);

    textSqftLow = new Text(shell, SWT.BORDER);
    textSqftLow.setBounds(245, 70, 64, 19);

    Label lblTo = new Label(shell, SWT.NONE);
    lblTo.setBounds(318, 70, 15, 14);
    lblTo.setText("to");

    textSqftHigh = new Text(shell, SWT.BORDER);
    textSqftHigh.setBounds(339, 70, 64, 19);

    comboBr = new Combo(shell, SWT.NONE);
    comboBr.setItems(new String[] {"Any", "1", "2", "3", "4", "5", "6", "7"});
    comboBr.setBounds(245, 100, 65, 25);
    comboBr.select(0);

    textPriceLow = new Text(shell, SWT.BORDER);
    textPriceLow.setBounds(245, 145, 64, 19);

    Label lblTo_1 = new Label(shell, SWT.NONE);
    lblTo_1.setBounds(318, 145, 15, 14);
    lblTo_1.setText("to");

    textPriceHigh = new Text(shell, SWT.BORDER);
    textPriceHigh.setBounds(339, 145, 64, 19);

    comboFace = new Combo(shell, SWT.NONE);
    comboFace.setItems(new String[] {"Any", "N", "NE", "E", "SE", "S", "SW", "W", "NW"});
    comboFace.setBounds(245, 175, 65, 25);
    comboFace.select(0);

    comboYbLow = new Combo(shell, SWT.NONE);
    comboYbLow.setItems(
        new String[] {
          "Any", "1950", "1951", "1952", "1953", "1954", "1955", "1956", "1957", "1958", "1959",
          "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970",
          "1971", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", "1981",
          "1982", "1983", "1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991", "1992",
          "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003",
          "2004", "2005", "2006", "2007", "2008", "2009", "2010"
        });
    comboYbLow.setBounds(245, 205, 65, 25);
    comboYbLow.select(0);

    Label lblTo_2 = new Label(shell, SWT.NONE);
    lblTo_2.setBounds(318, 205, 15, 14);
    lblTo_2.setText("to");

    comboYbHigh = new Combo(shell, SWT.NONE);
    comboYbHigh.setItems(
        new String[] {
          "Any", "1950", "1951", "1952", "1953", "1954", "1955", "1956", "1957", "1958", "1959",
          "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970",
          "1971", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", "1981",
          "1982", "1983", "1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991", "1992",
          "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003",
          "2004", "2005", "2006", "2007", "2008", "2009", "2010"
        });
    comboYbHigh.setBounds(339, 205, 65, 25);
    comboYbHigh.select(0);

    comboType = new Combo(shell, SWT.NONE);
    comboType.setItems(new String[] {"SFR", "CONDO"});
    comboType.setBounds(245, 10, 65, 25);
    comboType.select(0);

    Button btnSearch = new Button(shell, SWT.NONE);
    btnSearch.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseDown(MouseEvent e) {
            try {
              searchClickEvent(0);
            } catch (Exception e1) {
              e1.printStackTrace();
            }
          }
        });
    btnSearch.setBounds(96, 238, 94, 28);
    btnSearch.setText("Search");

    text1MAvg = new Text(shell, SWT.BORDER);
    text1MAvg.setEditable(false);
    text1MAvg.setBounds(173, 303, 64, 19);

    Label lblPriceEstimation = new Label(shell, SWT.NONE);
    lblPriceEstimation.setBounds(10, 283, 102, 14);
    lblPriceEstimation.setText("Price Estimates");

    Label lblEstimationMethod = new Label(shell, SWT.NONE);
    lblEstimationMethod.setBounds(435, 10, 120, 14);
    lblEstimationMethod.setText("Final Estimates\n");

    Label lblEstMethod = new Label(shell, SWT.NONE);
    lblEstMethod.setBounds(173, 318, 59, 14);

    Label lblNewLabel = new Label(shell, SWT.NONE);
    lblNewLabel.setFont(SWTResourceManager.getFont("Verdana", 15, SWT.ITALIC));
    lblNewLabel.setBounds(10, 92, 120, 65);
    lblNewLabel.setText("Altura\nConsulting");

    Label lblm1MAvg = new Label(shell, SWT.CENTER);
    lblm1MAvg.setBounds(173, 283, 59, 14);
    lblm1MAvg.setText("1 Month");

    text6MAvg = new Text(shell, SWT.BORDER);
    text6MAvg.setEditable(false);
    text6MAvg.setBounds(253, 303, 64, 19);

    Label lblm6MAvg = new Label(shell, SWT.CENTER);
    lblm6MAvg.setText("6 Months");
    lblm6MAvg.setBounds(253, 283, 59, 14);

    text1YAvg = new Text(shell, SWT.BORDER);
    text1YAvg.setEditable(false);
    text1YAvg.setBounds(335, 303, 64, 19);

    Label lbly1YAvg = new Label(shell, SWT.CENTER);
    lbly1YAvg.setText("1 Year");
    lbly1YAvg.setBounds(335, 283, 59, 14);

    Label lblAverage = new Label(shell, SWT.NONE);
    lblAverage.setAlignment(SWT.RIGHT);
    lblAverage.setBounds(58, 306, 71, 19);
    lblAverage.setText("Average");

    Label lblStd = new Label(shell, SWT.NONE);
    lblStd.setAlignment(SWT.RIGHT);
    lblStd.setBounds(58, 331, 71, 14);
    lblStd.setText("Std");

    text1MStd = new Text(shell, SWT.BORDER);
    text1MStd.setEditable(false);
    text1MStd.setBounds(173, 328, 64, 19);

    text6MStd = new Text(shell, SWT.BORDER);
    text6MStd.setEditable(false);
    text6MStd.setBounds(253, 328, 64, 19);

    text1YStd = new Text(shell, SWT.BORDER);
    text1YStd.setEditable(false);
    text1YStd.setBounds(335, 328, 64, 19);

    Label lblNewLabel_1 = new Label(shell, SWT.NONE);
    lblNewLabel_1.setBounds(10, 393, 72, 19);
    lblNewLabel_1.setText("Regression");

    Label label = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setBounds(10, 385, 415, 2);

    Label label_1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    label_1.setBounds(10, 272, 415, 2);

    Label label_2 = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL);
    label_2.setBounds(151, 283, 2, 285);

    text1MRegA = new Text(shell, SWT.BORDER);
    text1MRegA.setEditable(false);
    text1MRegA.setBounds(173, 421, 64, 19);

    text6MRegA = new Text(shell, SWT.BORDER);
    text6MRegA.setEditable(false);
    text6MRegA.setBounds(253, 421, 64, 19);

    text1YRegA = new Text(shell, SWT.BORDER);
    text1YRegA.setEditable(false);
    text1YRegA.setBounds(335, 421, 64, 19);

    Label lblyabx = new Label(shell, SWT.NONE);
    lblyabx.setBounds(10, 421, 59, 14);
    lblyabx.setText("(Y=a+bX)");

    Label lblA = new Label(shell, SWT.NONE);
    lblA.setAlignment(SWT.RIGHT);
    lblA.setBounds(105, 424, 24, 14);
    lblA.setText("a");

    Label lblB = new Label(shell, SWT.NONE);
    lblB.setAlignment(SWT.RIGHT);
    lblB.setBounds(96, 449, 33, 14);
    lblB.setText("b");

    Label lblR = new Label(shell, SWT.NONE);
    lblR.setAlignment(SWT.RIGHT);
    lblR.setBounds(96, 488, 33, 14);
    lblR.setText("R2");
    lblR.setVisible(false);

    text1MRegB = new Text(shell, SWT.BORDER);
    text1MRegB.setEditable(false);
    text1MRegB.setBounds(173, 446, 64, 19);

    text6MRegB = new Text(shell, SWT.BORDER);
    text6MRegB.setEditable(false);
    text6MRegB.setBounds(253, 446, 64, 19);

    text1YRegB = new Text(shell, SWT.BORDER);
    text1YRegB.setEditable(false);
    text1YRegB.setBounds(335, 446, 64, 19);

    text1MRegR = new Text(shell, SWT.BORDER);
    text1MRegR.setEditable(false);
    text1MRegR.setBounds(173, 485, 64, 19);
    text1MRegR.setVisible(false);

    text6MRegR = new Text(shell, SWT.BORDER);
    text6MRegR.setEditable(false);
    text6MRegR.setBounds(253, 485, 64, 19);
    text6MRegR.setVisible(false);

    text1YRegR = new Text(shell, SWT.BORDER);
    text1YRegR.setEditable(false);
    text1YRegR.setBounds(335, 485, 64, 19);
    text1YRegR.setVisible(false);

    Label lblNumberOfDeals = new Label(shell, SWT.NONE);
    lblNumberOfDeals.setAlignment(SWT.RIGHT);
    lblNumberOfDeals.setBounds(30, 355, 99, 17);
    lblNumberOfDeals.setText("Number of deals");

    text1MCounter = new Text(shell, SWT.BORDER);
    text1MCounter.setEditable(false);
    text1MCounter.setBounds(173, 355, 64, 19);

    text6MCounter = new Text(shell, SWT.BORDER);
    text6MCounter.setEditable(false);
    text6MCounter.setBounds(253, 355, 64, 19);

    text1YCounter = new Text(shell, SWT.BORDER);
    text1YCounter.setEditable(false);
    text1YCounter.setBounds(335, 355, 64, 19);

    Label label_3 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    label_3.setBounds(10, 512, 415, 2);

    Label lblExtropolation = new Label(shell, SWT.NONE);
    lblExtropolation.setBounds(10, 518, 85, 17);
    lblExtropolation.setText("Extrapolation");

    Label lblNewPrice = new Label(shell, SWT.NONE);
    lblNewPrice.setAlignment(SWT.RIGHT);
    lblNewPrice.setBounds(68, 541, 61, 17);
    lblNewPrice.setText("New Price");

    text1MExtpoPrice = new Text(shell, SWT.BORDER);
    text1MExtpoPrice.setEditable(false);
    text1MExtpoPrice.setBounds(173, 541, 64, 19);

    text6MExtpoPrice = new Text(shell, SWT.BORDER);
    text6MExtpoPrice.setEditable(false);
    text6MExtpoPrice.setBounds(253, 541, 64, 19);

    text1YExtpoPrice = new Text(shell, SWT.BORDER);
    text1YExtpoPrice.setEditable(false);
    text1YExtpoPrice.setBounds(335, 541, 64, 19);

    textRegPrice1M = new Text(shell, SWT.BORDER);
    textRegPrice1M.setEditable(false);
    textRegPrice1M.setBounds(173, 393, 64, 19);

    textRegPrice6M = new Text(shell, SWT.BORDER);
    textRegPrice6M.setEditable(false);
    textRegPrice6M.setBounds(253, 393, 64, 19);

    textRegPrice1Y = new Text(shell, SWT.BORDER);
    textRegPrice1Y.setEditable(false);
    textRegPrice1Y.setBounds(335, 393, 64, 19);

    Label lblPrice_1 = new Label(shell, SWT.NONE);
    lblPrice_1.setAlignment(SWT.RIGHT);
    lblPrice_1.setBounds(68, 393, 61, 17);
    lblPrice_1.setText("Price");

    comboBchmkIndex = new Combo(shell, SWT.NONE);
    comboBchmkIndex.setItems(new String[] {"Case Shiller", "Zillow"});
    comboBchmkIndex.setBounds(10, 460, 90, 22);
    comboBchmkIndex.select(0);

    Label lblBchmkIndex = new Label(shell, SWT.NONE);
    lblBchmkIndex.setBounds(10, 440, 96, 28);
    lblBchmkIndex.setText("Benchmark Index\n");

    Button btnRedo = new Button(shell, SWT.NONE);
    btnRedo.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseDown(MouseEvent e) {
            try {
              searchClickEvent(1);
            } catch (Exception e2) {
              e2.printStackTrace();
            }
          }
        });
    btnRedo.setBounds(23, 481, 59, 28);
    btnRedo.setText("Redo");

    Label label_4 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    label_4.setBounds(10, 566, 415, 2);
  }
 private void setVisibleDelegateExpressionType(boolean visible) {
   delegateExpressionTypeButton.setSelection(visible);
   delegateExpressionText.setVisible(visible);
   delegateExpressionLabel.setVisible(visible);
 }
Example #20
0
 public void open() {
   display = Display.getCurrent();
   shell = new Shell(display);
   shell.setText("S-Leak"); // $NON-NLS-1$
   list = new List(shell, SWT.BORDER | SWT.V_SCROLL);
   list.addListener(
       SWT.Selection,
       new Listener() {
         @Override
         public void handleEvent(Event event) {
           refreshObject();
         }
       });
   text = new Text(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
   canvas = new Canvas(shell, SWT.BORDER);
   canvas.addListener(
       SWT.Paint,
       new Listener() {
         @Override
         public void handleEvent(Event event) {
           paintCanvas(event);
         }
       });
   check = new Button(shell, SWT.CHECK);
   check.setText("Stack"); // $NON-NLS-1$
   check.addListener(
       SWT.Selection,
       new Listener() {
         @Override
         public void handleEvent(Event e) {
           toggleStackTrace();
         }
       });
   start = new Button(shell, SWT.PUSH);
   start.setText("Snap"); // $NON-NLS-1$
   start.addListener(
       SWT.Selection,
       new Listener() {
         @Override
         public void handleEvent(Event event) {
           refreshAll();
         }
       });
   stop = new Button(shell, SWT.PUSH);
   stop.setText("Diff"); // $NON-NLS-1$
   stop.addListener(
       SWT.Selection,
       new Listener() {
         @Override
         public void handleEvent(Event event) {
           refreshDifference();
         }
       });
   label = new Label(shell, SWT.BORDER);
   label.setText("0 object(s)"); // $NON-NLS-1$
   shell.addListener(
       SWT.Resize,
       new Listener() {
         @Override
         public void handleEvent(Event e) {
           layout();
         }
       });
   check.setSelection(false);
   text.setVisible(false);
   Point size = shell.getSize();
   shell.setSize(size.x / 2, size.y / 2);
   shell.open();
 }
Example #21
0
  /** Initializes the GUI. */
  private void initGUI() {
    try {
      this.setSize(731, 385);
      this.setBackground(SWTResourceManager.getColor(219, 219, 219));
      FormLayout thisLayout = new FormLayout();
      this.setLayout(thisLayout);
      this.setOrientation(SWT.HORIZONTAL);
      this.setToolTipText("MKD- Image SteganoGraphy");
      {
        Enter = new Label(this, SWT.NONE);
        FormData EnterLData = new FormData();
        EnterLData.left = new FormAttachment(0, 1000, 266);
        EnterLData.top = new FormAttachment(0, 1000, 140);
        EnterLData.width = 43;
        EnterLData.height = 15;
        Enter.setLayoutData(EnterLData);
        Enter.setText("Enter");
        Enter.setVisible(false);
      }
      {
        GenPubPara = new Button(this, SWT.PUSH | SWT.CENTER);
        FormData GenPubParaLData = new FormData();
        GenPubParaLData.left = new FormAttachment(0, 1000, 174);
        GenPubParaLData.top = new FormAttachment(0, 1000, 142);
        GenPubParaLData.width = 132;
        GenPubParaLData.height = 25;
        GenPubPara.setLayoutData(GenPubParaLData);
        GenPubPara.setText("Generate Public Values");
        GenPubPara.setVisible(false);
        GenPubPara.addSelectionListener(
            new SelectionAdapter() {
              public void widgetSelected(SelectionEvent e) {
                Random prng = new SecureRandom();
                BigInteger q = BigInteger.probablePrime(32, prng);
                System.out.println("" + q);
                QValue.setText(q.toString());
                // code for generating alpha
                BigInteger alpha;
                primitiveRoot pr = new primitiveRoot();

                for (alpha = BigInteger.valueOf(2);
                    alpha.compareTo(q) > 0;
                    alpha = alpha.add(BigInteger.ONE)) {
                  if (pr.isPrimitive(q, alpha)) break;
                }
                System.out.println("" + alpha);
                AlphaValue.setText(alpha.toString());
              }
            });
      }
      {
        FormData PubKeyLData = new FormData();
        PubKeyLData.left = new FormAttachment(0, 1000, 326);
        PubKeyLData.top = new FormAttachment(0, 1000, 188);
        PubKeyLData.width = 121;
        PubKeyLData.height = 15;
        PubKey = new Text(this, SWT.NONE);
        PubKey.setLayoutData(PubKeyLData);
        PubKey.setVisible(false);
      }
      {
        PUBKey = new Label(this, SWT.NONE);
        FormData PUBKeyLData = new FormData();
        PUBKeyLData.left = new FormAttachment(0, 1000, 217);
        PUBKeyLData.top = new FormAttachment(0, 1000, 187);
        PUBKeyLData.width = 97;
        PUBKeyLData.height = 15;
        PUBKey.setLayoutData(PUBKeyLData);
        PUBKey.setText("Public Key is");
        PUBKey.setVisible(false);
      }
      {
        FormData PKeyLData = new FormData();
        PKeyLData.left = new FormAttachment(0, 1000, 326);
        PKeyLData.top = new FormAttachment(0, 1000, 166);
        PKeyLData.width = 121;
        PKeyLData.height = 15;
        PKey = new Text(this, SWT.NONE);
        PKey.setLayoutData(PKeyLData);
        PKey.setVisible(false);

        PKey.addModifyListener(
            new ModifyListener() {

              @Override
              public void modifyText(ModifyEvent arg0) {
                // TODO Auto-generated method stub
                BigInteger alpha = new BigInteger(AlphaValue.getText());
                BigInteger xa = new BigInteger(PKey.getText());
                BigInteger q = new BigInteger(QValue.getText());
                BigInteger ya = alpha.modPow(xa, q);
                System.out.println("Y a is " + ya);
                PubKey.setText(ya.toString());
                PubKey.setEditable(false);
              }
            });

        /*Adapter() {
        public void widgetSelected(SelectionEvent e){
        	BigInteger alpha=new BigInteger(AlphaValue.getText());
        	BigInteger xa=new BigInteger(PKey.getText());
        	BigInteger q=new BigInteger(QValue.getText());
        	BigInteger ya = alpha.modPow(xa, q);
        	System.out.println("Y a is "+ya);
        	PubKey.setText(ya.toString());
        	PubKey.setEditable(false);
        }});*/
      }
      {
        PKLabel = new Label(this, SWT.NONE);
        FormData PKLabelLData = new FormData();
        PKLabelLData.left = new FormAttachment(0, 1000, 217);
        PKLabelLData.top = new FormAttachment(0, 1000, 166);
        PKLabelLData.width = 97;
        PKLabelLData.height = 15;
        PKLabel.setLayoutData(PKLabelLData);
        PKLabel.setText("Enter Private Key");
        PKLabel.setVisible(false);
      }
      {
        FormData AlphaValueLData = new FormData();
        AlphaValueLData.left = new FormAttachment(0, 1000, 504);
        AlphaValueLData.top = new FormAttachment(0, 1000, 138);
        AlphaValueLData.width = 64;
        AlphaValueLData.height = 15;
        AlphaValue = new Text(this, SWT.NONE);
        AlphaValue.setLayoutData(AlphaValueLData);
        AlphaValue.setVisible(false);
      }
      {
        FormData QValueLData = new FormData();
        QValueLData.left = new FormAttachment(0, 1000, 340);
        QValueLData.top = new FormAttachment(0, 1000, 137);
        QValueLData.width = 107;
        QValueLData.height = 15;
        QValue = new Text(this, SWT.NONE);
        QValue.setLayoutData(QValueLData);
        QValue.setVisible(false);
      }
      {
        Alpha = new Label(this, SWT.NONE);
        FormData AlphaLData = new FormData();
        AlphaLData.left = new FormAttachment(0, 1000, 465);
        AlphaLData.top = new FormAttachment(0, 1000, 138);
        AlphaLData.width = 40;
        AlphaLData.height = 15;
        Alpha.setLayoutData(AlphaLData);
        Alpha.setText("Alpha");
        Alpha.setVisible(false);
      }
      {
        Q = new Label(this, SWT.NONE);
        FormData QLData = new FormData();
        QLData.left = new FormAttachment(0, 1000, 328);
        QLData.top = new FormAttachment(0, 1000, 138);
        QLData.width = 12;
        QLData.height = 15;
        Q.setLayoutData(QLData);
        Q.setText("Q");
        Q.setVisible(false);
      }

      {
        group1 = new Group(this, SWT.NONE);
        GridLayout group1Layout = new GridLayout();
        group1Layout.makeColumnsEqualWidth = true;
        group1.setLayout(group1Layout);
        FormData group1LData = new FormData();
        group1LData.left = new FormAttachment(0, 1000, 149);
        group1LData.top = new FormAttachment(0, 1000, 127);
        group1LData.width = 429;
        group1LData.height = 64;
        group1.setLayoutData(group1LData);
        group1.setText("Diffie-Hellman Key Exchange");
        group1.setVisible(false);
      }
      {
        button1 = new Button(this, SWT.PUSH | SWT.CENTER);
        FormData button1LData = new FormData();
        button1LData.width = 100;
        button1LData.height = 32;
        button1LData.right = new FormAttachment(568, 1000, 0);
        button1LData.bottom = new FormAttachment(650, 1000, 0);
        button1LData.top = new FormAttachment(567, 1000, 0);
        button1LData.left = new FormAttachment(431, 1000, 0);
        button1.setLayoutData(button1LData);
        button1.setText("Proceed");
        // button1.setBackground(SWTResourceManager.getColor(128, 0, 255));
        button1.addSelectionListener(
            new SelectionAdapter() {
              public void widgetSelected(SelectionEvent e) {
                String s = new String(Option.getText());
                String s1 = new String("Encrypt the Data into an Image");
                String s2 = new String("Decrypt the Message from an Image");
                if (s.equals(s1)) {
                  xa = PKey.getText();
                  q = QValue.getText();
                  Display display = Display.getDefault();
                  Shell shell = new Shell(display);
                  EncryptWindow inst = new EncryptWindow(shell, SWT.NULL);
                  Point size = inst.getSize();
                  // shell.setLayout(new FillLayout());
                  shell.layout();
                  new Label(shell, SWT.NONE).setText("Operation:");
                  final Label returnVal = new Label(shell, SWT.NONE);
                  // returnVal.setLayoutData(new FillLayout(SWT.NULL));
                  returnVal.setText("");

                  returnVal.setText(Option.getText());
                  if (size.x == 0 && size.y == 0) {
                    inst.pack();
                    shell.pack();
                  } else {
                    Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
                    shell.setSize(shellBounds.width, shellBounds.height);
                  }
                  shell.open();

                  while (!shell.isDisposed()) {
                    if (!display.readAndDispatch()) display.sleep();
                  }
                } else if (s.equals(s2)) {
                  xa = PKey.getText();
                  q = QValue.getText();
                  Display display = Display.getDefault();
                  Shell shell = new Shell(display);
                  DecryptWindow inst = new DecryptWindow(shell, SWT.NULL);
                  Point size = inst.getSize();
                  // shell.setLayout(new FillLayout());
                  shell.layout();
                  new Label(shell, SWT.NONE).setText("Operation:");
                  final Label returnVal = new Label(shell, SWT.NONE);
                  // returnVal.setLayoutData(new FillLayout(SWT.NULL));
                  returnVal.setText("");

                  returnVal.setText(Option.getText());
                  if (size.x == 0 && size.y == 0) {
                    inst.pack();
                    shell.pack();
                  } else {
                    Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
                    shell.setSize(shellBounds.width, shellBounds.height);
                  }
                  shell.open();

                  while (!shell.isDisposed()) {
                    if (!display.readAndDispatch()) display.sleep();
                  }
                }
              }
            });
      }

      {
        Label2 = new Label(this, SWT.NONE);
        FormData Label2LData = new FormData();
        Label2LData.width = 443;
        Label2LData.height = 49;
        Label2LData.bottom = new FormAttachment(144, 1000, 0);
        Label2LData.right = new FormAttachment(811, 1000, 0);
        Label2LData.top = new FormAttachment(16, 1000, 0);
        Label2LData.left = new FormAttachment(205, 1000, 0);
        Label2.setLayoutData(Label2LData);
        Label2.setText("V's Image Steganography ");
        Label2.setFont(SWTResourceManager.getFont("Lucida Handwriting", 22, 1, false, false));
        Label2.setAlignment(SWT.CENTER);
        Label2.setBackground(SWTResourceManager.getColor(219, 219, 219));
      }
      {
        Label1 = new Label(this, SWT.NONE);
        FormData Label1LData = new FormData();
        Label1LData.width = 234;
        Label1LData.height = 22;
        Label1LData.left = new FormAttachment(204, 1000, 0);
        Label1LData.right = new FormAttachment(524, 1000, 0);
        Label1LData.bottom = new FormAttachment(232, 1000, 0);
        Label1LData.top = new FormAttachment(175, 1000, 0);
        Label1.setLayoutData(Label1LData);
        Label1.setText("What you want to do...?");
        Label1.setBackground(SWTResourceManager.getColor(219, 219, 219));
      }
      {
        Option = new Combo(this, SWT.NONE);
        FormLayout OptionLayout = new FormLayout();
        Option.setLayout(OptionLayout);
        FormData OptionLData = new FormData();
        OptionLData.left = new FormAttachment(204, 1000, 0);
        OptionLData.top = new FormAttachment(232, 1000, 0);
        OptionLData.width = 408;
        OptionLData.height = 19;
        OptionLData.right = new FormAttachment(799, 1000, 0);
        OptionLData.bottom = new FormAttachment(287, 1000, 0);
        Option.setLayoutData(OptionLData);
        Option.setText("Select Option");
        Option.setBackground(SWTResourceManager.getColor(192, 192, 192));
        Option.setToolTipText("\r\n");
        Option.addSelectionListener(
            new SelectionAdapter() {
              public void widgetSelected(SelectionEvent e) {
                if (Option.getText().equals("Encrypt the Data into an Image")) {
                  xa = PKey.getText();
                  q = QValue.getText();
                  group1.setVisible(true);
                  PubKey.setVisible(true);
                  PUBKey.setVisible(true);
                  PKey.setVisible(true);
                  PKLabel.setVisible(true);
                  AlphaValue.setVisible(true);
                  QValue.setVisible(true);
                  Alpha.setVisible(true);
                  Q.setVisible(true);
                  GenPubPara.setVisible(true);
                  Enter.setVisible(false);
                }
                if (Option.getText().equals("Decrypt the Message from an Image")) {
                  /*PubKey.setText("");
                  PKey.setText("null");
                  QValue.setText("null");
                  AlphaValue.setText("0");*/
                  group1.setVisible(true);
                  PubKey.setVisible(true);
                  PUBKey.setVisible(true);
                  PKey.setVisible(true);
                  PKLabel.setVisible(true);
                  AlphaValue.setVisible(true);
                  QValue.setVisible(true);
                  Alpha.setVisible(true);
                  Q.setVisible(true);
                  Enter.setVisible(true);
                  GenPubPara.setVisible(false);
                }
              } // Encrypt e=new Encrypt();
            });
        Option.add("Encrypt the Data into an Image");
        Option.add("Decrypt the Message from an Image");
      }
      {
        label1 = new Label(this, SWT.NONE);
        FormData label1LData = new FormData();
        label1LData.left = new FormAttachment(0, 1000, 149);
        label1LData.top = new FormAttachment(0, 1000, 285);
        label1LData.width = 429;
        label1LData.height = 35;
        label1.setLayoutData(label1LData);
        label1.setText(
            "                             Copyright 2012., All Rights Reserved.,\r\n                              Vinaykumar M Kolli & Vaishakh B N  ");
        label1.setBackground(SWTResourceManager.getColor(192, 192, 192));
      }
      {
        menu1 = new Menu(getShell(), SWT.BAR);
        getShell().setMenuBar(menu1);
        /*{
        	fileMenuItem = new MenuItem(menu1, SWT.CASCADE);
        	fileMenuItem.setText("File");
        	{
        		fileMenu = new Menu(fileMenuItem);
        		{
        			openFileMenuItem = new MenuItem(fileMenu, SWT.CASCADE);
        			openFileMenuItem.setText("Open");
        		}
        		{
        			newFileMenuItem = new MenuItem(fileMenu, SWT.CASCADE);
        			newFileMenuItem.setText("New");
        		}
        		{
        			saveFileMenuItem = new MenuItem(fileMenu, SWT.CASCADE);
        			saveFileMenuItem.setText("Save");
        		}
        		{
        			closeFileMenuItem = new MenuItem(fileMenu, SWT.CASCADE);
        			closeFileMenuItem.setText("Close");
        		}
        		{
        			exitMenuItem = new MenuItem(fileMenu, SWT.CASCADE);
        			exitMenuItem.setText("Exit");
        		}
        		fileMenuItem.setMenu(fileMenu);
        	}
        }*/
        {
          helpMenuItem = new MenuItem(menu1, SWT.CASCADE);
          helpMenuItem.setText("Help");
          {
            helpMenu = new Menu(helpMenuItem);
            {
              contentsMenuItem = new MenuItem(helpMenu, SWT.CASCADE);
              contentsMenuItem.setText("Help Contents");
              contentsMenuItem.addSelectionListener(new SelectionAdapter() {});
            }
            {
              aboutMenuItem = new MenuItem(helpMenu, SWT.CASCADE);
              aboutMenuItem.setText("About");
              aboutMenuItem.addSelectionListener(
                  new SelectionAdapter() {
                    public void widgetSelected(SelectionEvent e) {
                      Display display = Display.getDefault();
                      Shell shell = new Shell(display);
                      HelpPage help = new HelpPage(shell, SWT.NULL);
                      Point size = help.getSize();
                      // shell.setLayout(new FillLayout());
                      shell.layout();
                      // new Label(shell, SWT.NONE).setText("Operation:");
                      // final Label returnVal = new Label(shell, SWT.NONE);
                      // returnVal.setLayoutData(new FillLayout(SWT.NULL));
                      // returnVal.setText("");

                      // returnVal.setText(Option.getText());
                      if (size.x == 0 && size.y == 0) {
                        help.pack();
                        shell.pack();
                      } else {
                        Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
                        shell.setSize(shellBounds.width, shellBounds.height);
                      }
                      shell.open();

                      while (!shell.isDisposed()) {
                        if (!display.readAndDispatch()) display.sleep();
                      }
                    }
                  });
            }
            helpMenuItem.setMenu(helpMenu);
          }
        }
      }
      this.layout();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 private void setVisibleClassType(boolean visible) {
   classTypeButton.setSelection(visible);
   classNameText.setVisible(visible);
   classSelectButton.setVisible(visible);
   classSelectLabel.setVisible(visible);
 }