private void createSpacer(Composite comp) { Label label = new Label(comp, SWT.NONE); GridDataFactory.fillDefaults().span(3, 0).applyTo(label); }
/** * 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 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 * @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. * @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 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); }
private void createRunInUIThreadGroup(Composite comp) { runInUIThread = new Button(comp, SWT.CHECK); runInUIThread.addSelectionListener(widgetSelectedAdapter(e -> updateLaunchConfigurationDialog())); runInUIThread.setText(PDEUIMessages.PDEJUnitLaunchConfigurationTab_Run_Tests_In_UI_Thread); GridDataFactory.fillDefaults().span(2, 0).grab(true, false).applyTo(runInUIThread); }
private void createServerSection(Composite parent) { Label label; label = new Label(parent, SWT.NONE); label.setText(Messages.RepositoryLocationPart_Server); Text urlText = new Text(parent, SWT.BORDER); GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo(urlText); bind(urlText, RepositoryLocation.PROPERTY_URL, getUrlUpdateValueStrategy(), null); label = new Label(parent, SWT.NONE); label.setText(Messages.RepositoryLocationPart_Label); Text labelText = new Text(parent, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).applyTo(labelText); bind(labelText, RepositoryLocation.PROPERTY_LABEL); Button disconnectedButton = new Button(parent, SWT.CHECK); disconnectedButton.setText(Messages.RepositoryLocationPart_Disconnected); bind(disconnectedButton, RepositoryLocation.PROPERTY_OFFLINE); }
/** * Creates the control to be used to represent the dialog's title text. * Subclasses may override if a different control is desired for * representing the title text, or if something different than the title * should be displayed in location where the title text typically is shown. * * <p> * If this method is overridden, the returned control's layout data must be * an instance of <code>GridData</code>. This method must not modify the * parent's layout. * * @param parent * The parent composite. * @return The Control representing the title area. */ protected Control createTitleControl(Composite parent) { titleLabel = new Label(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(showDialogMenu ? 1 : 2, 1).applyTo(titleLabel); if (titleText != null) { titleLabel.setText(titleText); } return titleLabel; }
/** * Creates the control to be used to represent the dialog's title text. * Subclasses may override if a different control is desired for * representing the title text, or if something different than the title * should be displayed in location where the title text typically is shown. * * <p> * If this method is overridden, the returned control's layout data must be * an instance of <code>GridData</code>. This method must not modify the * parent's layout. * * @param parent * The parent composite. * @return The Control representing the title area. */ protected Control createTitleControl(Composite parent) { titleLabel = new Label(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(showDialogMenu ? 1 : 2, 1).applyTo(titleLabel); if (titleText != null) { titleLabel.setText(titleText); } return titleLabel; }
/** * Creates the control to be used to represent the dialog's title text. * Subclasses may override if a different control is desired for * representing the title text, or if something different than the title * should be displayed in location where the title text typically is shown. * * <p> * If this method is overridden, the returned control's layout data must be * an instance of <code>GridData</code>. This method must not modify the * parent's layout. * * @param parent * The parent composite. * @return The Control representing the title area. */ protected Control createTitleControl(Composite parent) { titleLabel = new Label(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(showDialogMenu ? 1 : 2, 1).applyTo(titleLabel); if (titleText != null) { titleLabel.setText(titleText); } return titleLabel; }
private Section createSection(Composite parent, FormToolkit toolkit, int span) { Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED); GridDataFactory.fillDefaults().span(span, 1).grab(true, true) .applyTo(section); return section; }
private void createHttpAuthSection(SectionComposite parent) { int style = SWT.NONE; if (getWorkingCopy().getCredentials(AuthenticationType.HTTP, false) != null) { style |= ExpandableComposite.EXPANDED; } ExpandableComposite section = parent.createSection(Messages.RepositoryLocationPart_HTTP_Authentication, style); section.clientVerticalSpacing = 5; Composite composite = new Composite(section, SWT.NONE); section.setClient(composite); GridLayoutFactory.fillDefaults().numColumns(3).applyTo(composite); Label label; Button enableButton = new Button(composite, SWT.CHECK); GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(enableButton); enableButton.setText(Messages.RepositoryLocationPart_Enable_HTTP_Authentication); label = new Label(composite, SWT.NONE); label.setText(Messages.RepositoryLocationPart_User); Text userText = new Text(composite, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(userText); label = new Label(composite, SWT.NONE); label.setText(Messages.RepositoryLocationPart_Password); Text passwordText = new Text(composite, SWT.BORDER | SWT.PASSWORD); GridDataFactory.fillDefaults().grab(true, false).applyTo(passwordText); Button savePasswordButton = new Button(composite, SWT.CHECK); savePasswordButton.setText(Messages.RepositoryLocationPart_Save_Password); bindUserCredentials(AuthenticationType.HTTP, enableButton, userText, passwordText, null, savePasswordButton, false); }
private void createWarningArea(Composite composite) { Composite warningArea = new Composite(composite, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).span(2, 1).hint(100, SWT.DEFAULT) .applyTo(warningArea); warningArea.setLayout(new GridLayout(2, false)); Label warningImg = new Label(warningArea, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(warningImg); warningImg.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING)); Text warningLabel = new Text(warningArea, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY); warningLabel.setBackground(composite.getBackground()); GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.FILL).grab(true, false).applyTo(warningLabel); warningLabel.setText(Messages.MavenPomSelectionComponent_UnavailableRemoteRepositoriesIndexes); }
protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(0) // this is incremented // by createButton .equalWidth(true).applyTo(composite); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1) .applyTo(composite); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(0) // this is incremented // by createButton .equalWidth(true).applyTo(composite); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1) .applyTo(composite); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
@Override protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(0) // this is incremented // by createButton .equalWidth(true).applyTo(composite); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).span(2, 1) .applyTo(composite); composite.setFont(parent.getFont()); // Add the buttons to the button bar. createButtonsForButtonBar(composite); return composite; }
private void createBidiPreferencesGroup(Composite composite) { layoutDirectionCombo = addComboBox(composite, WorkbenchMessages.GlobalizationPreference_layoutDirection, 0); layoutDirectionCombo.setItems(new String[] { DEFAULT_DIR, LTR_DIR, RTL_DIR }); layoutDirectionCombo.select(getLayoutDirectionIndex(layoutDirection)); layoutDirectionCombo.addSelectionListener(widgetSelectedAdapter( e -> layoutDirection = getLayoutDirectionInteger(layoutDirectionCombo.getSelectionIndex()))); createSpace(composite); bidiSupportClickButton = new Button(composite, SWT.CHECK | SWT.LEFT); bidiSupportClickButton.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create()); bidiSupportClickButton.setText(WorkbenchMessages.GlobalizationPreference_bidiSupport); bidiSupportClickButton.setSelection(bidiSupport); bidiSupportClickButton.addSelectionListener(widgetSelectedAdapter(e -> selectClickMode(bidiSupportClickButton.getSelection()))); textDirectionCombo = addComboBox(composite, WorkbenchMessages.GlobalizationPreference_textDirection, LayoutConstants.getIndent()); textDirectionCombo.setItems(new String[] { DEFAULT_DIR, LTR_DIR, AUTO_DIR, RTL_DIR }); textDirectionCombo.setEnabled(bidiSupport); textDirectionCombo.select(getTextDirectionIndex(textDirection)); textDirectionCombo.addSelectionListener(widgetSelectedAdapter(e -> textDirection = getTextDirectionString(textDirectionCombo.getSelectionIndex()))); createSpace(composite); Font font = composite.getFont(); Composite note = createNoteComposite(font, composite, WorkbenchMessages.Preference_note, WorkbenchMessages.GlobalizationPreference_restartWidget); note.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create()); }
private void createTagsArea(Composite parent, FormToolkit toolkit, int span) { Composite tagArea = toolkit.createComposite(parent); GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false) .applyTo(tagArea); GridDataFactory.fillDefaults().span(span, 1).grab(true, false) .applyTo(tagArea); toolkit.createLabel(tagArea, UIText.CommitEditorPage_LabelTags) .setForeground( toolkit.getColors().getColor(IFormColors.TB_TOGGLE)); tagLabelArea = toolkit.createComposite(tagArea); GridDataFactory.fillDefaults().grab(true, true).applyTo(tagLabelArea); GridLayoutFactory.fillDefaults().spacing(1, 1).applyTo(tagLabelArea); }