@Override protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText(title); }
protected void buttonPressed(int id) { if (id == IDialogConstants.DETAILS_ID) { // was the details button pressed? toggleDetailsArea(); } else { super.buttonPressed(id); } }
public boolean close() { // RAP [bm]: // if (clipboard != null) { // clipboard.dispose(); // } // RAPEND: [bm] return super.close(); }
/** * Create the dialog area and the button bar for the receiver. * * @param parent */ protected void createDialogAndButtonArea(Composite parent) { // create the dialog area and button bar dialogArea = createDialogArea(parent); buttonBar = createButtonBar(parent); // Apply to the parent so that the message gets it too. applyDialogFont(parent); }
Image image = getImage(); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); addAccessibleListeners(imageLabel, image); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING) .applyTo(imageLabel); messageLabel = new Label(composite, getMessageLabelStyle()); messageLabel.setText(message); GridDataFactory .grab(true, false) .hint( convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT).applyTo(messageLabel);
protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
/** * Opens this message dialog, creating it first if it has not yet been created. * <p> * This method waits until the dialog is closed by the end user, and then it * returns the dialog's return code. The dialog's return code is either the * index of the button the user pressed, or {@link SWT#DEFAULT} if the dialog * has been closed by other means. * </p> * * @return the return code * * @see org.eclipse.jface.window.Window#open() */ public int open() { return super.open(); }
@Override protected void createDialogAndButtonArea(Composite parent) { super.createDialogAndButtonArea(parent); if (this.dialogArea instanceof Composite) { // Create a label if there are no children to force a smaller layout Composite dialogComposite = (Composite) dialogArea; if (dialogComposite.getChildren().length == 0) { new Label(dialogComposite, SWT.NULL); } } }
final Composite labelAndText = (Composite) super.createDialogArea(parent); ((GridLayout) labelAndText.getLayout()).numColumns = 1;
/** * The cancel button has been pressed. */ protected void cancelPressed() { // NOTE: this was previously done from a listener installed on the // cancel button. On GTK, the listener installed by // Dialog.createButton is called first and this was throwing an // exception because the cancel button was already disposed cancel.setEnabled(false); progressMonitor.setCanceled(true); super.cancelPressed(); }
Image image = getImage(); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); addAccessibleListeners(imageLabel, image); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING) .applyTo(imageLabel); messageLabel = new Label(composite, getMessageLabelStyle()); messageLabel.setText(message); GridDataFactory .grab(true, false) .hint( convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT).applyTo(messageLabel);
/** * Create the dialog area and the button bar for the receiver. * * @param parent */ protected void createDialogAndButtonArea(Composite parent) { // create the dialog area and button bar dialogArea = createDialogArea(parent); buttonBar = createButtonBar(parent); // Apply to the parent so that the message gets it too. applyDialogFont(parent); }
@Override protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }
/** * Opens this message dialog, creating it first if it has not yet been created. * <p> * This method waits until the dialog is closed by the end user, and then it * returns the dialog's return code. The dialog's return code is either the * index of the button the user pressed, or {@link SWT#DEFAULT} if the dialog * has been closed by other means. * </p> * * @return the return code * * @see org.eclipse.jface.window.Window#open() */ @Override public int open() { return super.open(); }
protected void createDialogAndButtonArea(Composite parent) { super.createDialogAndButtonArea(parent); if (this.dialogArea instanceof Composite) { // Create a label if there are no children to force a smaller layout Composite dialogComposite = (Composite) dialogArea; if (dialogComposite.getChildren().length == 0) { new Label(dialogComposite, SWT.NULL); } } }
/** * The cancel button has been pressed. * * @since 3.0 */ @Override protected void cancelPressed() { // NOTE: this was previously done from a listener installed on the // cancel button. On GTK, the listener installed by // Dialog.createButton is called first and this was throwing an // exception because the cancel button was already disposed cancel.setEnabled(false); progressMonitor.setCanceled(true); super.cancelPressed(); }
@Override protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText(title); }
Image image = getImage(); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); addAccessibleListeners(imageLabel, image); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING) .applyTo(imageLabel); messageLabel = new Label(composite, getMessageLabelStyle()); messageLabel.setText(message); GridDataFactory .grab(true, false) .hint( convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT).applyTo(messageLabel);
/** * Create the dialog area and the button bar for the receiver. * * @param parent */ protected void createDialogAndButtonArea(Composite parent) { // create the dialog area and button bar dialogArea = createDialogArea(parent); buttonBar = createButtonBar(parent); // Apply to the parent so that the message gets it too. applyDialogFont(parent); }
@Override protected Control createContents(Composite parent) { // initialize the dialog units initializeDialogUnits(parent); Point defaultSpacing = LayoutConstants.getSpacing(); GridLayoutFactory.fillDefaults().margins(LayoutConstants.getMargins()) .spacing(defaultSpacing.x * 2, defaultSpacing.y).numColumns(getColumnCount()).applyTo(parent); GridDataFactory.fillDefaults().grab(true, true).applyTo(parent); createDialogAndButtonArea(parent); return parent; }