コード例 #1
0
  protected void buttonsSectionLayout(
      Class<?> PKG,
      String prefix,
      final String docTitle,
      final String docUrl,
      final String docHeader) {

    // Bottom buttons and separator

    Button alwaysShowOption = new Button(shell, SWT.CHECK);
    props.setLook(alwaysShowOption);
    fd_tabFolder.bottom = new FormAttachment(100, -106);
    alwaysShowOption.setSelection(abstractMeta.isAlwaysShowRunOptions());

    alwaysShowOption.setToolTipText(BaseMessages.getString(PKG, prefix + ".alwaysShowOption"));

    alwaysShowOption.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            Button btn = (Button) e.getSource();
            alwaysShowRunOptions = btn.getSelection();
          }
        });

    FormData fd_alwaysShowOption = new FormData();
    fd_alwaysShowOption.left = new FormAttachment(0, 15);
    fd_alwaysShowOption.top = new FormAttachment(tabFolder, 15);
    alwaysShowOption.setLayoutData(fd_alwaysShowOption);
    alwaysShowOption.setText(BaseMessages.getString(PKG, prefix + ".AlwaysOption.Value"));

    wCancel = new Button(shell, SWT.PUSH);
    FormData fd_wCancel = new FormData();
    wCancel.setLayoutData(fd_wCancel);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    wCancel.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            cancel();
          }
        });

    wOK = new Button(shell, SWT.PUSH);
    FormData fd_wOK = new FormData();
    fd_wOK.top = new FormAttachment(wCancel, 0, SWT.TOP);
    fd_wOK.right = new FormAttachment(wCancel, -5);
    wOK.setLayoutData(fd_wOK);
    wOK.setText(BaseMessages.getString(PKG, prefix + ".Button.Launch"));
    wOK.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            ok();
          }
        });

    Button btnHelp = new Button(shell, SWT.NONE);
    btnHelp.setImage(GUIResource.getInstance().getImageHelpWeb());
    btnHelp.setText(BaseMessages.getString(PKG, "System.Button.Help"));
    btnHelp.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.Help"));
    FormData fd_btnHelp = new FormData();
    fd_btnHelp.left = new FormAttachment(0, 15);
    btnHelp.setLayoutData(fd_btnHelp);
    btnHelp.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent evt) {
            HelpUtils.openHelpDialog(parent.getShell(), docTitle, docUrl, docHeader);
          }
        });

    Label separator = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    fd_wCancel.top = new FormAttachment(separator, 15);
    fd_btnHelp.top = new FormAttachment(separator, 15);
    fd_wCancel.right = new FormAttachment(separator, 0, SWT.RIGHT);
    FormData fd_separator = new FormData();
    fd_separator.right = new FormAttachment(100, -15);
    fd_separator.left = new FormAttachment(0, 15);
    fd_separator.top = new FormAttachment(alwaysShowOption, 15);
    fd_separator.bottom = new FormAttachment(alwaysShowOption, 17, SWT.BOTTOM);
    separator.setLayoutData(fd_separator);
  }
コード例 #2
0
 private void initCheckboxFlag() {
   alwaysShowRunOptions = abstractMeta.isAlwaysShowRunOptions();
 }