/** @param form2 */
  private Composite getPageHeader(Composite parent) {
    final Composite header = new Composite(parent, SWT.FILL);
    final FormLayout layout = new FormLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 5;
    header.setLayout(layout);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(header);

    header.setBackground(parent.getBackground());

    final Label titleImage = new Label(header, SWT.FILL);
    final ImageDescriptor imageDescriptor =
        ImageDescriptor.createFromURL(
            Activator.getDefault().getBundle().getResource("icons/view.png")); // $NON-NLS-1$
    titleImage.setImage(new Image(parent.getDisplay(), imageDescriptor.getImageData()));
    final FormData titleImageData = new FormData();
    final int imageOffset = -titleImage.computeSize(SWT.DEFAULT, SWT.DEFAULT).y / 2;
    titleImageData.top = new FormAttachment(50, imageOffset);
    titleImageData.left = new FormAttachment(0, 10);
    titleImage.setLayoutData(titleImageData);

    final Label title = new Label(header, SWT.WRAP);
    title.setText("View Editor"); // $NON-NLS-1$
    titleFont = new Font(title.getDisplay(), getDefaultFontName(title), 12, SWT.BOLD);
    title.setFont(titleFont);
    title.setForeground(getTitleColor(parent));
    final FormData titleData = new FormData();
    title.setLayoutData(titleData);
    titleData.left = new FormAttachment(titleImage, 5, SWT.DEFAULT);

    return header;
  }
示例#2
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);
  }
  /** @param parent parent of this Combo */
  private void createShortCutsArea(Composite parent) {
    InputCodeHelper keys = InputCodeHelper.getInstance();

    Composite composite = new Composite(parent, SWT.NONE);
    compositeGridData(composite, NUM_COLUMNS);

    Label label = new Label(composite, SWT.NONE);
    label.setText(Messages.ObjectMappingPreferencePageCollectShortcut);
    label.setFont(LayoutUtil.BOLD_TAHOMA);
    GridData data2 = new GridData();
    data2.horizontalSpan = 4;
    label.setLayoutData(data2);

    label = new Label(composite, SWT.NONE);
    m_mappingModifier = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
    m_mappingModifier.setItems(keys.getModifierString());
    label = new Label(composite, SWT.NONE);
    label.setText(" + "); // $NON-NLS-1$
    m_mappingKey = InputComboUtil.createInputCombo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);

    label = new Label(composite, SWT.NONE);
    label.setText(Messages.ObjectMappingPreferencePageCollectWithParentsShortcut);
    label.setFont(LayoutUtil.BOLD_TAHOMA);
    label.setLayoutData(data2);

    label = new Label(composite, SWT.NONE);
    m_mappingWithParentsModifier = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
    m_mappingWithParentsModifier.setItems(keys.getModifierString());
    label = new Label(composite, SWT.NONE);
    label.setText(" + "); // $NON-NLS-1$
    m_mappingWithParentsKey =
        InputComboUtil.createInputCombo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
  }
示例#4
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);

    GridLayout layout = new GridLayout(1, false);
    layout.marginRight = 5;
    layout.marginLeft = 10;
    container.setLayout(layout);

    setTitle(messages.getString("IADialog_0"));
    setMessage(messages.getString("IADialog_1"), IMessageProvider.INFORMATION);

    for (int i = 0; i < productDescr.size() - 1; i = i + 2) {

      final Label lblProduct = new Label(container, SWT.WRAP);
      final Label lblAction = new Label(container, SWT.WRAP);

      final GridData data = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1);
      lblProduct.setLayoutData(data);
      lblProduct.setText(productDescr.get(i));

      lblAction.setLayoutData(data);
      lblAction.setText("   " + productDescr.get(i + 1)); // $NON-NLS-1$
    }

    return container;
  }
  /*
   * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createButtonBar(Composite parent) {
    GridLayout layout = new GridLayout(1, false);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);

    Composite buttonBar = new Composite(parent, SWT.NONE);
    buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    buttonBar.setLayout(layout);

    /* Info Container */
    Composite infoContainer = new Composite(buttonBar, SWT.None);
    infoContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    infoContainer.setLayout(LayoutUtils.createGridLayout(2, 0, 0));
    ((GridLayout) infoContainer.getLayout()).marginRight = 10;

    Label infoImg = new Label(infoContainer, SWT.NONE);
    infoImg.setImage(OwlUI.getImage(fResources, "icons/obj16/info.gif")); // $NON-NLS-1$
    infoImg.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));

    Label infoText = new Label(infoContainer, SWT.WRAP);
    infoText.setText(Messages.CustomizeToolbarDialog_USE_MOUSE_INFO);
    infoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    applyDialogFont(infoContainer);

    /* Create Ok / Cancel Buttons */
    createButtonsForButtonBar(buttonBar);

    return buttonBar;
  }
示例#6
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;
  }
  /*
   * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
   */
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    Label label = new Label(composite, SWT.LEFT);
    label.setText(fInstruction);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fResourceGroup =
        new SelectResourcesBlock(
            composite,
            ResourcesPlugin.getWorkspace().getRoot(),
            getResourceProvider(IResource.FOLDER | IResource.PROJECT),
            WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(),
            getResourceProvider(IResource.FILE),
            WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider(),
            SWT.NONE,
            useHeightHint(parent));
    fResourceGroup.addCheckStateListener(
        new ICheckStateListener() {
          public void checkStateChanged(CheckStateChangedEvent event) {
            updateSelectionCount();
          }
        });

    fCountIndication = new Label(composite, SWT.LEFT);
    fCountIndication.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    createSelectionButtonGroup(composite);

    setInitialSelection();
    return composite;
  }
示例#8
0
  @Override
  public void createControl(Composite parent) {

    Composite cmpFirstPage = new Composite(parent, SWT.NONE);
    cmpFirstPage.setLayout(new GridLayout(2, true));

    Label label = new Label(cmpFirstPage, SWT.CENTER);
    label.setText("Please connect your device");
    label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

    Button btnConnect = new Button(cmpFirstPage, SWT.CENTER);
    btnConnect.setText("Connect Device");
    GridData gd_btnConnect = new GridData(SWT.CENTER, SWT.FILL, false, false, 2, 1);
    gd_btnConnect.heightHint = 100;
    btnConnect.setLayoutData(gd_btnConnect);
    btnConnect.addSelectionListener(
        new SelectionListener() {

          @Override
          public void widgetSelected(SelectionEvent arg0) {
            Connect(devicetemplate);
          }

          @Override
          public void widgetDefaultSelected(SelectionEvent arg0) {
            // TODO Auto-generated method stub

          }
        });

    new Label(cmpFirstPage, SWT.NONE);
    lblStatus = new Label(cmpFirstPage, SWT.CENTER);
    lblStatus.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    setControl(cmpFirstPage);
  }
  public void createControl(Composite parent) {
    final Composite container = new Composite(parent, SWT.NULL);
    final GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 3;
    layout.verticalSpacing = 9;
    final Label label = new Label(container, SWT.NULL);
    label.setText("&Target model:");

    uriText = new Text(container, SWT.BORDER | SWT.SINGLE);
    final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    uriText.setLayoutData(gd);
    // uriText.setEditable(false);
    uriText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            dialogChanged();
          }
        });

    final Button button = new Button(container, SWT.PUSH);
    button.setText("B&rowse...");
    button.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            handleBrowse();
          }
        });

    final GridData gd1 = new GridData(GridData.FILL_HORIZONTAL);
    gd1.horizontalSpan = 3;
    final Label infoLabel = new Label(container, SWT.NULL);
    infoLabel.setLayoutData(gd1);
    infoLabel.setText("Contents of the selected resource:");
    final GridData gd2 =
        new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
    gd2.horizontalSpan = 3;
    gd2.grabExcessHorizontalSpace = true;
    gd2.grabExcessVerticalSpace = true;

    viewer = new TreeViewer(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    viewer.getTree().setLayoutData(gd2);
    viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
    viewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    viewer.addSelectionChangedListener(this);

    final GridData gd3 = new GridData(GridData.FILL_HORIZONTAL);
    gd3.horizontalSpan = 3;
    final Label hintLabel = new Label(container, SWT.WRAP);
    hintLabel.setLayoutData(gd3);
    hintLabel.setText(
        "Hint: You may also select a sub-model that contains ALL RELEVANT ELEMENTS for "
            + MPatchConstants.MPATCH_SHORT_NAME
            + " application (improves performance).");

    initialize();
    dialogChanged();
    setControl(container);
  }
  public void createButtonPanel(Shell dialog) {
    Composite buttonPanel = new Composite(dialog, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
    buttonPanel.setLayoutData(gridData);
    buttonPanel.setLayout(new GridLayout(4, false));

    String buttonAlign =
        System.getProperty("org.pentaho.di.buttonPosition", "right")
            .toLowerCase(); //$NON-NLS-1$ //$NON-NLS-2$

    if (!"left".equals(buttonAlign)) { // $NON-NLS-1$
      Label emptyLabel = new Label(buttonPanel, SWT.NONE);
      gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
      emptyLabel.setLayoutData(gridData);
    }
    okButton = new Button(buttonPanel, SWT.PUSH);
    okButton.setText(Messages.getString("VfsFileChooserDialog.ok")); // $NON-NLS-1$
    gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.widthHint = 90;
    okButton.setLayoutData(gridData);
    okButton.addSelectionListener(this);
    cancelButton = new Button(buttonPanel, SWT.PUSH);
    cancelButton.setText(Messages.getString("VfsFileChooserDialog.cancel")); // $NON-NLS-1$
    cancelButton.addSelectionListener(this);
    gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.widthHint = 90;
    cancelButton.setLayoutData(gridData);
    if ("center".equals(buttonAlign)) { // $NON-NLS-1$
      Label emptyLabel = new Label(buttonPanel, SWT.NONE);
      gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
      emptyLabel.setLayoutData(gridData);
    }
  }
示例#11
0
  /**
   * Creates and returns the content of the information area.
   *
   * @param composite The parent composite to contain the information area
   */
  private Composite createInfoArea(Composite composite) {
    Group group = new Group(composite, SWT.CENTER);
    group.setText("Info");
    GridLayout layout = new GridLayout(2, false);
    group.setLayout(layout);

    Label dateLabel = new Label(group, SWT.LEFT);
    dateLabel.setText("Date");
    GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    dateLabel.setLayoutData(gd);
    dateText = new Text(group, SWT.SINGLE | SWT.BORDER);
    final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    final TimeZone local = TimeZone.getDefault();
    sdf.setTimeZone(local);
    // new Date() gets current date/elapsedTime
    final String dateString = sdf.format(new Date());
    dateText.setText(dateString);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    dateText.setLayoutData(gd);

    Label authorLabel = new Label(group, SWT.LEFT);
    authorLabel.setText("Author");
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    authorLabel.setLayoutData(gd);
    authorText = new Text(group, SWT.SINGLE | SWT.BORDER);
    // should look in preferences...
    authorText.setText(
        Activator.getDefault()
            .getPreferenceStore()
            .getString(ProfileDefinitionPreferenceConstants.PREF_AUTHOR_NAME));
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    authorText.setLayoutData(gd);

    return group;
  }
示例#12
0
  /** Creates the widgets in the "child" group. */
  void createChildWidgets() {
    /* Add common controls */
    super.createChildWidgets();

    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;

    Label lblAverage = new Label(childGroup, SWT.NONE);
    lblAverage.setText("Average");
    lblAverage.setLayoutData(gridData);
    avgText = new Text(childGroup, SWT.BORDER);
    avgText.setEditable(false);
    avgText.setLayoutData(gridData);

    Label lblVariant = new Label(childGroup, SWT.NONE);
    lblVariant.setText("Variant");
    lblVariant.setLayoutData(gridData);
    variantText = new Text(childGroup, SWT.BORDER);
    variantText.setEditable(false);
    variantText.setLayoutData(gridData);

    Label lblMax = new Label(childGroup, SWT.NONE);
    lblMax.setText("Max");
    lblMax.setLayoutData(gridData);
    maxText = new Text(childGroup, SWT.BORDER);
    maxText.setEditable(false);
    maxText.setLayoutData(gridData);

    Label lblMin = new Label(childGroup, SWT.NONE);
    lblMin.setText("Min");
    lblMin.setLayoutData(gridData);
    minText = new Text(childGroup, SWT.BORDER);
    minText.setEditable(false);
    minText.setLayoutData(gridData);
  }
  public void build() {
    getParent().setLayout(new FormLayout());

    Label leftLabel = new Label(getParent(), SWT.NONE);
    leftLabel.setImage(left);
    FormData fdLeftLabel = new FormData();
    leftLabel.setLayoutData(fdLeftLabel);
    fdLeftLabel.left = new FormAttachment(0, 0);
    fdLeftLabel.top = new FormAttachment(0, 0);
    fdLeftLabel.width = left.getBounds().width;
    fdLeftLabel.height = left.getBounds().height;

    Label rightLabel = new Label(getParent(), SWT.NONE);
    rightLabel.setImage(right);
    FormData fdRightLabel = new FormData();
    rightLabel.setLayoutData(fdRightLabel);
    fdRightLabel.right = new FormAttachment(100, 0);
    fdRightLabel.top = new FormAttachment(0, 0);
    fdRightLabel.height = right.getBounds().height;
    fdRightLabel.width = right.getBounds().width;

    footerCenter = new Composite(getParent(), SWT.NONE);
    footerCenter.setBackgroundImage(bg);
    FormData fdFooterCenter = new FormData();
    footerCenter.setLayoutData(fdFooterCenter);
    fdFooterCenter.left = new FormAttachment(leftLabel);
    fdFooterCenter.right = new FormAttachment(rightLabel);
    fdFooterCenter.top = new FormAttachment(0, 0);
    fdFooterCenter.height = bg.getBounds().height;
  }
示例#14
0
  private void createControls() {
    Display display = UIUtils.getDisplay();

    if (tipShell != null) {
      return;
    }

    tipShell = new Shell(display, SWT.ON_TOP | SWT.TOOL);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.marginWidth = 2;
    gridLayout.marginHeight = 2;
    tipShell.setLayout(gridLayout);

    tipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    tipLabelImage = new Label(tipShell, SWT.NONE);
    tipLabelImage.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    tipLabelImage.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    tipLabelImage.setLayoutData(
        new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));

    tipLabelText = new Label(tipShell, SWT.NONE);
    tipLabelText.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    tipLabelText.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    tipLabelText.setLayoutData(
        new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
  }
  /**
   * Creates and returns the contents of the upper part of the dialog (above the button bar).
   *
   * <p>Subclasses should override.
   *
   * @param ancestor the parent composite to contain the dialog area
   * @return the dialog area control
   */
  protected Control createDialogArea(Composite ancestor) {
    Composite composite = (Composite) super.createDialogArea(ancestor);

    Label comment = new Label(composite, SWT.NONE);
    comment.setText(XMLCompareMessages.XMLCompareEditCopyIdMapDialog_comment);
    GridData data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.BEGINNING;
    comment.setLayoutData(data);

    Composite inner = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    inner.setLayout(layout);
    inner.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label label = new Label(inner, SWT.NULL);
    label.setText(XMLCompareMessages.XMLCompareEditCopyIdMapDialog_label);
    label.setLayoutData(new GridData());

    fIdMapText = new Text(inner, SWT.BORDER);
    fIdMapText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fIdMapText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            doValidation();
          }
        });

    fIdMapText.setFocus();

    return composite;
  }
  /**
   * This sets the layout of the UI elements in the viewer.
   *
   * @param isMultiline
   */
  private void setLayout(boolean isMultiline) {
    if (isMultiline) {
      MigLayout layout = new MigLayout("insets 0", "[][][][][][][grow]", "[grow][]");
      control.setLayout(layout);

      text.setLayoutData("span,grow,width 200:100%:100%,height 60:100%:100%");
      setPreferredTextSize(40, 5);

      lblAttribute.setLayoutData("cell 0 1,alignx trailing,gapx related");
      attribute.setLayoutData("cell 1 1,wmin 60,alignx left,gapx rel");

      lblOperation.setLayoutData("cell 2 1,alignx trailing,gapx related");
      operation.setLayoutData("cell 3 1,wmin 60,alignx left,gapx rel");

      lblValue.setLayoutData("cell 4 1,alignx trailing,gapx related");
      value.setLayoutData("cell 5 1,wmin 60,alignx left,gapx related");

      insert.setLayoutData("cell 6 1,alignx left,gapx unrel");
    } else {
      control.setLayout(new MigLayout("insets 0, flowx", "", ""));

      text.setLayoutData("grow,width 200:70%:100%, gap unrelated");
      attribute.setLayoutData("width 90:20%:100%, gap related");
      operation.setLayoutData("width 60:10%:100%, gap related");
      value.setLayoutData("width 60:10%:100%, gap related");
      insert.setLayoutData("gap related");
    }
  }
示例#17
0
  public TagItem(Composite parent, int style, int index, Tag tag, TagPanel parentTagPanel) {
    super(parent, style);
    this.tag = tag;
    this.index = index;
    this.parentTagPanel = parentTagPanel;
    FormLayout layout = new FormLayout();
    setLayout(layout);
    imageLabel = new Label(this, SWT.None);
    imageLabel.setImage(image);
    FormData data = new FormData();
    data.left = new FormAttachment(0, 15);
    imageLabel.setLayoutData(data);
    textLabel = new Label(this, SWT.None);
    textLabel.setText(tag.getName());
    int rgb[] = ColorMap.get().getRGB(tag.getColorName());
    if (rgb == null) {
      rgb = ColorMap.get().getRGB("Black");
    }
    unselectedBackground = getBackground();
    textLabel.setForeground(new Color(getDisplay(), rgb[0], rgb[1], rgb[2]));
    data = new FormData();
    data.left = new FormAttachment(imageLabel, 5);
    data.top = new FormAttachment(imageLabel, 0, SWT.CENTER);
    data.right = new FormAttachment(100, 0);
    textLabel.setLayoutData(data);

    imageLabel.addMouseListener(this);
    textLabel.addMouseListener(this);
    addMouseListener(this);
  }
示例#18
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createContents(Composite parent) {
    Composite content = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(2, false);
    gridLayout.marginWidth = gridLayout.marginHeight = 0;
    content.setLayout(gridLayout);
    initializeDialogUnits(content);

    Label label = new Label(content, SWT.NONE);
    label.setText("Name:");
    name = new Text(content, SWT.BORDER);
    name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    label = new Label(content, SWT.NONE);
    label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

    label = new Label(content, SWT.NONE);
    label.setText("Target repository:");
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    repository = new ComboViewer(content, SWT.READ_ONLY);
    repository.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    repository.setLabelProvider(new LabelProvider());
    repository.setContentProvider(new ArrayContentProvider());
    repository.setSorter(new ViewerSorter());
    repository.setInput(getRepositoryService().getRepositories());
    repository.setSelection(new StructuredSelection(getRepositoryService().getRepository("local")));

    performDefaults();
    name.addModifyListener(modifyListener);

    return content;
  }
  @Override
  protected Control createDialogArea(Composite parent) {
    getShell().setText("Sign Log Entries");
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) container.getLayout();
    gridLayout.marginWidth = 2;
    gridLayout.marginHeight = 2;
    errorBar = new ErrorBar(container, SWT.NONE);
    errorBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));

    container.setLayout(new GridLayout(2, false));
    lblUsername = new Label(container, SWT.NONE);
    lblUsername.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblUsername.setText("User Name:");

    username = new Text(container, SWT.BORDER);
    username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    lblPassword = new Label(container, SWT.NONE);
    lblPassword.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblPassword.setText("Password:");

    password = new Text(container, SWT.BORDER | SWT.PASSWORD);
    password.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    return container;
  }
  protected Control createDialogArea(Composite parent) {
    Composite comp;
    Composite subComp;
    ValidationHandler validationHandler;
    Label label;

    comp = (Composite) super.createDialogArea(parent);
    subComp = new Composite(comp, SWT.NONE);
    subComp.setLayout(new GridLayout(1, false));
    validationHandler = new ValidationHandler();

    // Create pool group.
    createPoolGroup(subComp, validationHandler);

    // Create vertical spacer.
    label = new Label(subComp, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Create tab folder.
    tabFolder = new TabFolder(subComp, SWT.NONE);
    tabFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    createSignalTab(tabFolder, validationHandler);
    createStackTab(tabFolder, validationHandler);

    // Create error message label.
    errorMessageLabel = new CLabel(subComp, SWT.NONE);
    errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Create separator line.
    label = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    applyDialogFont(comp);
    return comp;
  }
  /**
   * Creates and returns the contents of the upper part of this dialog (above the button bar).
   *
   * @param parent the parent composite to contain the dialog area
   * @return the dialog area control
   */
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    final GridLayout gridLayout = new GridLayout();
    final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    gridLayout.numColumns = 2;
    container.setLayout(gridLayout);
    container.setLayoutData(gridData);

    final Label dialogLabel = new Label(container, SWT.NONE);
    dialogLabel.setLayoutData(
        new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    dialogLabel.setText(
        "Please, enter the required information:                                       ");

    // *************************************************************
    // Macro Questions
    for (int i = 0; i < questions.length; i++) {

      final Label macroQuestionLabel = new Label(container, SWT.RESIZE | SWT.NONE);
      macroQuestionLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
      macroQuestionLabel.setText(questions[i]);

      Text fieldText = new Text(container, SWT.BORDER);
      macroQuestionField[i] = fieldText;
      macroQuestionField[i].setLayoutData(
          new GridData(GridData.FILL, GridData.CENTER, true, false));
    }

    // **************************************************************
    // Setup listeners for the fields
    setupListeners();

    return container;
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createLinkControl(messageComposite);

    int indent = convertWidthInCharsToPixels(3);

    fNotSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null), indent);

    fSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null), indent);

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    final Label imageLabel1 = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    imageLabel1.setImage(image);
    imageLabel1.setLayoutData(
        new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    final Label label = new Label(warningComposite, SWT.WRAP);
    label.setText(DialogsMessages.SortMembersMessageDialog_sort_warning_label);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(gridData);
    label.setFont(warningComposite.getFont());

    fNotSortAllRadio.setDialogFieldListener(
        new IDialogFieldListener() {
          public void dialogFieldChanged(DialogField field) {
            imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
            label.setEnabled(!fNotSortAllRadio.isSelected());
          }
        });
    imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
    label.setEnabled(!fNotSortAllRadio.isSelected());

    return messageComposite;
  }
  public void createControl(Composite parent) {
    // TODO Auto-generated method stub
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setFont(parent.getFont());

    initializeDialogUnits(parent);

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.verticalSpacing = 10;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label label = new Label(composite, SWT.NONE);
    label.setText("Name:");
    label.setLayoutData(new GridData());

    fName = new Text(composite, SWT.BORDER);
    fName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fName.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            updatefield(FIELD_NAME);
          }
        });

    label = new Label(composite, SWT.NONE);
    label.setText("Vendor:");
    label.setLayoutData(new GridData());

    fVendor = new Text(composite, SWT.BORDER);
    fVendor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fVendor.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            updatefield(FIELD_VENDOR);
          }
        });

    label = new Label(composite, SWT.NONE);
    label.setText("Description:");
    label.setLayoutData(new GridData());

    fDesc = new Text(composite, SWT.BORDER);
    fDesc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fDesc.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            updatefield(FIELD_DESC);
          }
        });

    setControl(composite);

    updatefield(FIELD_ALL);

    OSPCreateDataStore store = getDataStore();
    if (store != null) store.addProjectNameChangeListener(this);
  }
  /** Creates dynamic function entry/return probe group. */
  private void createDynamicFunctionPropeGroup() {
    GridLayout layout;
    GridData data;
    Group functionMainGroup = new Group(this, SWT.SHADOW_NONE);
    functionMainGroup.setText(Messages.TraceControl_EnableEventsFucntionGroupName);
    layout = new GridLayout(2, false);
    functionMainGroup.setLayout(layout);
    data = new GridData(GridData.FILL_HORIZONTAL);
    functionMainGroup.setLayoutData(data);

    Composite buttonComposite = new Composite(functionMainGroup, SWT.NONE);
    layout = new GridLayout(1, false);
    buttonComposite.setLayout(layout);
    data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true);
    buttonComposite.setLayoutData(data);

    fFunctionActivateButton = new Button(buttonComposite, SWT.RADIO);
    fFunctionActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName);
    fFunctionActivateButton.setSelection(false);
    data = new GridData(GridData.FILL_HORIZONTAL);
    fFunctionActivateButton.setLayoutData(data);
    fFunctionActivateButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            setKernelEnablements(KernelGroupEnum.FUNCTION);
          }
        });

    Group functionGroup = new Group(functionMainGroup, SWT.SHADOW_NONE);
    layout = new GridLayout(4, true);
    functionGroup.setLayout(layout);
    functionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label functionNameLabel = new Label(functionGroup, SWT.LEFT);
    functionNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 1;
    functionNameLabel.setLayoutData(data);

    fFunctionEventNameText = new Text(functionGroup, SWT.LEFT);
    fFunctionEventNameText.setToolTipText(
        Messages.TraceControl_EnableEventsFunctionEventNameTooltip);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    fFunctionEventNameText.setLayoutData(data);

    Label functionLabel = new Label(functionGroup, SWT.LEFT);
    functionLabel.setText(Messages.TraceControl_EnableEventsFunctionNameLabel);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 1;
    functionLabel.setLayoutData(data);

    fFunctionText = new Text(functionGroup, SWT.LEFT);
    fFunctionText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    fFunctionText.setLayoutData(data);
  }
  /** {@inheritDoc} */
  @Override
  protected void createFieldEditors() {
    disableResolvers =
        new BooleanFieldEditor(
            EMFCompareUIPreferences.DISABLE_RESOLVERS_PREFERENCE,
            EMFCompareIDEUIMessages.getString(
                "ModelResolutionPreferencesPage.disableResolvers"), //$NON-NLS-1$
            getFieldEditorParent());
    addField(disableResolvers);
    useThreads =
        new BooleanFieldEditor(
            EMFCompareUIPreferences.DISABLE_THREADING_PREFERENCE,
            EMFCompareIDEUIMessages.getString(
                "ModelResolutionPreferencesPage.disableThreading"), //$NON-NLS-1$
            getFieldEditorParent());
    addField(useThreads);

    final Composite resolutionScopeComposite = new Composite(getFieldEditorParent(), SWT.BORDER);
    resolutionScopeComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    resolutionScopeComposite.setLayout(new GridLayout(2, false));

    resolutionScopeMainDescription = new Label(resolutionScopeComposite, SWT.WRAP);
    resolutionScopeMainDescription.setText(
        EMFCompareIDEUIMessages.getString(
            "ModelResolutionPreferencesPage.resolutionScope.description")); //$NON-NLS-1$
    final GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.widthHint = 400;
    layoutData.horizontalSpan = 2;
    resolutionScopeMainDescription.setLayoutData(layoutData);

    // Use a composite for the combo editor field alone, to prevent it from grabbing all horizontal
    // space.
    resolutionScopeComboComposite = new Composite(resolutionScopeComposite, SWT.NONE);
    resolutionScopeComboComposite.setLayout(new GridLayout(2, false));
    resolutionScope =
        new ComboFieldEditor(
            EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE,
            EMFCompareIDEUIMessages.getString(
                "ModelResolutionPreferencesPage.resolutionScope"), //$NON-NLS-1$
            scopeNamesAndValues,
            resolutionScopeComboComposite);
    addField(resolutionScope);
    resolutionScopeComboComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

    resolutionScopeDescriptionComposite = new Composite(resolutionScopeComposite, SWT.BORDER);
    resolutionScopeDescriptionComposite.setLayout(new GridLayout(1, true));
    GridData descriptionData = new GridData(SWT.FILL, SWT.FILL, true, false);
    descriptionData.widthHint = 200;
    resolutionScopeDescriptionComposite.setLayoutData(descriptionData);

    resolutionScopeDescriptionLabel = new Label(resolutionScopeDescriptionComposite, SWT.WRAP);
    GridData labelData = new GridData(SWT.FILL, SWT.FILL, true, true);
    resolutionScopeDescriptionLabel.setLayoutData(labelData);

    updateFieldEnablement(
        getPreferenceStore().getBoolean(EMFCompareUIPreferences.DISABLE_RESOLVERS_PREFERENCE));
    updateScopeDescription(
        getPreferenceStore().getString(EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE));
  }
示例#26
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;
  }
  /**
   * Create contents of the wizard.
   *
   * @param parent
   */
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);

    setControl(container);
    container.setLayout(new GridLayout(1, false));

    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));

    Label lblMetaModelThe = new Label(composite, SWT.NONE);
    GridData gd_lblMetaModelThe = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelThe.widthHint = 270;
    lblMetaModelThe.setLayoutData(gd_lblMetaModelThe);
    lblMetaModelThe.setText("Meta model the Helper conforms to:");

    comboMM = new Combo(composite, SWT.NONE);
    GridData gd_comboMM = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboMM.widthHint = 330;
    comboMM.setLayoutData(gd_comboMM);

    Composite composite_1 = new Composite(container, SWT.NONE);
    composite_1.setLayout(new GridLayout(2, false));

    Label lblMetaModelType = new Label(composite_1, SWT.NONE);
    GridData gd_lblMetaModelType = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelType.widthHint = 270;
    lblMetaModelType.setLayoutData(gd_lblMetaModelType);
    lblMetaModelType.setText("Meta model type of the input port:");

    comboInput = new Combo(composite_1, SWT.NONE);
    comboInput.setEnabled(false);
    GridData gd_comboInput = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboInput.widthHint = 330;
    comboInput.setLayoutData(gd_comboInput);

    Composite composite_2 = new Composite(container, SWT.NONE);
    composite_2.setLayout(new GridLayout(2, false));

    Label lblMetaModelType_1 = new Label(composite_2, SWT.NONE);
    GridData gd_lblMetaModelType_1 = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelType_1.widthHint = 270;
    lblMetaModelType_1.setLayoutData(gd_lblMetaModelType_1);
    lblMetaModelType_1.setText("Meta model type of the output port:");

    comboOutput = new Combo(composite_2, SWT.NONE);
    comboOutput.setEnabled(false);
    GridData gd_comboOutput = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboOutput.widthHint = 330;
    comboOutput.setLayoutData(gd_comboOutput);

    setComboMM();
    comboMM.setFocus();
    comboMM.addListener(SWT.Modify, this);
    comboInput.addListener(SWT.Modify, this);
    comboOutput.addListener(SWT.Modify, this);

    this.setPageComplete(false);
  }
示例#28
0
  /** This method initializes groupCurve1 */
  private void createGroupCurve() {
    groupCurve = new Group(content, SWT.NONE);
    groupCurve.setLayout(new GridLayout(3, false));
    groupCurve.setText(Messages.getString("ECContentReal.0")); // $NON-NLS-1$
    groupCurve.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    createCanvasCurve();
    lblCurve = new Label(groupCurve, SWT.NONE);
    lblCurve.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    lblCurve.setText(""); // $NON-NLS-1$
    btnDeletePoints = new Button(groupCurve, SWT.NONE);
    btnDeletePoints.setToolTipText(Messages.getString("ECContentReal.3")); // $NON-NLS-1$
    btnDeletePoints.setText(Messages.getString("ECView.RemoveSelection")); // $NON-NLS-1$
    btnDeletePoints.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
    btnDeletePoints.setEnabled(false);
    btnDeletePoints.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            btnPQ.setSelection(true);
            btnPQ.setEnabled(false);
            btnKP.setSelection(false);
            btnKP.setEnabled(false);
            spnrK.setEnabled(false);
            btnDeletePoints.setEnabled(false);
            setPointP(null);
            setPointQ(null);
            setPointR(null);
            updateCurve(false);
          }
        });
    Label label = new Label(groupCurve, SWT.NONE);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
    label.setText(Messages.getString("ECView.ZoomGraph")); // $NON-NLS-1$
    sliderZoom = new Slider(groupCurve, SWT.NONE);
    sliderZoom.setSelection(10);
    sliderZoom.setMaximum(57);
    sliderZoom.setMinimum(0);
    sliderZoom.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    sliderZoom.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            curve.updateCurve(
                spnrA.getSelection(),
                spnrB.getSelection(),
                50 - sliderZoom.getSelection(),
                canvasCurve.getSize());
            points = curve.getPoints();
            updateCurve(false);
          }
        });
  }
  @Override
  public void createControl(Composite parent) {
    Composite controls = new Composite(parent, SWT.FILL);
    controls.setLayout(new FormLayout());

    Label label = new Label(controls, SWT.LEFT);
    label.setText("Available launch configurations: ");
    FormData f = new FormData();
    f.left = new FormAttachment(0, 5);
    f.top = new FormAttachment(0, 5);
    label.setLayoutData(f);

    availableConfigsCombo = new Combo(controls, SWT.LEFT | SWT.READ_ONLY);
    f = new FormData();
    f.left = new FormAttachment(label, 5);
    f.right = new FormAttachment(100, -100);
    f.top = new FormAttachment(0, 5);
    availableConfigsCombo.setLayoutData(f);

    add = new Button(controls, SWT.PUSH);
    add.setText("Add");
    add.setEnabled(false);
    f = new FormData();
    f.left = new FormAttachment(availableConfigsCombo, 5);
    f.right = new FormAttachment(100, -5);
    f.top = new FormAttachment(0, 4);
    add.setLayoutData(f);

    Label selectiosLabel = new Label(controls, SWT.LEFT);
    f = new FormData();
    f.left = new FormAttachment(0, 5);
    f.top = new FormAttachment(availableConfigsCombo, 5);
    selectiosLabel.setLayoutData(f);

    selectiosLabel.setText("Selected launch configurations:");
    selectedConfigsList =
        new org.eclipse.swt.widgets.List(
            controls, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
    f = new FormData();
    f.left = new FormAttachment(label, 5);
    f.right = new FormAttachment(100, -5);
    f.top = new FormAttachment(availableConfigsCombo, 5);
    f.bottom = new FormAttachment(100, -35);
    selectedConfigsList.setLayoutData(f);

    delete = new Button(controls, SWT.PUSH);
    delete.setText("Remove");
    f = new FormData();
    f.left = new FormAttachment(100, -100);
    f.right = new FormAttachment(100, -5);
    f.top = new FormAttachment(selectedConfigsList, 5);
    delete.setLayoutData(f);
    delete.setEnabled(false);

    addListenerrs();
    setControl(controls);
  }
  public LibrarySelector(Composite parent) {
    super(parent, SWT.NONE);

    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    setLayout(gridLayout);

    final Label label = new Label(this, SWT.NONE);
    label.setText("JARs and class folders on the build path:");
    label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1));

    treeViewer = new TreeViewer(this, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    treeViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 8));
    treeViewer.setContentProvider(new TreeViewContentProvider());
    treeViewer.setLabelProvider(new TreeViewLabelProvider());

    Button addJar = new Button(this, SWT.PUSH);
    addJar.setText("Add JARs...");
    addJar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    addJar.addSelectionListener(new AddJarSelectionListener(this, treeViewer));

    Button addExternalJar = new Button(this, SWT.PUSH);
    addExternalJar.setText("Add External JARs...");
    addExternalJar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    addExternalJar.addSelectionListener(new AddExternalJarSelectionListener(this, treeViewer));

    Button addClassFolder = new Button(this, SWT.PUSH);
    addClassFolder.setText("Add Class Folder...");
    addClassFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    addClassFolder.addSelectionListener(new AddClassFolderSelectionListener(this, treeViewer));

    Button addExternalClassFolder = new Button(this, SWT.PUSH);
    addExternalClassFolder.setText("Add External Class Folder...");
    addExternalClassFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    addExternalClassFolder.addSelectionListener(
        new AddExternalClassFolderSelectionListener(this, treeViewer));

    Button removeButton = new Button(this, SWT.PUSH);
    removeButton.setText("Remove");
    removeButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    removeButton.addSelectionListener(new RemoveResourceSelectionListener(this, treeViewer));

    Label separator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));

    Button moveUpButton = new Button(this, SWT.PUSH);
    moveUpButton.setText("Move Up");
    moveUpButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 1));
    moveUpButton.addSelectionListener(
        new MoveResourceSelectionListener(parent, treeViewer, MoveDirection.UP));

    Button moveDownButton = new Button(this, SWT.PUSH);
    moveDownButton.setText("Move Down");
    moveDownButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 1));
    moveDownButton.addSelectionListener(
        new MoveResourceSelectionListener(parent, treeViewer, MoveDirection.DOWN));
  }