Exemple #1
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   * Interface of the page is created
   */
  public void createControl(Composite parent) {
    wizard = (IndicationWizard) getWizard();

    // create the composite to hold the widgets
    int nIdentation = 10;
    GridData gd;
    Composite composite = new Composite(parent, SWT.NULL);

    // create the desired layout for this wizard page
    GridLayout gl = new GridLayout();
    gl.makeColumnsEqualWidth = true;
    composite.setLayout(gl);

    Label lbName = new Label(composite, SWT.NONE);
    lbName.setText("Name:");
    txtName = new Text(composite, SWT.BORDER);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalIndent = nIdentation;
    txtName.setLayoutData(gd);

    new Label(composite, SWT.NONE);

    Label lbDescription = new Label(composite, SWT.NONE);
    lbDescription.setText("Description:");
    txtDescription = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    gd = new GridData(GridData.FILL_BOTH);
    gd.horizontalIndent = nIdentation;
    txtDescription.setLayoutData(gd);

    setControl(composite);
    addListeners();
  }
  public ClasspathTypeComposite(Composite parent, int style, IProject project) {
    super(parent, style);
    setLayout(new GridLayout(1, false));

    Label label = new Label(this, SWT.NONE);
    label.setText("Build the classpath with:");

    Composite buttons = new Composite(this, SWT.NONE);
    buttons.setLayout(new GridLayout(1, false));
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gridData.horizontalIndent = INDENT_BUTTONS;
    buttons.setLayoutData(gridData);

    selectCache = new Button(buttons, SWT.RADIO);
    selectCache.setText("Ivy's cache");

    selectRetrieve = new Button(buttons, SWT.RADIO);
    selectRetrieve.setText("retrieved artifacts");

    retrieveComposite = new RetrieveComposite(this, SWT.NONE, false, project);
    gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gridData.horizontalIndent = INDENT_RETRIEVE;
    retrieveComposite.setLayoutData(gridData);

    selectRetrieve.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            retrieveComposite.setEnabled(selectRetrieve.getSelection());
          }
        });
  }
  @Override
  public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    setControl(composite);

    composite.setLayout(LayoutUtils.createGridLayout(2, false, 10, 0));
    int space = new GridLayout().horizontalSpacing;
    GridData gridData;

    /*
     * Row 1
     */
    Label jidLabel = new Label(composite, SWT.NONE);
    gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
    jidLabel.setLayoutData(gridData);
    jidLabel.setText(Messages.jid_shortform);

    Combo jidCombo = new Combo(composite, SWT.BORDER);
    gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData.horizontalIndent = space;
    jidCombo.setLayoutData(gridData);
    this.jidCombo = new JIDCombo(jidCombo);

    /*
     * Row 2
     */
    new Label(composite, SWT.NONE);

    Label exampleLabel = new Label(composite, SWT.NONE);
    gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.horizontalIndent = space;
    exampleLabel.setLayoutData(gridData);
    exampleLabel.setText(Messages.jid_example);
    FontUtils.changeFontSizeBy(exampleLabel, -1);

    /*
     * Row 3
     */
    Label nicknameLabel = new Label(composite, SWT.NONE);
    gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
    gridData.verticalIndent = space;
    nicknameLabel.setLayoutData(gridData);
    nicknameLabel.setText(Messages.AddContactWizardPage_nickname);

    Text nicknameText = new Text(composite, SWT.BORDER);
    gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gridData.horizontalIndent = space;
    gridData.verticalIndent = space;
    nicknameText.setLayoutData(gridData);
    this.nicknameText = new EmptyText(nicknameText, Messages.AddContactWizardPage_optional);

    hookListeners();
    updatePageCompletion();
  }
  protected Control createContents(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(2, false);
    container.setLayout(gridLayout);
    GridData gridData = new GridData();
    gridData.widthHint = 200;
    container.setLayoutData(gridData);

    Label lblName = new Label(container, SWT.LEFT);
    gridData = new GridData();
    gridData.horizontalIndent = 10;
    lblName.setLayoutData(gridData);
    lblName.setText(Messages.adRolName);

    txtName = new Text(container, SWT.SINGLE | SWT.BORDER);
    gridData = new GridData();
    gridData.horizontalAlignment = GridData.END;
    gridData.grabExcessHorizontalSpace = true;
    gridData.widthHint = 75;
    txtName.setLayoutData(gridData);

    createEndptTypeComponent(container);

    createPublicPortComponent(container);

    Label lblPrivatePort = new Label(container, SWT.LEFT);
    gridData = new GridData();
    gridData.horizontalIndent = 10;
    lblPrivatePort.setLayoutData(gridData);
    lblPrivatePort.setText(Messages.adRolPrivatePort);

    txtPrivatePort = new Text(container, SWT.SINGLE | SWT.BORDER);
    gridData = new GridData();
    gridData.horizontalAlignment = GridData.END;
    gridData.grabExcessHorizontalSpace = true;
    gridData.widthHint = 75;
    txtPrivatePort.setLayoutData(gridData);

    if (isEditEndpt) {
      txtName.setText(waEndpt.getName());
      txtPrivatePort.setText(waEndpt.getPrivatePort());
      txtPublicPort.setText(waEndpt.getPort());
      comboType.setText(waEndpt.getEndPointType().toString());
      if (comboType.getText().equalsIgnoreCase(WindowsAzureEndpointType.Internal.toString())) {
        txtPublicPort.setEnabled(false);
        lblPublicPort.setEnabled(false);
        txtPublicPort.setText("");
      }
    }
    return super.createContents(parent);
  }
Exemple #5
0
  private void createControls() {
    GridLayout gLayout = new GridLayout();
    gLayout.marginHeight = 0;
    gLayout.marginWidth = 0;
    gLayout.verticalSpacing = 0;
    shell.setLayout(gLayout);
    Utils.setShellIcon(shell);

    topPanel = new Composite(shell, SWT.NONE);
    topPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    GridLayout gLayout1 = new GridLayout();
    gLayout1.marginBottom = 10;
    topPanel.setLayout(gLayout1);
    topPanel.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    topPanel.setBackgroundMode(SWT.INHERIT_FORCE);

    Label separator1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    contentPanel = new Composite(shell, SWT.NONE);
    contentPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    contentStackLayout = new StackLayout();
    contentPanel.setLayout(contentStackLayout);

    titleLabel = new Label(topPanel, SWT.NONE);
    titleLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    Utils.setFontHeight(titleLabel, 16, SWT.NORMAL);

    descriptionLabel = new Label(topPanel, SWT.WRAP);
    GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gData.horizontalIndent = 10;
    descriptionLabel.setLayoutData(gData);

    shell.layout(true, true);
  }
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    Composite inner = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 1;
    inner.setLayout(layout);

    int widthHint = convertWidthInCharsToPixels(50);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = widthHint;

    if (fExistingFolders.contains(fCurrProject)) {
      fContainerDialogField.doFillIntoGrid(inner, 2);
    } else {
      fUseProjectButton.doFillIntoGrid(inner, 1);
      fUseFolderButton.doFillIntoGrid(inner, 1);
      fContainerDialogField.getTextControl(inner);

      int horizontalIndent = convertWidthInCharsToPixels(3);
      data.horizontalIndent = horizontalIndent;
    }
    Text text = fContainerDialogField.getTextControl(null);
    text.setLayoutData(data);
    TextFieldNavigationHandler.install(text);

    fContainerDialogField.postSetFocusOnDialogField(parent.getDisplay());
    applyDialogFont(composite);
    return composite;
  }
  private void createMultiStoryControls(Composite comp) {
    btnRadioMultiStory = new Button(comp, SWT.RADIO);
    btnRadioMultiStory.setText("Run stories from project,package or source folder");
    GridData gridData = new GridData();
    gridData.horizontalSpan = 3;
    btnRadioMultiStory.setLayoutData(gridData);
    btnRadioMultiStory.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (btnRadioMultiStory.getSelection()) {
              changeStoryMode();
            }
          }
        });

    txtMultiStories = new Text(comp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
    txtMultiStories.addModifyListener(tabListener);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalIndent = 25;
    gridData.horizontalSpan = 2;
    txtMultiStories.setLayoutData(gridData);

    btnMultiStory = new Button(comp, SWT.PUSH);
    btnMultiStory.setText("Browse");
    btnMultiStory.addSelectionListener(resourceSelectionAdapter);
    setButtonGridData(btnMultiStory);
  }
  protected Control addTextField(
      Composite composite,
      String label,
      String key,
      int textLimit,
      int indentation,
      boolean isNumber) {
    Label labelControl = new Label(composite, SWT.NONE);
    labelControl.setText(label);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.horizontalIndent = indentation;
    labelControl.setLayoutData(gd);

    Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.widthHint = convertWidthInCharsToPixels(textLimit + 1);
    textControl.setLayoutData(gd);
    textControl.setTextLimit(textLimit);
    fTextFields.put(textControl, key);
    if (isNumber) {
      fNumberFields.add(textControl);
      textControl.addModifyListener(fNumberFieldListener);
    } else {
      textControl.addModifyListener(fTextFieldListener);
    }

    return textControl;
  }
Exemple #9
0
  protected Control createDialogArea(Composite parent) {

    Composite comp = (Composite) super.createDialogArea(parent);
    GridLayout layout = (GridLayout) comp.getLayout();
    layout.numColumns = 2;

    // below copied from IconandMessageDialog or something like that
    Image image = getSWTImage(SWT.ICON_ERROR);

    if (image != null) {
      imageLabel = new Label(comp, SWT.NULL);
      image.setBackground(imageLabel.getBackground());
      imageLabel.setImage(image);
      // addAccessibleListeners(imageLabel, image);
      imageLabel.setLayoutData(new GridData(GridData.GRAB_VERTICAL));
      GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
    }

    GridData data = new GridData();
    data.horizontalIndent = 4;
    Label text = new Label(comp, SWT.NULL);
    text.setLayoutData(data);
    text.setText(message);
    return comp;
  }
  private Control[] addTextField(
      Composite composite,
      String label,
      final String key,
      int textLimit,
      int indentation,
      PixelConverter pixelConverter) {
    Label labelControl = new Label(composite, SWT.NONE);
    labelControl.setText(label);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.horizontalIndent = indentation;
    labelControl.setLayoutData(gd);

    final Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.widthHint = pixelConverter.convertWidthInCharsToPixels(textLimit + 1);
    textControl.setLayoutData(gd);
    textControl.setTextLimit(textLimit);

    textControl.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            String value = textControl.getText();
            if (key != null) fStore.setValue(key, value);
          }
        });

    return new Control[] {labelControl, textControl};
  }
Exemple #11
0
  private void addDecorator(Composite parent, final Text control) {
    GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gd.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
    control.setLayoutData(gd);

    final ControlDecoration decoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT, parent);
    decoration.hide();
    control.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(ModifyEvent e) {
            String name = control.getText();
            if (name.trim().isEmpty()) {
              decoration.setImage(
                  FieldDecorationRegistry.getDefault()
                      .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR)
                      .getImage());
              decoration.setDescriptionText(
                  Messages.getString("ActionDialog.ErrEmptyName")); // $NON-NLS-1$
              decoration.show();
            } else {
              decoration.hide();
            }
            validate();
          }
        });
  }
  protected Composite createMaxOccurComp(Composite parent, FormToolkit toolkit) {
    fMaxLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_maxOccurLabel);
    fMaxLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    Composite comp = toolkit.createComposite(parent);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = layout.marginWidth = 0;
    comp.setLayout(layout);
    comp.setLayoutData(gd);

    fMaxOccurSpinner = new Spinner(comp, SWT.BORDER);
    fMaxOccurSpinner.setMinimum(1);
    fMaxOccurSpinner.setMaximum(999);
    fMaxOccurSpinner.setIncrement(1);

    fUnboundSelect =
        toolkit.createButton(comp, PDEUIMessages.AbstractSchemaDetails_unboundedButton, SWT.CHECK);
    gd = new GridData();
    gd.horizontalIndent = 10;
    fUnboundSelect.setLayoutData(gd);
    fUnboundSelect.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (blockListeners()) return;
            fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && isEditableElement());
          }
        });

    return comp;
  }
 protected Button[] createTrueFalseButtons(Composite parent, FormToolkit toolkit, int colSpan) {
   Composite comp = toolkit.createComposite(parent, SWT.NONE);
   GridLayout gl = new GridLayout(2, false);
   gl.marginHeight = gl.marginWidth = 0;
   comp.setLayout(gl);
   GridData gd = new GridData(GridData.FILL_HORIZONTAL);
   gd.horizontalSpan = colSpan;
   gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT;
   comp.setLayoutData(gd);
   Button tButton = toolkit.createButton(comp, BOOLS[0], SWT.RADIO);
   Button fButton = toolkit.createButton(comp, BOOLS[1], SWT.RADIO);
   gd = new GridData();
   gd.horizontalIndent = 20;
   fButton.setLayoutData(gd);
   return new Button[] {tButton, fButton};
 }
Exemple #14
0
  /**
   * Displays a new line containing the supplied message and a separator line if necessary.
   *
   * @param sender who composed the message
   * @param color to be used to mark the user
   * @param message composed by the sender
   * @param receivedOn the date the message was received
   */
  public void addChatLine(Object sender, Color color, String message, Date receivedOn) {
    /*
     * Sender line
     */
    if (lastUser != null && lastUser.equals(sender)) { // same user
      ChatLineSeparator chatLineSeparator =
          new ChatLineSeparator(contentComposite, sender.toString(), color, receivedOn);
      chatLineSeparator.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    } else { // new / different user
      ChatLinePartnerChangeSeparator chatPartnerChangeLine =
          new ChatLinePartnerChangeSeparator(
              contentComposite, sender.toString(), color, receivedOn);
      chatPartnerChangeLine.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    }

    /*
     * Message line
     */
    ChatLine chatLine = new ChatLine(contentComposite, message);
    GridData chatLineGridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    chatLineGridData.horizontalIndent = SimpleRoundedComposite.MARGIN_WIDTH;
    chatLine.setLayoutData(chatLineGridData);

    /*
     * Reposition the clear option to the end
     */
    this.createOptionComposite();

    this.refresh();

    lastUser = sender;
  }
    private void addUpdateQualifiedNameComponent(Composite parent, int marginWidth) {
      final JavaMoveProcessor processor = getJavaMoveProcessor();
      if (!processor.canEnableQualifiedNameUpdating() || !processor.canUpdateQualifiedNames())
        return;
      fQualifiedNameCheckbox = new Button(parent, SWT.CHECK);
      int indent = marginWidth + fQualifiedNameCheckbox.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
      fQualifiedNameCheckbox.setText(
          RefactoringMessages.RenameInputWizardPage_update_qualified_names);
      fQualifiedNameCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      fQualifiedNameCheckbox.setSelection(processor.getUpdateQualifiedNames());

      fQualifiedNameComponent =
          new QualifiedNameComponent(parent, SWT.NONE, processor, getRefactoringSettings());
      fQualifiedNameComponent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      GridData gd = (GridData) fQualifiedNameComponent.getLayoutData();
      gd.horizontalAlignment = GridData.FILL;
      gd.horizontalIndent = indent;
      updateQualifiedNameUpdating(processor, processor.getUpdateQualifiedNames());

      fQualifiedNameCheckbox.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              boolean enabled = ((Button) e.widget).getSelection();
              updateQualifiedNameUpdating(processor, enabled);
            }
          });
      fQualifiedNameCheckbox.setSelection(
          getRefactoringSettings().getBoolean(UPDATE_QUALIFIED_NAMES));
      updateQualifiedNameUpdating(processor, fQualifiedNameCheckbox.getSelection());
    }
  @Override
  public void createUI(FormToolkit formToolkit) {
    super.createUI(formToolkit);
    GridBuilder widgetBuilder = new GridBuilder(formToolkit, getClientComposite(), 3);
    picker.setState(EControlState.MANDATORY, true);
    Composite composite = getClientComposite();
    GridLayout gl = (GridLayout) composite.getLayout();
    gl.marginWidth = 0;
    gl.marginHeight = 0;
    gl.marginTop = 0;
    gl.marginBottom = 0;
    composite.setLayout(gl);

    GridData gd = (GridData) composite.getLayoutData();
    if (gd == null) gd = GridLayoutFactory.createDefaultLayoutData();
    // calculate horizontal indent for the first widget. take care of the margin width of the grid
    // layout
    // if margin width is greater than indent -> set indent to 0
    //        gd.horizontalIndent = GridLayoutFactory.INDENT_FOR_DECORATORS < gl.marginWidth ? 0 :
    // GridLayoutFactory.INDENT_FOR_DECORATORS - gl.marginWidth;
    gd.horizontalIndent = 0;
    composite.setLayoutData(gd);
    widgetBuilder.add(picker);
    picker.getText().getRCPHyperlink().setVisible(false);
  }
  private void createLabel(Composite c, int span, String content, Image image, LabelAttributes la) {
    if (content == null && image == null) return;

    Label l = new Label(c, la.getFontStyle());
    GridData gd = new GridData();
    gd.verticalSpan = span;
    gd.horizontalIndent = 5;
    if (content != null) l.setText(content);

    if (image != null) l.setImage(image);
    if (la.getForegroundColor() != null)
      l.setForeground(new Color(DisplayManager.getDefaultDisplay(), la.getForegroundColor()));

    Font initialFont = l.getFont();
    FontData[] fontData = initialFont.getFontData();
    for (int i = 0; i < fontData.length; i++) {
      fontData[i].setHeight(la.getFontSize());
      fontData[i].setStyle(la.getFontStyle());
    }
    Font newFont = new Font(DisplayManager.getDefaultDisplay(), fontData[0]);
    l.setFont(newFont);
    l.pack();

    l.setBackground(c.getBackground());
    l.setLayoutData(gd);
  }
  protected Control addColorButton(Composite parent, String label, String key, int indentation) {

    Composite composite = new Composite(parent, SWT.NONE);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    composite.setLayoutData(gd);

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    composite.setLayout(layout);

    Label labelControl = new Label(composite, SWT.NONE);
    labelControl.setText(label);

    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalIndent = indentation;
    labelControl.setLayoutData(gd);

    ColorSelector editor = new ColorSelector(composite);
    Button button = editor.getButton();
    button.setData(editor);

    gd = new GridData();
    gd.horizontalAlignment = GridData.END;
    button.setLayoutData(gd);
    button.addSelectionListener(fColorButtonListener);

    fColorButtons.put(editor, key);

    return composite;
  }
  private void createSingleStoryControls(Composite comp) {

    btnRadioSingleStory = new Button(comp, SWT.RADIO);
    btnRadioSingleStory.setText("Run a single story");
    GridData gridData = new GridData();
    gridData.horizontalSpan = 3;
    btnRadioSingleStory.setLayoutData(gridData);
    btnRadioSingleStory.setSelection(true);
    btnRadioSingleStory.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (btnRadioSingleStory.getSelection()) {
              changeStoryMode();
            }
          }
        });

    lblProj = new Label(comp, SWT.NONE);
    lblProj.setText("Project:");
    gridData = new GridData();
    gridData.horizontalIndent = 25;
    lblProj.setLayoutData(gridData);

    txtProject = new Text(comp, SWT.SINGLE | SWT.BORDER);
    txtProject.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    txtProject.addModifyListener(tabListener);

    btnProject = new Button(comp, SWT.PUSH);
    btnProject.setText("Browse");
    btnProject.addSelectionListener(projectSelectionListener);
    setButtonGridData(btnProject);

    lblStory = new Label(comp, SWT.NONE);
    lblStory.setText("Story:");
    gridData = new GridData();
    gridData.horizontalIndent = 25;
    lblStory.setLayoutData(gridData);

    txtStory = new Text(comp, SWT.SINGLE | SWT.BORDER);
    txtStory.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    txtStory.addModifyListener(tabListener);

    btnStory = new Button(comp, SWT.PUSH);
    btnStory.setText("Browse");
    setButtonGridData(btnStory);
    btnStory.addSelectionListener(storySelectionAdapter);
  }
  /**
   * Creates an endpoint type component consisting of label and combo box. Also adds a selection
   * listener to combo box.
   *
   * @param container
   */
  private void createEndptTypeComponent(Composite container) {
    Label lblType = new Label(container, SWT.LEFT);
    GridData gridData = new GridData();
    gridData.horizontalIndent = 10;
    lblType.setLayoutData(gridData);
    lblType.setText(Messages.adRolType);

    comboType = new Combo(container, SWT.READ_ONLY);
    gridData = new GridData();
    gridData.horizontalAlignment = GridData.END;
    gridData.grabExcessHorizontalSpace = true;
    gridData.widthHint = 60;
    comboType.setLayoutData(gridData);
    comboType.setItems(arrType);
    comboType.setText(arrType[0]);

    final Combo comboTemp = comboType;

    comboType.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent event) {
            if (comboTemp
                .getText()
                .equalsIgnoreCase(WindowsAzureEndpointType.Internal.toString())) {
              txtPublicPort.setText("");
              txtPublicPort.setEnabled(false);
              lblPublicPort.setEnabled(false);
            } else if (comboTemp
                .getText()
                .equalsIgnoreCase(WindowsAzureEndpointType.Input.toString())) {
              txtPublicPort.setEnabled(true);
              lblPublicPort.setEnabled(true);
              String port = txtPublicPort.getText();
              if (port.contains("-")) {
                txtPublicPort.setText(port.split("-")[0]);
              } else {
                try {
                  Integer.parseInt(port);
                } catch (Exception e) {
                  port = txtPrivatePort.getText();
                }
                txtPublicPort.setText(port);
              }
            } else {
              txtPublicPort.setEnabled(true);
              lblPublicPort.setEnabled(true);
              if (!txtPublicPort.getText().isEmpty() && txtPrivatePort.getText().isEmpty()) {
                if (!txtPublicPort.getText().contains("-")) {
                  txtPublicPort.setText(
                      txtPublicPort.getText().concat("-").concat(txtPublicPort.getText()));
                }
                txtPrivatePort.setText(txtPublicPort.getText().split("-")[0]);
              } else if (txtPublicPort.getText().isEmpty()) {
                txtPublicPort.setText(txtPrivatePort.getText());
              }
            }
          }
        });
  }
    /*
     * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
     */
    public void createControl(Composite parent) {
      Composite composite = new Composite(parent, SWT.NONE);
      final GridLayout layout = new GridLayout();
      composite.setLayout(layout);
      initializeDialogUnits(composite);

      try {
        createHeadControls(composite);

        createParameterExceptionsFolder(composite);
        fLeaveDelegateCheckBox =
            DelegateUIHelper.generateLeaveDelegateCheckbox(composite, getRefactoring(), false);
        if (fLeaveDelegateCheckBox != null) {
          fDeprecateDelegateCheckBox = new Button(composite, SWT.CHECK);
          GridData data = new GridData();
          data.horizontalAlignment = GridData.FILL;
          data.horizontalIndent =
              (layout.marginWidth
                  + fDeprecateDelegateCheckBox.computeSize(SWT.DEFAULT, SWT.DEFAULT).x);
          data.horizontalSpan = 2;
          fDeprecateDelegateCheckBox.setLayoutData(data);
          fDeprecateDelegateCheckBox.setText(DelegateUIHelper.getDeprecateDelegateCheckBoxTitle());
          final ChangeSignatureProcessor processor = getChangeMethodSignatureProcessor();
          fDeprecateDelegateCheckBox.setSelection(
              DelegateUIHelper.loadDeprecateDelegateSetting(processor));
          processor.setDeprecateDelegates(fDeprecateDelegateCheckBox.getSelection());
          fDeprecateDelegateCheckBox.addSelectionListener(
              new SelectionAdapter() {
                @Override
                public void widgetSelected(SelectionEvent e) {
                  processor.setDeprecateDelegates(fDeprecateDelegateCheckBox.getSelection());
                }
              });
          fDeprecateDelegateCheckBox.setEnabled(fLeaveDelegateCheckBox.getSelection());
          fLeaveDelegateCheckBox.addSelectionListener(
              new SelectionAdapter() {
                @Override
                public void widgetSelected(SelectionEvent e) {
                  fDeprecateDelegateCheckBox.setEnabled(fLeaveDelegateCheckBox.getSelection());
                }
              });
        }
        Label sep = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
        sep.setLayoutData((new GridData(GridData.FILL_HORIZONTAL)));
        createSignaturePreview(composite);

        update(false);
        setControl(composite);
        Dialog.applyDialogFont(composite);
      } catch (JavaModelException e) {
        ExceptionHandler.handle(
            e,
            RefactoringMessages.ChangeSignatureInputPage_Change_Signature,
            RefactoringMessages.ChangeSignatureInputPage_Internal_Error);
      }
      PlatformUI.getWorkbench()
          .getHelpSystem()
          .setHelp(composite, IJavaHelpContextIds.MODIFY_PARAMETERS_WIZARD_PAGE);
    }
 protected Label createLabel(Composite group, String text) {
   Label label = new Label(group, SWT.NONE);
   label.setText(text);
   GridData gd = new GridData();
   gd.horizontalIndent = 15;
   label.setLayoutData(gd);
   return label;
 }
 private void createLabel(FormToolkit toolkit, Composite composite, String label) {
   Label portLabel = toolkit.createLabel(composite, label);
   portLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.horizontalIndent = 20;
   data.widthHint = 20;
   portLabel.setLayoutData(data);
 }
 private Label createLabel(Composite parent, FormToolkit toolkit, Color color, String labelName) {
   Label label = toolkit.createLabel(parent, labelName);
   label.setForeground(color);
   GridData gd = new GridData();
   gd.horizontalIndent = 10;
   label.setLayoutData(gd);
   return label;
 }
 private void createUILabelPassword() {
   // Create the label
   Label label = new Label(fCompositeLogin, SWT.NONE);
   label.setText("&Mot de passe :"); // $NON-NLS-1$
   // Configure layout data
   GridData data = new GridData();
   data.horizontalIndent = F_LABEL_HORIZONTAL_INDENT;
   label.setLayoutData(data);
 }
 private void createUILabelUserName() {
   // Create the label
   Label label = new Label(fCompositeLogin, SWT.NONE);
   label.setText(Messages.InteractiveSplashHandler_5); // NON-NLS-1
   // Configure layout data
   GridData data = new GridData();
   data.horizontalIndent = F_LABEL_HORIZONTAL_INDENT;
   label.setLayoutData(data);
 }
 private void createCSSProfileContents(Composite parent) {
   // CSS Profile
   Label languageLabel = new Label(parent, SWT.NONE);
   languageLabel.setText(HTMLUIMessages.UI_CSS_profile___2);
   fProfileCombo = new Combo(parent, SWT.READ_ONLY);
   GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
   data.horizontalIndent = 0;
   fProfileCombo.setLayoutData(data);
 }
 /** build icon cell */
 protected void buildIconCell() {
   Image icon = Display.getCurrent().getSystemImage(SWT.ICON_INFORMATION);
   this.iconLabel = new Label(this.dialog, SWT.NONE);
   this.iconLabel.setImage(icon);
   GridData grdData = new GridData();
   grdData.horizontalIndent = DEFAULT_INDENT;
   grdData.verticalIndent = DEFAULT_INDENT;
   this.iconLabel.setLayoutData(grdData);
 }
 private void createUILabelUserName() {
   // Create the label
   Label label = new Label(fCompositeLogin, SWT.NONE);
   label.setText("&Nom d'utilisateur :"); // $NON-NLS-1$
   // Configure layout data
   GridData data = new GridData();
   data.horizontalIndent = F_LABEL_HORIZONTAL_INDENT;
   label.setLayoutData(data);
 }
 private void createAllLocalesCheckbox(Composite container) {
   fAllLocalesCheckbox = new Button(container, SWT.CHECK);
   GridData bLayout = new GridData();
   bLayout.horizontalIndent = 6;
   bLayout.horizontalSpan = 3;
   fAllLocalesCheckbox.setLayoutData(bLayout);
   fAllLocalesCheckbox.setText(Messages.getString("BuildToolWizardLocalePage_AllLocaleCheckbox"));
   fAllLocalesCheckbox.addSelectionListener(new AllLocalesCheckboxSelectionListener());
   fAllLocalesCheckbox.setSelection(getDialogSettings().getBoolean(ALL_LOCALES));
 }