Beispiel #1
0
  private Composite createUserArea(
      Composite parent, FormToolkit toolkit, PersonIdent person, boolean author) {
    Composite userArea = toolkit.createComposite(parent);
    GridLayoutFactory.fillDefaults().spacing(2, 2).numColumns(3).applyTo(userArea);

    Label userLabel = toolkit.createLabel(userArea, null);
    userLabel.setImage(getImage(author ? UIIcons.ELCL16_AUTHOR : UIIcons.ELCL16_COMMITTER));
    if (author) userLabel.setToolTipText(UIText.CommitEditorPage_TooltipAuthor);
    else userLabel.setToolTipText(UIText.CommitEditorPage_TooltipCommitter);

    boolean signedOff = isSignedOffBy(person);

    Text userText = new Text(userArea, SWT.FLAT | SWT.READ_ONLY);
    userText.setText(
        MessageFormat.format(
            author ? UIText.CommitEditorPage_LabelAuthor : UIText.CommitEditorPage_LabelCommitter,
            person.getName(),
            person.getEmailAddress(),
            person.getWhen()));
    toolkit.adapt(userText, false, false);
    userText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);

    GridDataFactory.fillDefaults().span(signedOff ? 1 : 2, 1).applyTo(userText);
    if (signedOff) {
      Label signedOffLabel = toolkit.createLabel(userArea, null);
      signedOffLabel.setImage(getImage(UIIcons.SIGNED_OFF));
      if (author) signedOffLabel.setToolTipText(UIText.CommitEditorPage_TooltipSignedOffByAuthor);
      else signedOffLabel.setToolTipText(UIText.CommitEditorPage_TooltipSignedOffByCommitter);
    }

    return userArea;
  }
  /*
   * (non-Jsdoc)
   * @see com.ebmwebsourcing.petals.common.croquis.internal.provisional.ICroquisExtension
   * #createControl(org.eclipse.swt.widgets.Composite, com.ebmwebsourcing.petals.common.croquis.internal.provisional.CroquisNewWizardPage)
   */
  public void createControl(Composite parent, final CroquisNewWizardPage page) {

    Label l = new Label(parent, SWT.NONE);
    l.setText("File Name:");
    l.setToolTipText("The name of the file to create");

    Text text = new Text(parent, SWT.BORDER);
    text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    text.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            EipCroquis.this.fileName = ((Text) e.widget).getText().trim();
            validate(page);
          }
        });

    l = new Label(parent, SWT.NONE);
    l.setText("Chain Name:");
    l.setToolTipText("The name of the EIP chain to create");

    text = new Text(parent, SWT.BORDER);
    text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    text.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            EipCroquis.this.chainName = ((Text) e.widget).getText().trim();
            validate(page);
          }
        });
  }
 public void observe(nsIConsoleMessage message) {
   nsIScriptError error =
       (nsIScriptError) message.queryInterface(nsIScriptError.NS_ISCRIPTERROR_IID);
   if (error == null) {
     return;
   }
   if (browser == null || browser.isDisposed()) {
     return;
   }
   long flag = error.getFlags();
   if ((flag == nsIScriptError.errorFlag || flag == nsIScriptError.exceptionFlag)
       && error.getSourceName().equals(internalGetUrl())) {
     errorCount++;
     if (errorCount == 1) {
       String errorMessage =
           MessageFormat.format(
               Messages.getString("FirefoxBrowser.Error"),
               new Object[] {errorCount}); // $NON-NLS-1$
       errorIcon.setImage(Activator.getDefault().getImage(Activator.ERRORS_IMG_ID));
       errorLabel.setText(errorMessage);
       errorLabel.setToolTipText(
           Messages.getString("FirefoxBrowser.Errors_In_Page")); // $NON-NLS-1$
       errorIcon.setToolTipText(errorLabel.getToolTipText());
     } else {
       String errorMessage =
           MessageFormat.format(
               Messages.getString("FirefoxBrowser.Errors"),
               new Object[] {errorCount}); // $NON-NLS-1$
       errorLabel.setText(errorMessage);
     }
     errors.layout(true, true);
     errors.getParent().layout(true, true);
   }
 }
Beispiel #4
0
 /** Updates {@link #labelAppVersion} with current verson information */
 private void updateLabelAppVersion() {
   if (Version.isUpdateAvailable() == null) {
     if (ConfigurationFactory.getConfigurationFactory().getConfiguration().checkForUpdates()) {
       labelAppVersion.setToolTipText("Could not get version information.");
     }
   } else {
     if (Version.isUpdateAvailable()) {
       labelAppVersion.setForeground(SharedStyle.COLOR_RED);
       labelAppVersion.setText(Version.VERSION_NUMBER + " (Update Available!)");
       labelAppVersion.setToolTipText("Click to go to update " + "download page");
       labelAppVersion.setCursor(SharedStyle.CURSOR_HAND);
       labelAppVersion.addMouseListener(
           new MouseAdapter() {
             @Override
             public void mouseUp(final MouseEvent event) {
               Program.launch(Version.DOWNLOAD_URL);
               shell.dispose();
             }
           });
     } else {
       labelAppVersion.setText(Version.VERSION_NUMBER);
       labelAppVersion.setToolTipText("Latest available version!");
       labelAppVersion.setForeground(SharedStyle.COLOR_GREEN);
     }
   }
 }
 private void clearErrors() {
   errorCount = 0;
   errorIcon.setImage(Activator.getDefault().getImage(Activator.NO_ERRORS_IMG_ID));
   errorLabel.setText(""); // $NON-NLS-1$
   errorLabel.setToolTipText(""); // $NON-NLS-1$
   errorIcon.setToolTipText(Messages.getString("FirefoxBrowser.No_Errors_On_Page")); // $NON-NLS-1$
   errors.layout(true, true);
 }
 /** {@inheritDoc} */
 @Override
 protected void createHeadClient(Form form) {
   Composite infoComposite = new Composite(form.getHead(), SWT.NONE);
   infoComposite.setLayout(new GridLayout(2, false));
   Label infoLabel = new Label(infoComposite, SWT.NONE);
   infoLabel.setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_INFORMATION));
   infoLabel.setToolTipText(BusinessContextManagerViewPart.APP_ORDER_INFO_TOOLTIP);
   Label infoLabelText = new Label(infoComposite, SWT.NONE);
   infoLabelText.setText("Pay attention to the order of application definitions!");
   infoLabelText.setToolTipText(BusinessContextManagerViewPart.APP_ORDER_INFO_TOOLTIP);
   form.setHeadClient(infoComposite);
 }
Beispiel #7
0
  @NotNull
  public static Button createLabelCheckbox(
      @NotNull Composite parent,
      @NotNull String label,
      @Nullable String tooltip,
      boolean checked,
      int style) {
    Label labelControl = createControlLabel(parent, label);
    // labelControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    final Button button = new Button(parent, SWT.CHECK | style);
    if (checked) {
      button.setSelection(true);
    }
    labelControl.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseUp(MouseEvent e) {
            if (!button.isDisposed() && button.isVisible() && button.isEnabled()) {
              button.setSelection(!button.getSelection());
              button.notifyListeners(SWT.Selection, new Event());
            }
          }
        });

    if (tooltip != null) {
      labelControl.setToolTipText(tooltip);
      button.setToolTipText(tooltip);
    }
    return button;
  }
 protected void setStatus(IStatus status) {
   if (status == null || status.isOK()) {
     errorLabel.setText("");
     errorImage.setImage(null);
   } else {
     errorLabel.setText(status.getMessage());
     errorLabel.setToolTipText(status.getMessage());
     Image toUse = null;
     switch (status.getSeverity()) {
       case IStatus.WARNING:
         toUse =
             PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
         break;
       case IStatus.ERROR:
         toUse =
             PlatformUI.getWorkbench()
                 .getSharedImages()
                 .getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
         break;
       case IStatus.INFO:
         toUse =
             PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
         break;
     }
     errorImage.setImage(toUse);
     errorImage.setVisible(true);
   }
 }
  private void createUI20RecentEntries(final Composite parent) {

    final Composite container = new Composite(parent, SWT.NONE);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
    GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
    {

      /*
       * number of recent tour types
       */
      final Label label = new Label(container, NONE);
      label.setText(Messages.Pref_Appearance_NumberOfRecent_TourTypes);
      label.setToolTipText(Messages.Pref_Appearance_NumberOfRecent_TourTypes_Tooltip);

      // spinner
      _spinnerRecentTourTypes = new Spinner(container, SWT.BORDER);
      GridDataFactory.fillDefaults() //
          .hint(_hintDefaultSpinnerWidth, SWT.DEFAULT)
          .align(SWT.BEGINNING, SWT.CENTER)
          .applyTo(_spinnerRecentTourTypes);
      _spinnerRecentTourTypes.setToolTipText(
          Messages.Pref_Appearance_NumberOfRecent_TourTypes_Tooltip);
      _spinnerRecentTourTypes.setMinimum(0);
      _spinnerRecentTourTypes.setMaximum(9);
      _spinnerRecentTourTypes.addSelectionListener(_defaultSelectionAdapter);
      _spinnerRecentTourTypes.addMouseWheelListener(_defaultMouseWheelListener);
    }
  }
  private void createUI22SmoothGradient(final Composite parent) {

    /*
     * image: gradient
     */
    _iconGradient = new CLabel(parent, SWT.NONE);
    GridDataFactory.fillDefaults().indent(16, 0).applyTo(_iconGradient);
    _iconGradient.setBackground(_tk.getColors().getBackground());
    _iconGradient.setImage(_imageGradient);

    /*
     * label: smooth gradient
     */
    final Label label =
        _tk.createLabel(parent, Messages.TourChart_Smoothing_Label_GradientSmoothing, SWT.CHECK);
    GridDataFactory.fillDefaults() //
        .align(SWT.FILL, SWT.CENTER)
        .applyTo(label);
    label.setToolTipText(Messages.TourChart_Smoothing_Label_GradientSmoothing_Tooltip);

    /*
     * spinner: gradient tau
     */
    _spinnerGradientTau = new Spinner(parent, SWT.BORDER);
    GridDataFactory.fillDefaults() //
        .align(SWT.BEGINNING, SWT.FILL)
        .applyTo(_spinnerGradientTau);
    _spinnerGradientTau.setDigits(1);
    _spinnerGradientTau.setMinimum(1);
    _spinnerGradientTau.setMaximum(MAX_TAU);
    _spinnerGradientTau.addSelectionListener(_selectionListener);
    _spinnerGradientTau.addMouseWheelListener(_spinnerMouseWheelListener);
  }
  @Override
  protected Control createContents(Composite p) {
    Composite parent = (Composite) super.createContents(p);

    Label scriptLabel = new Label(parent, SWT.NONE);
    String headerMessages = getHeaderMessages();
    scriptLabel.setText(headerMessages);
    // FIXME, If the message can't be displayed complectly. try to set the tool tip
    if (headerMessages.length() > 50) { // simply first, just set the length greater than 50
      scriptLabel.setToolTipText(headerMessages);
    }

    int style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
    if (isReadonly()) {
      style |= SWT.READ_ONLY;
    }
    scriptTxt = new StyledText(parent, style);
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.heightHint = 280;
    layoutData.minimumHeight = 280;
    layoutData.widthHint = 500;
    layoutData.minimumWidth = 500;
    scriptTxt.setLayoutData(layoutData);
    scriptTxt.setText(getScriptContent());

    return parent;
  }
 private Label createLabel(Composite container, String text, String tip, int hspan) {
   final Label lbl = new Label(container, SWT.NULL);
   lbl.setText(text);
   lbl.setToolTipText(tip);
   lbl.setLayoutData(createGridData(hspan));
   return (lbl);
 }
  private void restoreFileVersion(FileVersion fileVersion) {
    // Set labels/status
    String shortFileName = shortenFileName(fileVersion.getPath());
    String versionStr = Long.toString(fileVersion.getVersion());

    restoreButton.setEnabled(false);
    restoreStatusIconComposite.setVisible(true);
    restoreStatusTextLabel.setVisible(true);

    restoreStatusIconComposite.setAnimatedImage(
        IMAGE_LOADING_SPINNER_RESOURCE, IMAGE_LOADING_SPINNER_FRAME_RATE);
    restoreStatusTextLabel.setText(
        I18n.getText(
            "org.syncany.gui.history.DetailPanel.label.fileRestoreOngoing",
            shortFileName,
            versionStr));
    restoreStatusTextLabel.setCursor(new Cursor(Display.getDefault(), SWT.CURSOR_ARROW));
    restoreStatusTextLabel.setToolTipText("");

    restoredFile = null;

    layout();

    // Send restore request
    RestoreOperationOptions restoreOptions = new RestoreOperationOptions();
    restoreOptions.setFileHistoryId(fileVersion.getFileHistoryId());
    restoreOptions.setFileVersion(fileVersion.getVersion().intValue());

    pendingRestoreRequest = new RestoreFolderRequest();
    pendingRestoreRequest.setRoot(historyModel.getSelectedRoot());
    pendingRestoreRequest.setOptions(restoreOptions);

    eventBus.post(pendingRestoreRequest);
  }
  @Override
  protected void createCustomContents(Composite parent) {
    GridData gd;

    Group group =
        WidgetFactory.createSimpleGroup(
            parent, UTIL.getString("Common.Properties.Label")); // $NON-NLS-1$;

    scrolled = new Composite(group, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    scrolled.setLayout(gridLayout);

    urlLabel = new Label(scrolled, SWT.NONE);
    urlLabel.setText(UTIL.getString("Common.URL.Label")); // $NON-NLS-1$
    urlLabel.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.BEGINNING;
    urlLabel.setLayoutData(gd);

    urlText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    urlText.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    urlText.setLayoutData(gd);

    initControls();
    addlisteners();
  }
  @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;
  }
  public SMAEstimatedHoursHeader(
      Composite parent, int style, final AbstractWorkflowArtifact sma, final SMAEditor editor) {
    super(parent, style);
    this.awa = sma;
    setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    setLayout(ALayout.getZeroMarginLayout(2, false));
    editor.getToolkit().adapt(this);

    try {
      if (!sma.isCancelled() && !sma.isCompleted()) {
        Hyperlink link = editor.getToolkit().createHyperlink(this, LABEL, SWT.NONE);
        link.addHyperlinkListener(
            new IHyperlinkListener() {

              @Override
              public void linkEntered(HyperlinkEvent e) {
                // do nothing
              }

              @Override
              public void linkExited(HyperlinkEvent e) {
                // do nothing
              }

              @Override
              public void linkActivated(HyperlinkEvent e) {
                try {
                  if (editor.isDirty()) {
                    editor.doSave(null);
                  }
                  PromptChangeUtil.promptChangeAttribute(
                      sma, AtsAttributeTypes.EstimatedHours, true, false);
                } catch (Exception ex) {
                  OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
                }
              }
            });
      } else {
        Label origLabel = editor.getToolkit().createLabel(this, LABEL);
        origLabel.setLayoutData(new GridData());
      }

      valueLabel = editor.getToolkit().createLabel(this, "0.0");
      valueLabel.setToolTipText(getToolTip());
      valueLabel.setLayoutData(new GridData());
      updateLabel(sma);

    } catch (OseeCoreException ex) {
      Label errorLabel =
          editor.getToolkit().createLabel(this, "Error: " + ex.getLocalizedMessage());
      errorLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
      OseeLog.log(Activator.class, Level.SEVERE, ex);
    }
  }
  private void updateRestoreStatus(
      RestoreFolderRequest restoreRequest, RestoreFolderResponse restoreResponse) {
    RestoreOperationResult restoreResult = restoreResponse.getResult();
    RestoreResultCode restoreResultCode = restoreResult.getResultCode();

    // Set labels/status
    restoreButton.setEnabled(true);
    restoreStatusIconComposite.setVisible(true);
    restoreStatusTextLabel.setVisible(true);

    if (restoreResultCode == RestoreResultCode.ACK) {
      String shortFileName = shortenFileName(restoreResult.getTargetFile().getAbsolutePath());
      logger.log(
          Level.INFO,
          "Detail panel: Restore successful, file restored to "
              + restoreResult.getTargetFile().toString());

      restoreStatusIconComposite.setImage(
          SWTResourceManager.getImage(String.format(IMAGE_RESOURCE_FORMAT, "success")));
      restoreStatusTextLabel.setText(
          I18n.getText(
              "org.syncany.gui.history.DetailPanel.label.fileRestoreSuccess", shortFileName));
      restoreStatusTextLabel.setCursor(new Cursor(Display.getDefault(), SWT.CURSOR_HAND));
      restoreStatusTextLabel.setToolTipText(restoreResult.getTargetFile().toString());

      restoredFile = restoreResult.getTargetFile();
    } else {
      logger.log(Level.WARNING, "Detail panel: Restore FAILED, error code " + restoreResultCode);

      restoreStatusIconComposite.setImage(
          SWTResourceManager.getImage(String.format(IMAGE_RESOURCE_FORMAT, "failure")));
      restoreStatusTextLabel.setText(
          I18n.getText("org.syncany.gui.history.DetailPanel.label.fileRestoreFailure"));
      restoreStatusTextLabel.setCursor(new Cursor(Display.getDefault(), SWT.CURSOR_ARROW));
      restoreStatusTextLabel.setToolTipText("");

      restoredFile = null;
    }

    layout();
  }
  public LabelTimeComposite(Composite composite, String labelText, String toolTipText) {
    super(composite, SWT.NONE);
    props.setLook(this);

    int middle = props.getMiddlePct();
    int threeQuarters = (middle + 100) / 2;
    int margin = Const.MARGIN;

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 0;
    formLayout.marginHeight = 0;
    formLayout.marginTop = 0;
    formLayout.marginBottom = 0;

    this.setLayout(formLayout);

    wText = new Text(this, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    FormData fdText = new FormData();
    fdText.left = new FormAttachment(middle, margin);
    fdText.right = new FormAttachment(threeQuarters, 0);
    wText.setLayoutData(fdText);
    wText.setToolTipText(toolTipText);

    wTimeUnit = new CCombo(this, SWT.SINGLE | SWT.DROP_DOWN | SWT.BORDER | SWT.LEFT);
    FormData fdCombo = new FormData();
    fdCombo.left = new FormAttachment(threeQuarters, margin);
    fdCombo.right = new FormAttachment(100, 0);
    wTimeUnit.setEditable(false);
    wTimeUnit.setLayoutData(fdCombo);
    wTimeUnit.setItems(getTimeUnits());
    wTimeUnit.setToolTipText(toolTipText);

    wLabel = new Label(this, SWT.RIGHT);
    props.setLook(wLabel);
    wLabel.setText(labelText);
    FormData fdLabel = new FormData();
    fdLabel.left = new FormAttachment(0, 0);
    fdLabel.right = new FormAttachment(middle, 0);
    fdLabel.top = new FormAttachment(wText, 0, SWT.CENTER);
    wLabel.setLayoutData(fdLabel);
    wLabel.setToolTipText(toolTipText);

    wText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            if (!StringUtils.isNumeric(wText.getText())) {
              wText.setText(lastValidValue);
            } else lastValidValue = wText.getText();
          }
        });
  }
  /**
   * creates the control area for the name definition
   *
   * @param control the parent composite
   */
  protected void createNameControl(Composite control) {
    final Label nameLabel = new Label(control, SWT.NONE);
    nameLabel.setText(Messages.Local_Palette_Name);
    nameLabel.setToolTipText(Messages.Local_Palette_Name_Tooltip);

    nameText = new Text(control, SWT.BORDER);
    nameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    nameText.setToolTipText(Messages.Local_Palette_Name_Tooltip);

    // initialize, then add the listener...
    initialPopulateNameField();

    nameText.addListener(SWT.Modify, this);
  }
  /**
   * creates the control area for the name definition
   *
   * @param control the parent composite
   */
  protected void createEditorIDControl(Composite control) {
    final Label editorLabel = new Label(control, SWT.NONE);
    editorLabel.setText(Messages.Local_Palette_Editor_Id);
    editorLabel.setToolTipText(Messages.Local_Palette_Editor_Id_Tooltip);

    editorText = new Text(control, SWT.BORDER);
    editorText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    editorText.setToolTipText(Messages.Local_Palette_Editor_Id_Tooltip);

    // initialize, then add the listener...
    initialPopulateEditorIDField();

    editorText.addListener(SWT.Modify, this);
    // this editor should propose a list of existing editors = looking in the extension point?
  }
  /**
   * creates the control area for the priority
   *
   * @param control the parent composite
   */
  protected void createPriorityControl(Composite control) {
    final Label priorityLabel = new Label(control, SWT.NONE);
    priorityLabel.setText(Messages.Local_Palette_Priority);
    priorityLabel.setToolTipText(Messages.Local_Palette_Priority_Tooltip);

    // choice widget among priority values
    priorityCombo = new Combo(control, SWT.READ_ONLY);
    priorityCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    priorityCombo.setToolTipText(Messages.Local_Palette_Priority_Tooltip);
    priorityCombo.setItems(priorityList);

    // initialize, then add the listener...
    initialPopulatePriorityField();

    priorityCombo.addListener(SWT.Modify, this);
  }
Beispiel #22
0
 /** Creates label with application homepage URL */
 private void createLabelAppHomePage() {
   labelAppHomePage = new Label(shell, SWT.NONE);
   labelAppHomePage.setText(Version.HOMEPAGE);
   labelAppHomePage.setLayoutData(SharedStyle.relativeTo(labelReleased, labelHomePage));
   labelAppHomePage.setCursor(SharedStyle.CURSOR_HAND);
   labelAppHomePage.setForeground(SharedStyle.COLOR_BLUE);
   labelAppHomePage.setToolTipText("Click to open in browser");
   labelAppHomePage.addMouseListener(
       new MouseAdapter() {
         @Override
         public void mouseUp(final MouseEvent event) {
           Program.launch(Version.HOMEPAGE);
           shell.dispose();
         }
       });
 }
  private void createEntityViewer(Composite composite) throws JavaModelException {

    Label propertyMethodsLabel = new Label(composite, SWT.NONE);
    propertyMethodsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 3, 1));
    propertyMethodsLabel.setText("Select entities to include:"); // $NON-NLS-1$
    String tooltip =
        "Entities are identified in Java source with the @Entity or @PersistenceCapable annotations."; //$NON-NLS-1$
    // + "To add un-annotated classes, use the \'Add..' button.";
    propertyMethodsLabel.setToolTipText(tooltip);

    // spacer
    new Label(composite, SWT.NONE);

    entityViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
    Table propertyTree = entityViewer.getTable();
    GridData gd = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
    gd.heightHint = 100;
    propertyTree.setLayoutData(gd);

    entityTree = entityViewer.getControl();
    entityTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Composite selectionControls = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.verticalSpacing = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = 0;
    layout.marginHeight = 0;
    selectionControls.setLayout(layout);
    selectionControls.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));

    Button selectAllButton = new Button(selectionControls, SWT.NONE);
    selectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    selectAllButton.setText("Select All"); // $NON-NLS-1$

    Button deselectAllButton = new Button(selectionControls, SWT.NONE);
    deselectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    deselectAllButton.setText("Deselect All"); // $NON-NLS-1$

    configureMethodTableViewer(
        entityViewer,
        RequestFactoryUtils.createEntityListContentProvider(getJavaProject()),
        new JavaElementLabelProvider(),
        selectAllButton,
        deselectAllButton);
  }
  @Override
  protected Control createContents(Composite parent) {
    Composite base = new Composite(parent, SWT.NONE);
    base.setLayout(new GridLayout(1, false));

    Composite top = new Composite(base, SWT.NONE);
    top.setLayout(new GridLayout(2, false));
    top.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, false));

    Label selectionLabel = new Label(top, SWT.NONE);
    selectionLabel.setText("Platform: ");
    selectionLabel.setToolTipText("The platform whose environment variables should be displayed");
    selectionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

    selection =
        new PlatformSelection() {
          @Override
          protected void changed(IPlatform newChoice) {
            storeCurrent();
            showCurrent();
          }
        };
    selection.createControl(top);
    selection.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    variables = new EnvironmentVariablesPage(false);
    variables.createControl(base);
    variables.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    IPlatform[] platforms = getPlatforms();
    selections.put(NULL_SELECTION, getVariables(null));
    for (IPlatform platform : platforms) {
      selections.put(platform, getVariables(platform));
    }

    selection.setChoices(platforms);
    showCurrent();

    return base;
  }
  private void createClearTextNew(Composite parent) {
    // only create the button if the text widget doesn't support one
    // natively
    if ((filterText.getStyle() & SWT.ICON_CANCEL) == 0) {
      final Image inactiveImage =
          new Image(
              this.getDisplay(),
              FilterTextComposite.class.getResourceAsStream(DISABLED_CLEAR_ICON));
      final Image activeImage =
          new Image(this.getDisplay(), FilterTextComposite.class.getResourceAsStream(CLEAR_ICON));
      final Image pressedImage = new Image(getDisplay(), activeImage, SWT.IMAGE_GRAY);

      final Label clearButton = new Label(parent, SWT.NONE);
      clearButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
      clearButton.setImage(inactiveImage);
      clearButton.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
      clearButton.setToolTipText("Tooltip");
      clearButton.addMouseListener(
          new MouseAdapter() {
            private MouseMoveListener fMoveListener;

            public void mouseDown(MouseEvent e) {
              clearButton.setImage(pressedImage);
              fMoveListener =
                  new MouseMoveListener() {
                    private boolean fMouseInButton = true;

                    public void mouseMove(MouseEvent e) {
                      boolean mouseInButton = isMouseInButton(e);
                      if (mouseInButton != fMouseInButton) {
                        fMouseInButton = mouseInButton;
                        clearButton.setImage(mouseInButton ? pressedImage : inactiveImage);
                      }
                    }
                  };
              clearButton.addMouseMoveListener(fMoveListener);
            }

            public void mouseUp(MouseEvent e) {
              if (fMoveListener != null) {
                clearButton.removeMouseMoveListener(fMoveListener);
                fMoveListener = null;
                boolean mouseInButton = isMouseInButton(e);
                clearButton.setImage(mouseInButton ? activeImage : inactiveImage);
                if (mouseInButton) {
                  clearText();
                  filterText.setFocus();
                }
              }
            }

            private boolean isMouseInButton(MouseEvent e) {
              Point buttonSize = clearButton.getSize();
              return 0 <= e.x && e.x < buttonSize.x && 0 <= e.y && e.y < buttonSize.y;
            }
          });
      clearButton.addMouseTrackListener(
          new MouseTrackListener() {
            public void mouseEnter(MouseEvent e) {
              clearButton.setImage(activeImage);
            }

            public void mouseExit(MouseEvent e) {
              clearButton.setImage(inactiveImage);
            }

            public void mouseHover(MouseEvent e) {}
          });
      clearButton.addDisposeListener(
          new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
              inactiveImage.dispose();
              activeImage.dispose();
              pressedImage.dispose();
            }
          });

      this.clearButtonControl = clearButton;
    }
  }
  @Override
  public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();

    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    setShellImage(shell, input);

    ModifyListener lsMod =
        new ModifyListener() {
          @Override
          public void modifyText(ModifyEvent e) {
            input.setChanged();
          }
        };
    SelectionListener lsSel =
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent arg0) {
            input.setChanged();
          }
        };
    backupChanged = input.hasChanged();

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;

    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "MemoryGroupByDialog.Shell.Title"));

    int middle = props.getMiddlePct();
    int margin = Const.MARGIN;

    // Stepname line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "MemoryGroupByDialog.Stepname.Label"));
    props.setLook(wlStepname);
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment(0, 0);
    fdlStepname.right = new FormAttachment(middle, -margin);
    fdlStepname.top = new FormAttachment(0, margin);
    wlStepname.setLayoutData(fdlStepname);
    wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStepname.setText(stepname);
    props.setLook(wStepname);
    wStepname.addModifyListener(lsMod);
    fdStepname = new FormData();
    fdStepname.left = new FormAttachment(middle, 0);
    fdStepname.top = new FormAttachment(0, margin);
    fdStepname.right = new FormAttachment(100, 0);
    wStepname.setLayoutData(fdStepname);

    // Always pass a result rows as output
    //
    wlAlwaysAddResult = new Label(shell, SWT.RIGHT);
    wlAlwaysAddResult.setText(
        BaseMessages.getString(PKG, "MemoryGroupByDialog.AlwaysAddResult.Label"));
    wlAlwaysAddResult.setToolTipText(
        BaseMessages.getString(PKG, "MemoryGroupByDialog.AlwaysAddResult.ToolTip"));
    props.setLook(wlAlwaysAddResult);
    fdlAlwaysAddResult = new FormData();
    fdlAlwaysAddResult.left = new FormAttachment(0, 0);
    fdlAlwaysAddResult.top = new FormAttachment(wStepname, margin);
    fdlAlwaysAddResult.right = new FormAttachment(middle, -margin);
    wlAlwaysAddResult.setLayoutData(fdlAlwaysAddResult);
    wAlwaysAddResult = new Button(shell, SWT.CHECK);
    wAlwaysAddResult.setToolTipText(
        BaseMessages.getString(PKG, "MemoryGroupByDialog.AlwaysAddResult.ToolTip"));
    props.setLook(wAlwaysAddResult);
    fdAlwaysAddResult = new FormData();
    fdAlwaysAddResult.left = new FormAttachment(middle, 0);
    fdAlwaysAddResult.top = new FormAttachment(wStepname, margin);
    fdAlwaysAddResult.right = new FormAttachment(100, 0);
    wAlwaysAddResult.setLayoutData(fdAlwaysAddResult);
    wAlwaysAddResult.addSelectionListener(lsSel);

    wlGroup = new Label(shell, SWT.NONE);
    wlGroup.setText(BaseMessages.getString(PKG, "MemoryGroupByDialog.Group.Label"));
    props.setLook(wlGroup);
    fdlGroup = new FormData();
    fdlGroup.left = new FormAttachment(0, 0);
    fdlGroup.top = new FormAttachment(wAlwaysAddResult, margin);
    wlGroup.setLayoutData(fdlGroup);

    int nrKeyCols = 1;
    int nrKeyRows = (input.getGroupField() != null ? input.getGroupField().length : 1);

    ciKey = new ColumnInfo[nrKeyCols];
    ciKey[0] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "MemoryGroupByDialog.ColumnInfo.GroupField"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            new String[] {""},
            false);

    wGroup =
        new TableView(
            transMeta,
            shell,
            SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL,
            ciKey,
            nrKeyRows,
            lsMod,
            props);

    wGet = new Button(shell, SWT.PUSH);
    wGet.setText(BaseMessages.getString(PKG, "MemoryGroupByDialog.GetFields.Button"));
    fdGet = new FormData();
    fdGet.top = new FormAttachment(wlGroup, margin);
    fdGet.right = new FormAttachment(100, 0);
    wGet.setLayoutData(fdGet);

    fdGroup = new FormData();
    fdGroup.left = new FormAttachment(0, 0);
    fdGroup.top = new FormAttachment(wlGroup, margin);
    fdGroup.right = new FormAttachment(wGet, -margin);
    fdGroup.bottom = new FormAttachment(45, 0);
    wGroup.setLayoutData(fdGroup);

    // THE Aggregate fields
    wlAgg = new Label(shell, SWT.NONE);
    wlAgg.setText(BaseMessages.getString(PKG, "MemoryGroupByDialog.Aggregates.Label"));
    props.setLook(wlAgg);
    fdlAgg = new FormData();
    fdlAgg.left = new FormAttachment(0, 0);
    fdlAgg.top = new FormAttachment(wGroup, margin);
    wlAgg.setLayoutData(fdlAgg);

    int UpInsCols = 4;
    int UpInsRows = (input.getAggregateField() != null ? input.getAggregateField().length : 1);

    ciReturn = new ColumnInfo[UpInsCols];
    ciReturn[0] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "MemoryGroupByDialog.ColumnInfo.Name"),
            ColumnInfo.COLUMN_TYPE_TEXT,
            false);
    ciReturn[1] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "MemoryGroupByDialog.ColumnInfo.Subject"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            new String[] {""},
            false);
    ciReturn[2] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "MemoryGroupByDialog.ColumnInfo.Type"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            MemoryGroupByMeta.typeGroupLongDesc);
    ciReturn[3] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "MemoryGroupByDialog.ColumnInfo.Value"),
            ColumnInfo.COLUMN_TYPE_TEXT,
            false);
    ciReturn[3].setToolTip(
        BaseMessages.getString(PKG, "MemoryGroupByDialog.ColumnInfo.Value.Tooltip"));
    ciReturn[3].setUsingVariables(true);

    wAgg =
        new TableView(
            transMeta,
            shell,
            SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL,
            ciReturn,
            UpInsRows,
            lsMod,
            props);

    wGetAgg = new Button(shell, SWT.PUSH);
    wGetAgg.setText(BaseMessages.getString(PKG, "MemoryGroupByDialog.GetLookupFields.Button"));
    fdGetAgg = new FormData();
    fdGetAgg.top = new FormAttachment(wlAgg, margin);
    fdGetAgg.right = new FormAttachment(100, 0);
    wGetAgg.setLayoutData(fdGetAgg);

    //
    // Search the fields in the background

    final Runnable runnable =
        new Runnable() {
          @Override
          public void run() {
            StepMeta stepMeta = transMeta.findStep(stepname);
            if (stepMeta != null) {
              try {
                RowMetaInterface row = transMeta.getPrevStepFields(stepMeta);

                // Remember these fields...
                for (int i = 0; i < row.size(); i++) {
                  inputFields.put(row.getValueMeta(i).getName(), Integer.valueOf(i));
                }
                setComboBoxes();
              } catch (KettleException e) {
                logError(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
              }
            }
          }
        };
    new Thread(runnable).start();

    // THE BUTTONS
    wOK = new Button(shell, SWT.PUSH);
    wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));

    setButtonPositions(new Button[] {wOK, wCancel}, margin, null);

    fdAgg = new FormData();
    fdAgg.left = new FormAttachment(0, 0);
    fdAgg.top = new FormAttachment(wlAgg, margin);
    fdAgg.right = new FormAttachment(wGetAgg, -margin);
    fdAgg.bottom = new FormAttachment(wOK, -margin);
    wAgg.setLayoutData(fdAgg);

    // Add listeners
    lsOK =
        new Listener() {
          @Override
          public void handleEvent(Event e) {
            ok();
          }
        };
    lsGet =
        new Listener() {
          @Override
          public void handleEvent(Event e) {
            get();
          }
        };
    lsGetAgg =
        new Listener() {
          @Override
          public void handleEvent(Event e) {
            getAgg();
          }
        };
    lsCancel =
        new Listener() {
          @Override
          public void handleEvent(Event e) {
            cancel();
          }
        };

    wOK.addListener(SWT.Selection, lsOK);
    wGet.addListener(SWT.Selection, lsGet);
    wGetAgg.addListener(SWT.Selection, lsGetAgg);
    wCancel.addListener(SWT.Selection, lsCancel);

    lsDef =
        new SelectionAdapter() {
          @Override
          public void widgetDefaultSelected(SelectionEvent e) {
            ok();
          }
        };

    wStepname.addSelectionListener(lsDef);

    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(
        new ShellAdapter() {
          @Override
          public void shellClosed(ShellEvent e) {
            cancel();
          }
        });

    // Set the shell size, based upon previous time...
    setSize();

    getData();
    input.setChanged(backupChanged);

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    return stepname;
  }
Beispiel #27
0
 public void setToolTipText(String text) {
   labelItem.setToolTipText(text);
   combo.setToolTipText(text);
 }
Beispiel #28
0
 public void setToolTipText(String text) {
   labelItem.setToolTipText(text);
   this.check.setToolTipText(text);
 }
  @Override
  protected void createCustomContents(Composite parent) {
    GridData gd;

    Group group =
        WidgetFactory.createSimpleGroup(
            parent, UTIL.getString("Common.Properties.Label")); // $NON-NLS-1$;

    scrolled = new Composite(group, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    scrolled.setLayout(gridLayout);

    urlLabel = new Label(scrolled, SWT.NONE);
    urlLabel.setText(UTIL.getString("Common.URL.Label")); // $NON-NLS-1$
    urlLabel.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    urlLabel.setLayoutData(gd);

    urlText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    urlText.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    urlText.setLayoutData(gd);

    securityLabel = new Label(scrolled, SWT.NONE);
    securityLabel.setText(UTIL.getString("Common.Security.Type.Label")); // $NON-NLS-1$
    securityLabel.setToolTipText(UTIL.getString("Common.Security.Type.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    securityLabel.setLayoutData(gd);

    securityText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    securityText.setToolTipText(UTIL.getString("Common.Security.Type.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    securityText.setLayoutData(gd);

    usernameLabel = new Label(scrolled, SWT.NONE);
    usernameLabel.setText(UTIL.getString("Common.Username.Label")); // $NON-NLS-1$
    usernameLabel.setToolTipText(UTIL.getString("Common.Username.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    usernameLabel.setLayoutData(gd);

    usernameText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    usernameText.setToolTipText(UTIL.getString("Common.Username.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    usernameText.setLayoutData(gd);

    passwordLabel = new Label(scrolled, SWT.NONE);
    passwordLabel.setText(UTIL.getString("Common.Password.Label")); // $NON-NLS-1$
    passwordLabel.setToolTipText(UTIL.getString("Common.Password.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    passwordLabel.setLayoutData(gd);

    passwordText = new Text(scrolled, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
    passwordText.setToolTipText(UTIL.getString("Common.Password.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    passwordText.setLayoutData(gd);
    urlPreviewLabel = new Label(scrolled, SWT.NONE);
    urlPreviewLabel.setText(
        UTIL.getString("WSProfileDetailsWizardPage.urlPreviewLabel")); // $NON-NLS-1$
    gd = new GridData();
    urlPreviewLabel.setLayoutData(gd);

    urlPreviewText =
        new Text(scrolled, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.grabExcessHorizontalSpace = true;
    gd.heightHint = 40;
    gd.horizontalSpan = 3;
    urlPreviewText.setLayoutData(gd);
    urlPreviewText.setBackground(
        Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));

    initControls();

    TabFolder tabFolder = new TabFolder(scrolled, SWT.TOP | SWT.BORDER);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));

    Composite parameterPanel = WidgetFactory.createPanel(tabFolder);
    this.parametersTab = new TabItem(tabFolder, SWT.FILL);
    this.parametersTab.setControl(parameterPanel);
    this.parametersTab.setText(UTIL.getString("ParametersPanel_groupTitle")); // $NON-NLS-1$
    this.parameterPanel = new ParameterPanel(this, parameterPanel, parameterMap, 6);
    this.urlPreviewText.setText(updateUrlPreview().toString());

    Composite headerPropertiesPanel = WidgetFactory.createPanel(tabFolder);
    this.headerPropertiesTab = new TabItem(tabFolder, SWT.FILL);
    this.headerPropertiesTab.setControl(headerPropertiesPanel);
    this.headerPropertiesTab.setText(
        UTIL.getString("HeaderPropertiesPanel_groupTitle")); // $NON-NLS-1$
    new HeaderPropertiesPanel(headerPropertiesPanel, this.extraProperties, 6);

    addlisteners();
  }
Beispiel #30
0
  /** @wbp.parser.entryPoint */
  @Override
  public void createControl(final Composite parent) {
    runtimes = BackendCore.getRuntimeInfoManager().getRuntimes();

    final Composite comp = new Composite(parent, SWT.NONE);
    setControl(comp);
    final GridLayout topLayout = new GridLayout();
    topLayout.numColumns = 3;
    comp.setLayout(topLayout);

    final Label runtimeLabel = new Label(comp, SWT.NONE);
    runtimeLabel.setText("Name");

    final List<String> rtl = new ArrayList<String>();
    for (final RuntimeInfo r : runtimes) {
      rtl.add(r.getName());
    }
    final String[] rts = rtl.toArray(new String[] {});
    final RuntimeInfo defaultRuntime = BackendCore.getRuntimeInfoManager().getDefaultRuntime();
    final int db = defaultRuntime == null ? 0 : Arrays.binarySearch(rts, defaultRuntime.getName());

    runtimesCombo = new Combo(comp, SWT.READ_ONLY);
    final GridData gd_runtimesCombo = new GridData(174, SWT.DEFAULT);
    gd_runtimesCombo.horizontalAlignment = SWT.FILL;
    runtimesCombo.setLayoutData(gd_runtimesCombo);
    runtimesCombo.addSelectionListener(
        new SelectionAdapter() {
          @SuppressWarnings("synthetic-access")
          @Override
          public void widgetSelected(final SelectionEvent e) {
            updateLaunchConfigurationDialog();
          }
        });
    runtimesCombo.setItems(rts);
    runtimesCombo.select(db);
    new Label(comp, SWT.NONE);
    new Label(comp, SWT.NONE);
    new Label(comp, SWT.NONE);
    new Label(comp, SWT.NONE);

    final Label nodeNameLabel = new Label(comp, SWT.NONE);
    nodeNameLabel.setText("Node name");

    nameText = new Text(comp, SWT.BORDER);
    final GridData gd_nameText = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_nameText.widthHint = 241;
    nameText.setLayoutData(gd_nameText);
    nameText.addModifyListener(
        new ModifyListener() {
          @Override
          @SuppressWarnings("synthetic-access")
          public void modifyText(final ModifyEvent e) {
            updateLaunchConfigurationDialog();
          }
        });

    nodeHostLabel = new Label(comp, SWT.NONE);
    nodeHostLabel.setText("@");
    new Label(comp, SWT.NONE);

    longNameButton = new Button(comp, SWT.RADIO);
    longNameButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    longNameButton.addSelectionListener(
        new SelectionAdapter() {
          @SuppressWarnings("synthetic-access")
          @Override
          public void widgetSelected(final SelectionEvent e) {
            updateLaunchConfigurationDialog();
          }
        });
    longNameButton.setSelection(true);
    longNameButton.setText("long name (-name)");
    new Label(comp, SWT.NONE);

    shortNameButton = new Button(comp, SWT.RADIO);
    shortNameButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    shortNameButton.addSelectionListener(
        new SelectionAdapter() {
          @SuppressWarnings("synthetic-access")
          @Override
          public void widgetSelected(final SelectionEvent e) {
            updateLaunchConfigurationDialog();
          }
        });
    shortNameButton.setText("short name (-sname)");

    final Label cookieLabel = new Label(comp, SWT.NONE);
    cookieLabel.setToolTipText("Leave empty to use default one");
    cookieLabel.setText("Cookie");

    cookieText = new Text(comp, SWT.BORDER);
    final GridData gd_cookieText = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
    gd_cookieText.widthHint = 232;
    cookieText.setLayoutData(gd_cookieText);
    cookieText.addModifyListener(
        new ModifyListener() {
          @Override
          @SuppressWarnings("synthetic-access")
          public void modifyText(final ModifyEvent e) {
            updateLaunchConfigurationDialog();
          }
        });
    cookieText.setToolTipText("Leave empty to use default one");

    startNodeCheckbox = new Button(comp, SWT.CHECK);
    startNodeCheckbox.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
    startNodeCheckbox.setSelection(true);
    startNodeCheckbox.setText("Start the Erlang node if not running already");
    startNodeCheckbox.addSelectionListener(
        new SelectionAdapter() {
          @SuppressWarnings("synthetic-access")
          @Override
          public void widgetSelected(final SelectionEvent e) {
            updateLaunchConfigurationDialog();
          }
        });

    final Label workingDirectoryLabel = new Label(comp, SWT.NONE);
    workingDirectoryLabel.setText("Working directory");

    workingDirText = new Text(comp, SWT.BORDER);
    workingDirText.setToolTipText("may be relative to the workspace");
    workingDirText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    workingDirText.addModifyListener(
        new ModifyListener() {
          @Override
          @SuppressWarnings("synthetic-access")
          public void modifyText(final ModifyEvent e) {
            updateLaunchConfigurationDialog();
          }
        });

    final Label extraArgumentsLabel = new Label(comp, SWT.NONE);
    extraArgumentsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
    extraArgumentsLabel.setText("Extra arguments");

    argsText = new Text(comp, SWT.BORDER | SWT.MULTI);
    argsText.setToolTipText("as on the command line\nBe careful about proper quoting!");
    final GridData gd_argsText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    gd_argsText.heightHint = 35;
    argsText.setLayoutData(gd_argsText);
    argsText.addModifyListener(
        new ModifyListener() {
          @Override
          @SuppressWarnings("synthetic-access")
          public void modifyText(final ModifyEvent e) {
            updateLaunchConfigurationDialog();
          }
        });
    new Label(comp, SWT.NONE);
    final Label extraArgumentsLabel2 = new Label(comp, SWT.NONE);
    extraArgumentsLabel2.setText("(overrides runtime settings)");
    extraArgumentsLabel2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    distributedLoadCheck = new Button(comp, SWT.CHECK);
    distributedLoadCheck.setText("Load project code on all connected nodes");
    distributedLoadCheck.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    new Label(comp, SWT.NONE);
    distributedLoadCheck.addSelectionListener(
        new SelectionListener() {
          @Override
          public void widgetDefaultSelected(final SelectionEvent e) {
            updateLaunchConfigurationDialog();
          }

          @Override
          public void widgetSelected(final SelectionEvent e) {
            updateLaunchConfigurationDialog();
          }
        });

    updateLaunchConfigurationDialog();
  }