Example usage for org.eclipse.jface.dialogs IDialogConstants SELECT_ALL_ID

List of usage examples for org.eclipse.jface.dialogs IDialogConstants SELECT_ALL_ID

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants SELECT_ALL_ID.

Prototype

int SELECT_ALL_ID

To view the source code for org.eclipse.jface.dialogs IDialogConstants SELECT_ALL_ID.

Click Source Link

Document

Button id for a "Select All" button (value 18).

Usage

From source file:org.jboss.tools.runtime.ui.internal.dialogs.SearchRuntimePathDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // OK button/*from  w w w  .  j  av  a2  s.com*/
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    okButton.setEnabled(false);
    createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.SearchRuntimePathDialog_Select_All);
    createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.SearchRuntimePathDialog_Deselect_All);
    // cancel button
    createCancelButton(parent);
}

From source file:org.jboss.tools.runtime.ui.internal.dialogs.SearchRuntimePathDialog.java

License:Open Source License

@Override
protected void finishedRun() {
    if (getShell() == null || getShell().isDisposed()) {
        return;//from  ww  w .j  a  va  2s.c o  m
    }
    decrementNestingDepth();
    getShell().setCursor(null);
    int count = getRuntimeDefinitions(true).size();
    if (count == 0) {
        hideCreatedRuntimes.setSelection(false);
    }
    if (canceled) {
        refresh(Messages.SearchRuntimePathDialog_Searching_runtimes_is_canceled);
    } else {
        refresh(Messages.SearchRuntimePathDialog_Searching_runtimes_is_finished);
        RuntimeModelUtil.updateTimestamps(runtimePaths.toArray(new RuntimePath[runtimePaths.size()]));
    }

    String foundRuntimes;
    if (count == 0) {
        foundRuntimes = Messages.SearchRuntimePathDialog_No_runtime_found;
        getButton(IDialogConstants.OK_ID).setEnabled(false);
    } else {
        if (count == 1) {
            foundRuntimes = NLS.bind(Messages.SearchRuntimePathDialog_New_runtime_found, count);
        } else {
            foundRuntimes = NLS.bind(Messages.SearchRuntimePathDialog_New_runtimes_found, count);
        }
        getButton(IDialogConstants.OK_ID).setEnabled(true);
        getButton(IDialogConstants.SELECT_ALL_ID).setEnabled(true);
        getButton(IDialogConstants.DESELECT_ALL_ID).setEnabled(true);
    }
    foundRuntimesLabel.setText(foundRuntimes);
}

From source file:org.jboss.tools.windup.ui.internal.wizards.WindupReportExportWizardPage1.java

License:Open Source License

/**
 * Creates the buttons for selecting specific types or selecting all or none of the elements.
 * /*from   w ww  .  j  av a  2s  . c om*/
 * @param parent the parent control
 */
private final void createButtonsGroup(Composite parent) {

    Font font = parent.getFont();

    // top level group
    Composite buttonComposite = new Composite(parent, SWT.NONE);
    buttonComposite.setFont(parent.getFont());

    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    layout.makeColumnsEqualWidth = true;
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));

    // add select all button
    Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID,
            Messages.WindupReportExport_select_all, false);
    SelectionListener listener = new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            resourceGroup.setAllChecked(true);
            updateWidgetEnablements();
        }
    };
    selectButton.addSelectionListener(listener);
    selectButton.setFont(font);
    setButtonLayoutData(selectButton);

    // add de-select all button
    Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            Messages.WindupReportExport_deselect_all, false);
    listener = new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            resourceGroup.setAllChecked(false);
            updateWidgetEnablements();
        }
    };
    deselectButton.addSelectionListener(listener);
    deselectButton.setFont(font);
    setButtonLayoutData(deselectButton);

}

From source file:org.kalypso.contribs.eclipse.jface.dialog.ListSelectionComposite.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the page.
 *///  w ww.ja va  2  s.c  o m
private void addSelectionButtons(final CheckboxTableViewer checkboxViewer, final Composite composite) {
    final Composite buttonComposite = new Composite(composite, SWT.NONE);
    final GridLayout layout = GridLayoutFactory.fillDefaults().create();
    // layout.horizontalSpacing = convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_SPACING );
    layout.horizontalSpacing = IDialogConstants.HORIZONTAL_SPACING;
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true, false));

    final String SELECT_ALL_TITLE = WorkbenchMessages.SelectionDialog_selectLabel;
    final String DESELECT_ALL_TITLE = WorkbenchMessages.SelectionDialog_deselectLabel;

    final Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE,
            false);

    selectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            checkboxViewer.setAllChecked(true);
            fireCheckStateChanged(new CheckStateChangedEvent(checkboxViewer, null, true));
        }
    });

    final Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            DESELECT_ALL_TITLE, false);

    deselectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            checkboxViewer.setAllChecked(false);
            fireCheckStateChanged(new CheckStateChangedEvent(checkboxViewer, null, true));
        }
    });
}

From source file:org.kalypso.contribs.eclipse.jface.wizard.TreeSelectionPage.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the dialog.
 *
 * @param composite/* w  ww.  j  a  v  a  2 s .co m*/
 *          org.eclipse.swt.widgets.Composite
 */
private void addSelectionButtons(final Composite composite, final CheckboxTreeViewer viewer) {
    final Composite buttonComposite = new Composite(composite, SWT.RIGHT);

    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    buttonComposite.setLayout(layout);
    final GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
    data.grabExcessHorizontalSpace = true;
    composite.setData(data);

    final Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE,
            false);

    final ITreeContentProvider treeContentProvider = m_contentProvider;

    selectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            handleSelectAll(viewer, treeContentProvider);
        }
    });

    final Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            DESELECT_ALL_TITLE, false);
    deselectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            handleDeselectAll(viewer, treeContentProvider);
        }
    });
}

From source file:org.kalypso.contribs.eclipse.ui.dialogs.TreeSelectionDialog.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the dialog.
 *
 * @param composite// ww  w. j  a  v  a  2 s.  c  o  m
 *          org.eclipse.swt.widgets.Composite
 */
private void addSelectionButtons(final Composite composite) {
    final Composite buttonComposite = new Composite(composite, SWT.NONE);

    final GridLayout layout = GridLayoutFactory.fillDefaults().create();
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonComposite.setLayout(layout);

    buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true, false));

    final Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE,
            false);

    final Object inputElement = m_inputElement;
    SelectionListener listener = new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            m_treeViewer.setSubtreeChecked(inputElement, true);
        }
    };
    selectButton.addSelectionListener(listener);

    final Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            DESELECT_ALL_TITLE, false);

    listener = new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            m_treeViewer.setSubtreeChecked(inputElement, false);
        }
    };
    deselectButton.addSelectionListener(listener);
}

From source file:org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the page.
 *//*from w  ww . j  av  a2  s  .  c  o m*/
private void addSelectionButtons(final CheckboxTableViewer checkboxViewer, final Composite composite) {
    final Composite buttonComposite = new Composite(composite, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true, false));

    addSpinner(m_resultProcessViewer, composite);

    final String SELECT_ALL_TITLE = Messages.getString("org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.16");// WorkbenchMessages.SelectionDialog_selectLabel; //$NON-NLS-1$
    final String DESELECT_ALL_TITLE = Messages.getString("org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.17");// WorkbenchMessages.SelectionDialog_deselectLabel; //$NON-NLS-1$

    final Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE,
            false);

    selectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            checkboxViewer.setAllChecked(true);
            updateSelection();
        }
    });

    final Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            DESELECT_ALL_TITLE, false);

    deselectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            checkboxViewer.setAllChecked(false);
            updateSelection();
        }
    });
}

From source file:org.kalypso.model.wspm.tuhh.ui.wizards.WspWinExportProjectSelectionPage.java

License:Open Source License

/**
 * // * Creates the buttons for selecting specific types or selecting all or none of the // * elements. // * // *
 * /*from   w ww .  j av a2 s. c  o  m*/
 * @param parent
 *          the parent control //
 */
protected final void createButtonsGroup(final Composite parent) {
    // top level group
    final Composite buttonComposite = new Composite(parent, SWT.NONE);
    buttonComposite.setFont(parent.getFont());

    buttonComposite.setLayout(new GridLayout(3, true));
    buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    m_selectAllButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID,
            WorkbenchMessages.SelectionDialog_selectLabel, false); //$NON-NLS-1$

    final WritableSet selectedProjectList = m_data.getSelectedProjectList();
    final IProject[] wspmProjects = m_data.getWspmProjects();

    m_selectAllButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            selectedProjectList.addAll(Arrays.asList(wspmProjects));
        }
    });
    setButtonLayoutData(m_selectAllButton);

    m_deselectAllButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            WorkbenchMessages.SelectionDialog_deselectLabel, false); //$NON-NLS-1$

    m_deselectAllButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            selectedProjectList.clear();
        }
    });
    setButtonLayoutData(m_deselectAllButton);
}

From source file:org.nabucco.framework.exporting.ui.rcp.wizard.ExportWizardPage.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the composite.
 * //from  www  .j  a  v a2 s  .c om
 * @param parent
 *            the parent composite
 * @param viewer
 *            the checkbox tree viewer
 */
private Composite layoutSelectionButtons(Composite parent, CheckboxTreeViewer viewer) {

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));

    GridData data = new GridData(GridData.GRAB_HORIZONTAL);
    data.grabExcessHorizontalSpace = true;
    composite.setLayoutData(data);
    Font parentFont = parent.getFont();
    composite.setFont(parentFont);

    IObservableValue uiElement;
    IObservableValue modelElement;
    DataBindingContext bindingContext = new DataBindingContext();

    Button selectAllButton = this.createButton(composite, IDialogConstants.SELECT_ALL_ID,
            I18N.i18n(BUTTON_SELECT));

    uiElement = SWTObservables.observeEnabled(selectAllButton);
    modelElement = BeansObservables.observeValue(this.model, ExportWizardModel.PROPERTY_EXPORTSEPERATE);
    bindingContext.bindValue(uiElement, modelElement);

    selectAllButton.addSelectionListener(new ExportSelectionListener(viewer, true));
    selectAllButton.setFont(parentFont);

    Button deselectAllButton = createButton(composite, IDialogConstants.DESELECT_ALL_ID,
            I18N.i18n(BUTTON_DESELECT));

    uiElement = SWTObservables.observeEnabled(deselectAllButton);
    modelElement = BeansObservables.observeValue(this.model, ExportWizardModel.PROPERTY_EXPORTSEPERATE);
    bindingContext.bindValue(uiElement, modelElement);

    deselectAllButton.addSelectionListener(new ExportSelectionListener(viewer, false));
    deselectAllButton.setFont(parentFont);

    return composite;
}

From source file:org.nabucco.framework.importing.ui.rcp.wizard.ImportWizardPage.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the composite.
 * //from   w w  w .jav a  2  s . co  m
 * @param parent
 *            the parent composite
 * @param viewer
 *            the checkbox tree viewer
 */
private Composite layoutSelectionButtons(Composite parent, CheckboxTreeViewer viewer) {

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));

    GridData data = new GridData(GridData.GRAB_HORIZONTAL);
    data.grabExcessHorizontalSpace = true;
    composite.setLayoutData(data);
    Font parentFont = parent.getFont();
    composite.setFont(parentFont);

    IObservableValue uiElement;
    IObservableValue modelElement;
    DataBindingContext bindingContext = new DataBindingContext();

    Button selectAllButton = this.createButton(composite, IDialogConstants.SELECT_ALL_ID,
            I18N.i18n(BUTTON_SELECT));

    uiElement = SWTObservables.observeEnabled(selectAllButton);
    modelElement = BeansObservables.observeValue(this.model, ImportWizardModel.PROPERTY_EXPORTSEPERATE);
    bindingContext.bindValue(uiElement, modelElement);

    selectAllButton.addSelectionListener(new ImportSelectionListener(viewer, true));
    selectAllButton.setFont(parentFont);

    Button deselectAllButton = createButton(composite, IDialogConstants.DESELECT_ALL_ID,
            I18N.i18n(BUTTON_DESELECT));

    uiElement = SWTObservables.observeEnabled(deselectAllButton);
    modelElement = BeansObservables.observeValue(this.model, ImportWizardModel.PROPERTY_EXPORTSEPERATE);
    bindingContext.bindValue(uiElement, modelElement);

    deselectAllButton.addSelectionListener(new ImportSelectionListener(viewer, false));
    deselectAllButton.setFont(parentFont);

    return composite;
}