/** * Create a horizontal separator for the given parent. * * @param parent * The parent composite. * @return The Control representing the horizontal separator. */ private Control createHorizontalSeparator(final Composite parent) { final Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.LINE_DOT); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(separator); return separator; }
/** * Create a horizontal separator for the given parent. * * @param parent * The parent composite. * @return The Control representing the horizontal separator. */ private Control createHorizontalSeparator(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(separator); return separator; }
/** * Create a horizontal separator for the given parent. * * @param parent * The parent composite. * @return The Control representing the horizontal separator. */ private Control createHorizontalSeparator(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(separator); return separator; }
protected Text createText(final Composite parent, final int style) { final Text text = new Text(parent, style); text.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).hint(150, SWT.DEFAULT) .align(GridData.FILL, GridData.BEGINNING).create()); return text; }
/** * Create a horizontal separator for the given parent. * * @param parent * The parent composite. * @return The Control representing the horizontal separator. */ private Control createHorizontalSeparator(Composite parent) { // RAP [bm]: SWT#LINE_DOT missing // Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL // | SWT.LINE_DOT); Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); // RAPEND: [bm] GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(separator); return separator; }
private static void attachGridData(Control c) { GridDataFactory .defaultsFor(c) .align(SWT.FILL, SWT.CENTER) .grab(true, false) .applyTo(c); } }
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 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); }
@Override protected Control createTitleControl(Composite parent) { filterText = new Text(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false) .applyTo(filterText); contents.hookFilterText(filterText); filterText.addKeyListener(getKeyAdapter()); return filterText; }
protected void addIconAndLabel(Composite parent, Image image, String text, boolean bold) { Label imageLabel = new Label(parent, SWT.NONE); imageLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND)); imageLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING)); imageLabel.setImage(image); Label textLabel = new Label(parent, SWT.WRAP); if (bold) { textLabel.setFont(CommonFonts.BOLD); } textLabel.setForeground(getTitleColor()); textLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER)); textLabel.setText(CommonUiUtil.toLabel(text)); int width = Math.min(textLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, MAX_WIDTH); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(width, SWT.DEFAULT).applyTo(textLabel); }
public void createControl(Composite parent) { Composite displayArea = new Composite(parent, SWT.NONE); GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false) .applyTo(displayArea); GridDataFactory.fillDefaults().grab(true, true).applyTo(displayArea); new Label(displayArea, SWT.NONE) .setText(UIText.SubmodulePathWizardPage_PathLabel); pathText = new Text(displayArea, SWT.SINGLE | SWT.BORDER); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER) .grab(true, false).applyTo(pathText); pathText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { validate(); } }); setControl(displayArea); setTitle(UIText.SubmodulePathWizardPage_Title); setMessage(UIText.SubmodulePathWizardPage_Message); setPageComplete(false); }
@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; }
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 createDialogArea(Composite parent) { Composite main = (Composite) super.createDialogArea(parent); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(main); editor = new ConfigurationEditorComponent(main, myConfig, true, false) { @Override protected void setErrorMessage(String message) { EditDialog.this.setErrorMessage(message); } @Override protected void setDirty(boolean dirty) { getButton(IDialogConstants.OK_ID).setEnabled(dirty); } }; Control result = editor.createContents(); applyDialogFont(main); return result; }
protected void addIconAndLabel(Composite parent, Image image, StyledString text) { Label imageLabel = new Label(parent, SWT.NONE); imageLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND)); imageLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING)); imageLabel.setImage(image); StyledText textLabel = new StyledText(parent, 0); textLabel.setText(text.getString()); textLabel.setStyleRanges(text.getStyleRanges()); // textLabel.setForeground(getTitleColor()); textLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER)); //textLabel.setText(""); int width = Math.min(textLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, MAX_WIDTH); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(width, SWT.DEFAULT).applyTo(textLabel); }
@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; }
protected ToolBar createToolBar(final Composite parent) { toolBar = new ToolBar(parent, SWT.FLAT); GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER) .applyTo(toolBar); if (getPreferences().getBoolean(PANEL_DIRECTIONS)) { createNextItem(toolBar); createPreviousItem(toolBar); } createIndexing(toolBar); createSettingsMenu(toolBar); if (getPreferences().getBoolean(PANEL_CLOSE)) { createClose(toolBar); } return toolBar; }