/** * Generates layout data to the given control, given the number of cells * spanned by the control. Attaches a GridData to the control. This method * allows generated layout data to be used with controls that span multiple cells. * <p> * The generated layout data is the same as what would be generated by * GridLayoutFactory.generateLayout, except that the span is configurable * </p> * * @see GridLayoutFactory#generateLayout(org.eclipse.swt.widgets.Composite) * @param theControl * @param hSpan number of columns spanned by the control * @param vSpan number of rows spanned by the control * @since 3.3 */ public static void generate(Control theControl, int hSpan, int vSpan) { defaultsFor(theControl).span(hSpan, vSpan).applyTo(theControl); }
/** * Generates layout data to the given control, given the number of cells * spanned by the control. Attaches a GridData to the control. This method * allows generated layout data to be used with controls that span multiple cells. * <p> * The generated layout data is the same as what would be generated by * GridLayoutFactory.generateLayout, except that the span is configurable * </p> * * @see GridLayoutFactory#generateLayout(org.eclipse.swt.widgets.Composite) * @param theControl * @param hSpan number of columns spanned by the control * @param vSpan number of rows spanned by the control */ public static void generate(Control theControl, int hSpan, int vSpan) { defaultsFor(theControl).span(hSpan, vSpan).applyTo(theControl); }
/** * Generates layout data to the given control, given the number of cells * spanned by the control. Attaches a GridData to the control. This method * allows generated layout data to be used with controls that span multiple cells. * <p> * The generated layout data is the same as what would be generated by * GridLayoutFactory.generateLayout, except that the span is configurable * </p> * * @see GridLayoutFactory#generateLayout(org.eclipse.swt.widgets.Composite) * @param theControl * @param hSpan number of columns spanned by the control * @param vSpan number of rows spanned by the control * @since 3.3 */ public static void generate(Control theControl, int hSpan, int vSpan) { defaultsFor(theControl).span(hSpan, vSpan).applyTo(theControl); }
/** * Generates layout data to the given control, given the number of cells * spanned by the control. Attaches GridData to the control. This method * allows generated layout data to be used with controls that span multiple cells. * <p> * The generated layout data is the same as what would be generated by * GridLayoutFactory.generateLayout, except that the span is configurable * </p> * * @see GridLayoutFactory#generateLayout(org.eclipse.swt.widgets.Composite) * @param theControl * @param span The x coordinate indicates the number of * columns spanned, and the y coordinate indicates the number of rows. * @since 3.3 */ public static void generate(Control theControl, Point span) { defaultsFor(theControl).span(span).applyTo(theControl); }
/** * Generates layout data to the given control, given the number of cells * spanned by the control. Attaches GridData to the control. This method * allows generated layout data to be used with controls that span multiple cells. * <p> * The generated layout data is the same as what would be generated by * GridLayoutFactory.generateLayout, except that the span is configurable * </p> * * @see GridLayoutFactory#generateLayout(org.eclipse.swt.widgets.Composite) * @param theControl * @param span The x coordinate indicates the number of * columns spanned, and the y coordinate indicates the number of rows. */ public static void generate(Control theControl, Point span) { defaultsFor(theControl).span(span).applyTo(theControl); }
/** * Generates layout data to the given control, given the number of cells * spanned by the control. Attaches GridData to the control. This method * allows generated layout data to be used with controls that span multiple cells. * <p> * The generated layout data is the same as what would be generated by * GridLayoutFactory.generateLayout, except that the span is configurable * </p> * * @see GridLayoutFactory#generateLayout(org.eclipse.swt.widgets.Composite) * @param theControl * @param span The x coordinate indicates the number of * columns spanned, and the y coordinate indicates the number of rows. * @since 3.3 */ public static void generate(Control theControl, Point span) { defaultsFor(theControl).span(span).applyTo(theControl); }
private static void attachGridData(Control c) { GridDataFactory .defaultsFor(c) .align(SWT.FILL, SWT.CENTER) .grab(true, false) .applyTo(c); } }
protected void setButtonSize(Button button) { GridDataFactory.defaultsFor(button).align(SWT.FILL, SWT.BEGINNING).grab(false, false).applyTo(button); }
protected void setButtonSize(Button button) { GridDataFactory.defaultsFor(button).align(SWT.FILL, SWT.BEGINNING).grab(false, false).applyTo(button); }
protected void setButtonSize(Button button) { GridDataFactory.defaultsFor(button).align(SWT.FILL, SWT.BEGINNING).grab(false, false).applyTo(button); }
protected void setButtonSize(Button button) { GridDataFactory.defaultsFor(button).align(SWT.FILL, SWT.BEGINNING).grab(false, false).applyTo(button); }
GridDataFactory.defaultsFor(infoLabel).span(2, 1).applyTo(infoLabel); String tempInfoText = hasEditingItems() ? UIText.CustomPromptDialog_provide_information_for Label label = new Label(main, SWT.NONE); label.setText(item.getPromptText()); GridDataFactory.defaultsFor(label).applyTo(label); GridDataFactory.defaultsFor(text).applyTo(text); text.setData(KEY_ITEM, item); editingControls.add(text); } else if (item instanceof YesNoType) { Button checkBox = new Button(main, SWT.CHECK); GridDataFactory.defaultsFor(checkBox).applyTo(checkBox); editingControls.add(checkBox); } else {
@Override protected Control createContent(Composite parent, FormToolkit toolkit) { Composite composite = toolkit.createComposite(parent); composite.setLayout(new GridLayout()); Label label = createLabel(composite, toolkit, "Plan:"); GridDataFactory.defaultsFor(label).indent(0, 0).applyTo(label); Text text = createTextReadOnly(composite, toolkit, ""); bind(text, IBuildPlan.class, BuildPackage.Literals.BUILD_ELEMENT__NAME); label = createLabel(composite, toolkit, "Build:"); GridDataFactory.defaultsFor(label).indent(12, 0).applyTo(label); text = createTextReadOnly(composite, toolkit, ""); bind(text, IBuild.class, BuildPackage.Literals.BUILD__BUILD_NUMBER); label = createLabel(composite, toolkit, "Status: "); GridDataFactory.defaultsFor(label).indent(12, 0).applyTo(label); text = createTextReadOnly(composite, toolkit, ""); //bind(text, IBuild.class, BuildPackage.Literals.BUILD__STATUS); IBuild build = getInput(IBuild.class); text.setText(getStatusLabel(build)); label = createLabel(composite, toolkit, "Duration: "); GridDataFactory.defaultsFor(label).indent(12, 0).applyTo(label); text = createTextReadOnly(composite, toolkit, ""); text.setText(DateUtil.getFormattedDurationShort(build.getDuration(), true)); ((GridLayout) composite.getLayout()).numColumns = composite.getChildren().length; toolkit.paintBordersFor(composite); return composite; }
traceFileLocation = new Text(main, SWT.BORDER); traceFileLocation.setEditable(false); GridDataFactory.defaultsFor(traceFileLocation).grab(true, false) .applyTo(traceFileLocation);
.applyTo(rootArea); GridDataFactory .defaultsFor(m_hideInherited) .align(SWT.FILL, SWT.CENTER) .applyTo(m_hideInherited);
GridDataFactory.defaultsFor(table).span(1, moveableColumnsFound ? 3 : 1) .applyTo(table); GridDataFactory.defaultsFor(widthComposite).grab(false, false).span( numColumns, 1).applyTo(widthComposite);
GridDataFactory.defaultsFor(table).span(1, moveableColumnsFound ? 3 : 1) .applyTo(table); GridDataFactory.defaultsFor(widthComposite).grab(false, false).span( numColumns, 1).applyTo(widthComposite);
GridDataFactory.defaultsFor(table).span(1, moveableColumnsFound ? 3 : 1) .applyTo(table); GridDataFactory.defaultsFor(widthComposite).grab(false, false).span( numColumns, 1).applyTo(widthComposite);
.defaultsFor(rootArea) .align(SWT.FILL, SWT.FILL) .applyTo(rootArea);
GridDataFactory.defaultsFor(label).indent(0, 0).applyTo(label); text = createTextReadOnly(composite, toolkit, ""); bind(text, IBuild.class, GridDataFactory.defaultsFor(label).indent(0, 0).applyTo(label); text = createTextReadOnly(composite, toolkit, ""); bind(text, IBuild.class, GridDataFactory.defaultsFor(label).indent(0, 0).applyTo(label); text = createTextReadOnly(composite, toolkit, ""); bind(text, IBuild.class,