protected void openDialog( final String title, final String message, final int dialogType ) { final Dialog dialog = new SimpleMessageDialog( shell, title, message, dialogType ); dialog.open(); }
protected Control createContents(Composite parent) { Control result= fVariableBlock.createContents(parent); Dialog.applyDialogFont(result); return result; }
protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); Composite container = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(2, false); container.setLayout(layout); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); createImageSection(container); createFieldsSection(container); Dialog.applyDialogFont(composite); return composite; }
/** * {@inheritDoc} */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("Details"); }
protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); // create text input field nameField = new Text(composite,SWT.LEFT); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); nameField.setLayoutData(data); // fill the text with the current tab name nameField.setText(oldValue); applyDialogFont(composite); return composite; }
/** * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ protected void okPressed() { selectedEntry = initialEntry; super.okPressed(); }
/** * Super button pressed. * * @param buttonId the button id */ protected void superButtonPressed(int buttonId) { super.buttonPressed(buttonId); }
private GridLayout createGridLayoutWithoutMargins(int nColumns, FontMetrics fontMetrics) { GridLayout layout = new GridLayout(nColumns, false); layout.marginHeight = 0; layout.marginWidth = 0; layout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.VERTICAL_SPACING); return layout; }
/** * Returns the number of pixels corresponding to the width of the given * number of characters. * * @param chars * the number of characters * @return the number of pixels */ public int convertWidthInCharsToPixels(int chars) { return Dialog.convertWidthInCharsToPixels(fontMetrics, chars); }
/** * @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int) */ public int convertHorizontalDLUsToPixels(int dlus) { return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus); }
/** * Returns the number of pixels corresponding to the height of the given * number of characters. * * @param chars * the number of characters * @return the number of pixels */ public int convertHeightInCharsToPixels(int chars) { return Dialog.convertHeightInCharsToPixels(fontMetrics, chars); }
@Override public void create() { super.create(); applyDialogFont(buttonBar); }
/** * See {@link org.eclipse.jface.window.Window#configureShell}. * @param shell The shell. */ protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText(WSUIPluginMessages.DIALOG_TITLE_RESOURCE_BROWSER); }
@Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); createWideLabel(composite, dialogDescription); return composite; }
/** * {@inheritDoc} */ protected void okPressed() { returnValue = saslRealmText.getText(); super.okPressed(); }
@Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { value = text.getText(); } else { value = null; } super.buttonPressed(buttonId); }
protected Button createButton(Composite parent, String label, int style) { Button button = new Button(parent, SWT.PUSH); button.setText(label); // we need to explicitly set the font to the parent's font for dialogs button.setFont(parent.getFont()); GridData data = new GridData(style); data.heightHint = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_HEIGHT); int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH); data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); button.setLayoutData(data); return button; }
/** * @see DialogPage#convertWidthInCharsToPixels */ public int convertWidthInCharsToPixels(int chars) { return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars); } }
/** * Returns the number of pixels corresponding to the given number of * horizontal dialog units. * * @param dlus * the number of horizontal dialog units * @return the number of pixels */ public int convertHorizontalDLUsToPixels(int dlus) { return Dialog.convertHorizontalDLUsToPixels(fontMetrics, dlus); }
/** * Returns the number of pixels corresponding to the height of the given * number of characters. * * @param chars * the number of characters * @return the number of pixels */ public int convertHeightInCharsToPixels(int chars) { return Dialog.convertHeightInCharsToPixels(fontMetrics, chars); }