protected Control createListChangeControl(Composite parent) {
    GridData gd;
    Control control;
    if (composite == null) composite = new Composite(parent, SWT.NONE);
    composite.setBackground(parent.getBackground());
    GridLayout gridLayout = new GridLayout(3, false);
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    composite.setLayout(gridLayout);

    Control listControl = createListControl(composite);
    gd = new GridData(GridData.FILL_BOTH);
    listControl.setLayoutData(gd);

    control = new Label(composite, SWT.NONE);
    control.setBackground(parent.getBackground());
    gd = new GridData();
    gd.widthHint = 5;
    control.setLayoutData(gd);

    control = getChangeControl(composite);

    return composite;
  }
  @Override
  protected Control createContents(Composite parent) {
    setShell(parent.getShell());
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;

    PixelConverter conv = new PixelConverter(parent);

    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(layout);
    composite.setFont(parent.getFont());

    GridData data = new GridData(GridData.FILL_BOTH);
    data.widthHint = conv.convertWidthInCharsToPixels(50);
    Control listControl = fTodoTasksList.getListControl(composite);
    listControl.setLayoutData(data);

    Control buttonsControl = fTodoTasksList.getButtonBox(composite);
    buttonsControl.setLayoutData(
        new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));

    fCaseSensitiveCheckBox.doFillIntoGrid(composite, 2);

    validateSettings(null, null, null);

    return composite;
  }
  private Composite createMarkersTabContent(Composite folder) {
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;

    PixelConverter conv = new PixelConverter(folder);

    Composite markersComposite = new Composite(folder, SWT.NULL);
    markersComposite.setLayout(layout);
    markersComposite.setFont(folder.getFont());

    GridData data = new GridData(GridData.FILL_BOTH);
    data.widthHint = conv.convertWidthInCharsToPixels(50);
    Control listControl = fTodoTasksList.getListControl(markersComposite);
    listControl.setLayoutData(data);

    Control buttonsControl = fTodoTasksList.getButtonBox(markersComposite);
    buttonsControl.setLayoutData(
        new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));

    fCaseSensitiveCheckBox.doFillIntoGrid(markersComposite, 2);

    return markersComposite;
  }
  /* (non-Javadoc)
   * @see org.unitarou.swt.WidgetContainer#createContents(org.eclipse.swt.widgets.Composite)
   */
  public Control createContents(Composite parent) {
    ArgumentChecker.throwIfNull(parent);

    GridLayout layout;
    frame_ = new Composite(parent, SWT.NONE);
    switch (alignment_) {
      case TOP:
        layout = new GridLayout(1, true);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, true));
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, true));
        break;

      case BOTTOM:
        layout = new GridLayout(1, true);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false));
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, true));
        break;

      case LEFT:
        layout = new GridLayout(2, false);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true));
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true));
        break;

      case RIGHT:
        layout = new GridLayout(2, false);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
        break;

      default:
        assert false : "Unknown alignment type :" + alignment_; // $NON-NLS-1$
    }
    return frame_;
  }
 @Override
 protected void doFillIntoGrid(Composite parent, int numColumns) {
   Control control = getLabelControl(parent);
   GridData gd = new GridData();
   gd.horizontalSpan = numColumns;
   control.setLayoutData(gd);
   control = getComboBoxControl(parent);
   gd = new GridData();
   gd.horizontalSpan = numColumns;
   control.setLayoutData(gd);
 }
  public Control createControl(Composite parent) {
    Composite c = new Composite(parent, SWT.NONE);
    GridLayout g = new GridLayout();
    c.setLayout(g);
    Control pc = path.createControl(c);
    GridData d = new GridData(GridData.FILL_HORIZONTAL);
    pc.setLayoutData(d);

    Control lc = lists.createControl(c);
    d = new GridData(GridData.FILL_BOTH);
    lc.setLayoutData(d);

    path.updateSelection();
    return c;
  }
  /**
   * Creates the file sets area.
   *
   * @param fileSetsContainer the container to add the file sets area to
   */
  private Control createFileSetsArea(Composite fileSetsContainer) throws CheckstylePluginException {

    Control[] controls = fileSetsContainer.getChildren();
    for (int i = 0; i < controls.length; i++) {
      controls[i].dispose();
    }

    if (mProjectConfig.isUseSimpleConfig()) {
      mFileSetsEditor = new SimpleFileSetsEditor(this);
    } else {
      mFileSetsEditor = new ComplexFileSetsEditor(this);
    }

    mFileSetsEditor.setFileSets(mProjectConfig.getFileSets());

    Control editor = mFileSetsEditor.createContents(mFileSetsContainer);

    fileSetsContainer.setLayout(new FormLayout());
    FormData fd = new FormData();
    fd.left = new FormAttachment(0);
    fd.top = new FormAttachment(0);
    fd.right = new FormAttachment(100);
    fd.bottom = new FormAttachment(100);
    editor.setLayoutData(fd);

    return fileSetsContainer;
  }
  public static void positionControlBelow(
      Control control, Control widgetAbove, int topMarginHint, int leftMarginHint) {

    int topMargin = DEFAULT_LABEL_INPUT_MARGIN;
    if (topMarginHint >= 0) {
      topMargin = topMarginHint;
    }

    int leftMargin = LEFT_MARGIN_OFFSET;
    if (leftMarginHint >= 0) {
      leftMargin = leftMarginHint;
    }

    FormData fd = new FormData();
    if (control.getLayoutData() != null && control.getLayoutData() instanceof FormData) {
      fd = (FormData) control.getLayoutData();
    }

    fd.left = new FormAttachment(0, leftMargin);
    if (widgetAbove != null) {
      fd.top = new FormAttachment(widgetAbove, topMargin);
    } else {
      fd.top = new FormAttachment(0);
    }
    control.setLayoutData(fd);
  }
Example #9
0
  @Override
  protected Control createContents(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    POPUP_LAYOUT_FACTORY.applyTo(composite);

    // LAYOUTDATA_GRAB_BOTH.applyTo(composite);
    GridData gd = LAYOUTDATA_GRAB_BOTH.create();

    composite.setLayoutData(gd);
    if (hasTitleArea()) {
      createTitleMenuArea(composite);
      createHorizontalSeparator(composite);
    }
    dialogArea = createDialogArea(composite);
    if (dialogArea.getLayoutData() == null) LAYOUTDATA_GRAB_BOTH.applyTo(composite);

    gd = LAYOUTDATA_GRAB_BOTH.create();
    dialogArea.pack();
    gd.widthHint = dialogArea.getSize().x;
    gd.heightHint = dialogArea.getSize().y;
    dialogArea.setLayoutData(gd);

    if (hasInfoArea()) {
      createHorizontalSeparator(composite);
      createInfoTextArea(composite);
    }
    return composite;
  }
 private void createDropWidget(final Composite parent) {
   parent.setLayout(new FormLayout());
   Combo combo = new Combo(parent, SWT.READ_ONLY);
   combo.setItems(
       new String[] {
         "Toggle Button",
         "Radio Button",
         "Checkbox",
         "Canvas",
         "Label",
         "List",
         "Table",
         "Tree",
         "Text"
       });
   combo.select(LABEL);
   dropControlType = combo.getSelectionIndex();
   dropControl = createWidget(dropControlType, parent, "Drop Target");
   combo.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           Object data = dropControl.getLayoutData();
           Composite parent = dropControl.getParent();
           dropControl.dispose();
           Combo c = (Combo) e.widget;
           dropControlType = c.getSelectionIndex();
           dropControl = createWidget(dropControlType, parent, "Drop Target");
           dropControl.setLayoutData(data);
           updateDropTarget();
           parent.layout();
         }
       });
   Button b = new Button(parent, SWT.CHECK);
   b.setText("DropTarget");
   b.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           dropEnabled = ((Button) e.widget).getSelection();
           updateDropTarget();
         }
       });
   b.setSelection(dropEnabled);
   FormData data = new FormData();
   data.top = new FormAttachment(0, 10);
   data.bottom = new FormAttachment(combo, -10);
   data.left = new FormAttachment(0, 10);
   data.right = new FormAttachment(100, -10);
   dropControl.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(0, 10);
   combo.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(combo, 10);
   b.setLayoutData(data);
   updateDropTarget();
 }
 private void assignListLayoutData(Control control, int numColumns) {
   GridData gd = new GridData(GridData.FILL_BOTH);
   // gd.verticalAlignment = GridData.FILL;
   gd.horizontalSpan = numColumns - 1;
   gd.grabExcessHorizontalSpace = true;
   control.setLayoutData(gd);
 }
  /*
   * @see PreferencePage#createContents(Composite)
   */
  protected Control createContents(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());

    // Group securityGroup = new Group(composite,SWT.NONE);
    automaticEditor =
        new BooleanFieldEditor(
            TomcatLauncherPlugin.TOMCAT_PREF_COMPUTESOURCEPATH_KEY,
            PREF_PAGE_COMPUTESOURCEPATH_LABEL,
            composite);
    this.initField(automaticEditor);

    final Group projectListGroup = new Group(composite, SWT.NULL);
    projectListGroup.setLayout(new GridLayout());
    projectListEditor = new ProjectListEditor();
    projectListEditor.setLabel(PREF_PAGE_PROJECTINSOURCEPATH_LABEL);
    final Control projectList = projectListEditor.getControl(projectListGroup);
    projectListGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    projectList.setLayoutData(new GridData(GridData.FILL_BOTH));

    projectListEditor.setCheckedElements(
        TomcatLauncherPlugin.getDefault().readProjectsInSourcePathFromPref());

    projectListEditor.setEnabled(!automaticEditor.getBooleanValue());
    // projectListEditor.setEnabled(false);
    automaticEditor.setPropertyChangeListener(
        new IPropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent event) {
            projectListEditor.setEnabled(!automaticEditor.getBooleanValue());
          }
        });

    return composite;
  }
  public static void positionInputLabelPairBelow(
      Control control, Label label, Control widgetAbove, int topMarginHint) {

    int topMargin = DEFAULT_LABEL_INPUT_MARGIN;
    if (topMarginHint >= 0) {
      topMargin = topMarginHint;
    }

    FormData fd = new FormData();
    if (control.getLayoutData() != null && control.getLayoutData() instanceof FormData) {
      fd = (FormData) control.getLayoutData();
    }

    fd.left = new FormAttachment(0, 0);
    if (widgetAbove == null) {
      fd.top = new FormAttachment(0, topMargin);
    } else {
      fd.top = new FormAttachment(widgetAbove, topMargin);
    }
    control.setLayoutData(fd);

    FormData fdl = new FormData();
    if (label.getLayoutData() != null && label.getLayoutData() instanceof FormData) {
      fdl = (FormData) label.getLayoutData();
    }

    fdl.left = new FormAttachment(control, 5, SWT.TOP);
    if (widgetAbove == null) {
      fdl.top = new FormAttachment(0, topMargin);
    } else {
      fdl.top = new FormAttachment(widgetAbove, topMargin);
    }
    label.setLayoutData(fdl);
  }
  private void createSignaturePreview(Composite composite, RowLayouter layouter) {
    Label previewLabel = new Label(composite, SWT.NONE);
    previewLabel.setText(RefactoringMessages.ExtractMethodInputPage_signature_preview);
    layouter.perform(previewLabel);

    IPreferenceStore store = DartToolsPlugin.getDefault().getCombinedPreferenceStore();
    fSignaturePreview =
        new DartSourceViewer(
            composite,
            null,
            null,
            false,
            SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/,
            store);
    fSignaturePreview.configure(
        new DartSourceViewerConfiguration(
            DartToolsPlugin.getDefault().getDartTextTools().getColorManager(), store, null, null));
    fSignaturePreview
        .getTextWidget()
        .setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
    fSignaturePreview.adaptBackgroundColor(composite);
    fSignaturePreview.setDocument(fSignaturePreviewDocument);
    fSignaturePreview.setEditable(false);

    Control signaturePreviewControl = fSignaturePreview.getControl();
    PixelConverter pixelConverter = new PixelConverter(signaturePreviewControl);
    GridData gdata = new GridData(GridData.FILL_BOTH);
    gdata.widthHint = pixelConverter.convertWidthInCharsToPixels(50);
    gdata.heightHint = pixelConverter.convertHeightInCharsToPixels(2);
    signaturePreviewControl.setLayoutData(gdata);
    layouter.perform(signaturePreviewControl);
  }
  @Override
  protected Control createContents(Composite parent) {
    project = (IProject) getElement().getAdapter(IProject.class);
    settings = TeaVMEclipsePlugin.getDefault().getSettings(project);

    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.verticalSpacing = 10;
    layout.marginWidth = 10;
    container.setLayout(layout);

    natureButton = new Button(container, SWT.CHECK);
    natureButton.setText("Enable TeaVM");
    natureButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));

    Control profilesContainer = createProfilesContainer(container);
    profilesContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    try {
      natureButton.setSelection(project.hasNature(TeaVMEclipsePlugin.NATURE_ID));
    } catch (CoreException e) {
      reportStatus(e.getStatus());
    }
    loadProfiles();

    return container;
  }
  /**
   * Creates the separator and fills it in a MGridLayout.
   *
   * @param height The height of the separator
   */
  public Control[] doFillIntoGrid(Composite parent, int nColumns, int height) {
    assertEnoughColumns(nColumns);

    Control separator = getSeparator(parent);
    separator.setLayoutData(gridDataForSeperator(nColumns, height));

    return new Control[] {separator};
  }
  /*
   * (non-Javadoc) Method declared on FieldEditor.
   */
  protected void doFillIntoGrid(Composite parent, int numColumns) {
    Control control = getLabelControl(parent);
    GridData gd = new GridData();
    gd.horizontalSpan = numColumns;
    control.setLayoutData(gd);

    Control list = getListControl(parent);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalSpan = numColumns - 1;
    gd.grabExcessHorizontalSpace = true;
    list.setLayoutData(gd);

    buttonBox = getButtonBoxControl(parent);
    gd = new GridData();
    gd.verticalAlignment = GridData.BEGINNING;
    buttonBox.setLayoutData(gd);
  }
  /*
   * (non-Javadoc)
   *
   * @see org.talend.commons.utils.workbench.preferences.ComboFieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite,
   * int)
   */
  protected void doFillIntoGrid(Composite parent, int numColumns) {
    GridLayout layout = new GridLayout();
    layout.numColumns = 4;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = HORIZONTAL_GAP;
    parent.setLayout(layout);

    Control control = getLabelControl(parent);
    GridData gd = new GridData();
    gd.horizontalSpan = numColumns;
    control.setLayoutData(gd);
    control = getComboBoxControl(parent);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = numColumns;

    control.setLayoutData(gd);
  }
Example #19
0
  private void setLayoutData(Control c, int left, int right, int top, int bottom) {
    FormData location = new FormData();

    location.left = new FormAttachment(left);
    location.right = new FormAttachment(right);
    location.top = new FormAttachment(top);
    location.bottom = new FormAttachment(bottom);

    c.setLayoutData(location);
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
   */
  @Override
  protected void doFillIntoGrid(Composite parent, int numColumns) {
    Control control = getLabelControl(parent);
    GridData gd = new GridData();
    gd.horizontalSpan = numColumns - 1;
    control.setLayoutData(gd);

    Button colorButton = getChangeControl(parent);
    colorButton.setLayoutData(new GridData());
  }
  protected Control createContents(Composite ancestor) {
    initializeDialogUnits(ancestor);
    noDefaultAndApplyButton();
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    ancestor.setLayout(layout);
    Label l = new Label(ancestor, SWT.WRAP);
    l.setFont(ancestor.getFont());
    l.setText(
        "Add, remove or edit jBPM Runtime definitions. "
            + "By default, the checked jBPM Runtime is added to the build "
            + "path of newly created jBPM projects.");
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 1;
    gd.widthHint = 300;
    l.setLayoutData(gd);
    l = new Label(ancestor, SWT.NONE);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 1;
    l.setLayoutData(gd);
    jBPMRuntimesBlock = new JBPMRuntimesBlock();
    jBPMRuntimesBlock.createControl(ancestor);
    JBPMRuntime[] runtimes = JBPMRuntimeManager.getJBPMRuntimes();
    jBPMRuntimesBlock.setJBPMRuntimes(runtimes);
    for (JBPMRuntime runtime : runtimes) {
      if (runtime.isDefault()) {
        jBPMRuntimesBlock.setDefaultJBPMRuntime(runtime);
        break;
      }
    }
    if (jBPMRuntimesBlock.getDefaultJBPMRuntime() == null) {
      setErrorMessage("Select a default jBPM Runtime");
    }
    Control control = jBPMRuntimesBlock.getControl();
    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 1;
    data.widthHint = 450;
    control.setLayoutData(data);

    jBPMRuntimesBlock.addSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            JBPMRuntime runtime = jBPMRuntimesBlock.getDefaultJBPMRuntime();
            if (runtime == null) {
              setErrorMessage("Select a default jBPM Runtime");
            } else {
              setErrorMessage(null);
            }
          }
        });
    applyDialogFont(ancestor);
    return ancestor;
  }
  /*
   * (non-Javadoc)
   *
   * @see
   * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
   * .Composite)
   */
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);

    final Composite composite = new Composite(parent, SWT.NULL);
    composite.setFont(parent.getFont());
    composite.setLayout(initGridLayout(new GridLayout(1, false), true));
    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    // create UI elements
    Control nameControl = createNameControl(composite);
    nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Control rooHomeControl = rooInstallGroup.createControl(composite);
    rooHomeControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    if (DependencyManagementUtils.IS_M2ECLIPSE_PRESENT
        || DependencyManagementUtils.IS_STS_MAVEN_PRESENT) {
      Control dependencyManagementControl = dependencyManagementGroup.createControl(composite);
      dependencyManagementControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    }

    Control providerControl = packagingProviderGroup.createControl(composite);
    providerControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Control locationControl = createLocationControl(composite);
    locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Control workingSetControl = createWorkingSetControl(composite);
    workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    setControl(composite);
  }
  public Composite fillGeneralOption(Composite generalTabContent) {

    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.numColumns = 3;
    generalTabContent.setLayout(layout);

    XModel model = getXModel();
    if (model == null) model = XModelFactory.getDefaultInstance();
    support.init(model.getRoot(), data);
    Control c = support.createControl(generalTabContent);
    pcl = new PCL();
    support.addPropertyChangeListener(pcl);

    fWizardModel = getSpecificWizard().getWizardModel();
    mpcl = new MPCL();
    fWizardModel.addPropertyChangeListener(mpcl);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 3;
    c.setLayoutData(data);

    data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    generalTabContent.setLayoutData(data);

    Label properties = new Label(generalTabContent, SWT.NONE);
    properties.setText(JsfUIMessages.DataTableWizardPage_Properties);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 3;
    properties.setLayoutData(data);

    propertyListEditor.setObject(propertyListObject);
    Control propertiesTable = propertyListEditor.createControl(generalTabContent);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    propertiesTable.setLayoutData(data);

    return generalTabContent;
  }
Example #24
0
  @Override
  protected void doFillIntoGrid(Composite parent, int numColumns) {
    Control control = getLabelControl(parent);
    GridData gd = new GridData();
    control.setLayoutData(gd);

    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.verticalAlignment = GridData.FILL;
    gd.horizontalSpan = numColumns - 1;
    gd.grabExcessHorizontalSpace = true;
    spinner.setLayoutData(gd);
    spinner.layout();
  }
  public static void positionLabelInputPair(Label label, Control control) {

    FormData fdl = new FormData();
    fdl.left = new FormAttachment(0, LEFT_MARGIN_OFFSET);
    fdl.top = new FormAttachment(0, Const.MARGIN);
    label.setLayoutData(fdl);

    FormData fd = new FormData();
    fd.top = new FormAttachment(label, Const.MARGIN);
    fd.left = new FormAttachment(0, LEFT_MARGIN_OFFSET);
    fd.left = new FormAttachment(0, LEFT_MARGIN_OFFSET);
    fd.right = new FormAttachment(0, LEFT_MARGIN_OFFSET + 252);
    control.setLayoutData(fd);
  }
  private void setLayout(Label label, Control text, Control bt) {
    GridData data;

    if (label != null) {
      data = new GridData();
      data.grabExcessHorizontalSpace = false;
      label.setLayoutData(data);
    }

    if (text != null) {
      data = new GridData(GridData.FILL_HORIZONTAL);
      data.grabExcessHorizontalSpace = true;
      text.setLayoutData(data);
    }

    if (bt != null) {
      data = new GridData();
      bt.setLayoutData(data);
      if (bt instanceof Button) {
        ((Button) bt).setText("Browse...");
      }
    }
  }
 private void showControlGroup(String group, boolean show) {
   List<Control> controlList = propGroupMap.get(group);
   if (controlList != null) {
     for (Control control : controlList) {
       GridData gd = (GridData) control.getLayoutData();
       if (gd == null) {
         gd = new GridData(GridData.BEGINNING);
         control.setLayoutData(gd);
       }
       gd.exclude = !show;
       control.setVisible(show);
     }
   }
 }
 public static GridData setGridData(
     Control component,
     int horizontalAlignment,
     boolean grabExcessHorizontalSpace,
     int verticalAlignment,
     boolean grabExcessVerticalSpace) {
   GridData gd = new GridData();
   gd.horizontalAlignment = horizontalAlignment;
   gd.grabExcessHorizontalSpace = grabExcessHorizontalSpace;
   gd.verticalAlignment = verticalAlignment;
   gd.grabExcessVerticalSpace = grabExcessVerticalSpace;
   component.setLayoutData(gd);
   return gd;
 }
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);

    final Composite composite = new Composite(parent, SWT.NULL);
    composite.setFont(parent.getFont());
    composite.setLayout(initGridLayout(new GridLayout(1, false), true));
    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    // create UI elements
    Control nameControl = createNameControl(composite);
    nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Control grailsHomeControl = grailsInstallGroup.createControl(composite);
    grailsHomeControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Control locationControl = createLocationControl(composite);
    locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Control workingSetControl = createWorkingSetControl(composite);
    workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    setControl(composite);
  }
  @Override
  public void createControl(final Composite parent) {
    initializeDialogUnits(parent);
    readConfiguration();

    final Composite result = new Composite(parent, SWT.NONE);

    final GridLayout layout = new GridLayout(2, false);
    layout.horizontalSpacing = 10;
    result.setLayout(layout);

    final Control expressionComposite = createExpression(result);
    expressionComposite.setLayoutData(
        new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

    final Label separator = new Label(result, SWT.NONE);
    separator.setVisible(false);
    final GridData data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1);
    data.heightHint = convertHeightInCharsToPixels(1) / 3;
    separator.setLayoutData(data);

    final Control searchFor = createSearchFor(result);
    searchFor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1));

    final Control limitTo = createLimitTo(result);
    limitTo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1));

    final Control includeMask = createIncludeMask(result);
    includeMask.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));

    setControl(result);

    Dialog.applyDialogFont(result);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(result, IErlangHelpContextIds.ERLANG_SEARCH_PAGE);
  }