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

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

Introduction

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

Prototype

int DESELECT_ALL_ID

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

Click Source Link

Document

Button id for a "Deselect All" button (value 19).

Usage

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.
 * /*w  w  w.  j av  a2 s. c  o  m*/
 * @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.
 *//*from w  w  w  . j av  a2s .co 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/*from   w  w w  . 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/*from www.j  av 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.
 *//*  w  ww.j a  v  a  2  s.  com*/
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 w  w  . ja v  a2 s .  c om
 * @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 w  ww . j  ava 2  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  ww. j a v  a2 s . c  o 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;
}

From source file:org.ow2.joram.design.model.export.wizard.SelectElementsWizardPage.java

License:Open Source License

protected void createSelectionButtons(Composite composite) {
    Composite buttonComposite = new Composite(composite, SWT.RIGHT);
    GridLayout layout = new GridLayout();
    layout.numColumns = 0;/*w ww. j ava  2  s.c om*/
    layout.marginWidth = 0;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonComposite.setLayout(layout);
    buttonComposite.setFont(composite.getFont());
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
    data.grabExcessHorizontalSpace = true;
    buttonComposite.setLayoutData(data);
    Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, "Select &All");
    SelectionListener listener = new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            Object[] viewerElements = fContentProvider.getElements(fInput);
            treeViewer.setCheckedElements(viewerElements);
            validCheckedElements();
        }
    };
    selectButton.addSelectionListener(listener);
    Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, "&Deselect All");
    listener = new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            treeViewer.setCheckedElements(new Object[0]);
            validCheckedElements();
        }
    };
    deselectButton.addSelectionListener(listener);
}

From source file:org.python.pydev.debug.ui.PyConfigureExceptionDialog.java

License:Open Source License

/**
 * Creates a DeSelect All button and its respective listener.
 * // w w  w .j  ava2 s  .c  om
 * @param buttonComposite
 */
private void createDeselectAll(Composite buttonComposite) {
    SelectionListener listener;
    Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, DESELECT_ALL_TITLE,
            false);

    listener = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            listViewer.setAllChecked(false);
            TableItem[] currentItems = listViewer.getTable().getItems();
            for (TableItem tableItem : currentItems) {
                removeFromSelectedElements(tableItem.getText());
            }
        }
    };
    deselectButton.addSelectionListener(listener);
}