List of usage examples for org.eclipse.jface.dialogs IDialogConstants SELECT_ALL_ID
int SELECT_ALL_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants SELECT_ALL_ID.
Click Source Link
From source file:org.eclipse.tcf.te.tcf.ui.wizards.pages.PeerExportWizardPage.java
License:Open Source License
private void createDestinationGroup(Composite parent) { Font font = parent.getFont(); // destination specification group Composite destinationSelectionGroup = new Composite(parent, SWT.NONE); destinationSelectionGroup.setLayout(new GridLayout(3, false)); destinationSelectionGroup//from w ww . j ava 2 s. c o m .setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); destinationSelectionGroup.setFont(font); Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE); destinationLabel.setText(Messages.PeerExportWizardPage_destination_label); destinationLabel.setFont(font); // destination name entry field fDestinationField = new Text(destinationSelectionGroup, SWT.BORDER); fDestinationField.setFont(font); GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = GridData.FILL; gd.widthHint = SIZING_TEXT_FIELD_WIDTH; fDestinationField.setLayoutData(gd); if (getDialogSettings().get(OLD_PATH) != null) { fDestinationField.setText(getDialogSettings().get(OLD_PATH)); } fDestinationField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { setPageComplete(isComplete()); } }); fDestinationButton = createButton(destinationSelectionGroup, IDialogConstants.SELECT_ALL_ID, Messages.PeerExportWizardPage_destination_button, false); fDestinationButton.addSelectionListener(new SelectionAdapter() { /* (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @SuppressWarnings("synthetic-access") @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dd = new DirectoryDialog(getContainer().getShell()); dd.setText(Messages.PeerExportWizardPage_destination_label); String file = dd.open(); if (file != null) { IPath path = new Path(file); fDestinationField.setText(path.toOSString()); setPageComplete(isComplete()); } } }); fOverwrite = new Button(destinationSelectionGroup, SWT.CHECK); fOverwrite.setText(Messages.PeerExportWizardPage_overwrite_button); gd = new GridData(); gd.horizontalSpan = 3; fOverwrite.setLayoutData(gd); fOverwrite.setSelection(getDialogSettings().getBoolean(OVERWRITE)); }
From source file:org.eclipse.tcf.te.tcf.ui.wizards.pages.PeerImportWizardPage.java
License:Open Source License
/** * Creates the checkbox tree and list for selecting peers. * * @param parent the parent control//from w w w. jav a 2 s. c om */ @SuppressWarnings("unused") private final void createPeersGroup(Composite parent) { Composite resourcesGroup = new Composite(parent, SWT.NONE); resourcesGroup.setLayout(new GridLayout()); resourcesGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); resourcesGroup.setFont(parent.getFont()); new Label(resourcesGroup, SWT.NONE).setText(Messages.PeerImportWizardPage_peers_label); Table table = new Table(resourcesGroup, SWT.CHECK | SWT.BORDER); table.setLayoutData(new GridData(GridData.FILL_BOTH)); fViewer = new CheckboxTableViewer(table); fViewer.setContentProvider(new ITreePathContentProvider() { @Override public void dispose() { } @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } @Override public Object[] getElements(Object inputElement) { List<IPeer> elements = new ArrayList<IPeer>(); File[] candidates = ((IPath) inputElement).toFile().listFiles(new FileFilter() { @Override public boolean accept(File pathname) { IPath path = new Path(pathname.getAbsolutePath()); return path.getFileExtension() != null && path.getFileExtension().toLowerCase().equals("peer"); //$NON-NLS-1$ } }); // If there are "*.peer" files to read, process them if (candidates != null && candidates.length > 0) { for (File candidate : candidates) { try { IURIPersistenceService service = ServiceManager.getInstance() .getService(IURIPersistenceService.class); if (service != null) { IPeer tempPeer = (IPeer) service.read(IPeer.class, candidate.getAbsoluteFile().toURI()); elements.add(tempPeer); } } catch (Exception e) { } } } return elements.toArray(); } @Override public Object[] getChildren(TreePath parentPath) { return null; } @Override public boolean hasChildren(TreePath path) { return false; } @Override public TreePath[] getParents(Object element) { return null; } }); fViewer.setLabelProvider(new DelegatingLabelProvider()); ICheckStateListener checkListener = new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { setPageComplete(isComplete()); } }; fViewer.addCheckStateListener(checkListener); // top level group Composite buttonComposite = new Composite(resourcesGroup, SWT.NONE); buttonComposite.setFont(parent.getFont()); GridLayout layout = new GridLayout(2, true); layout.marginHeight = layout.marginWidth = 0; buttonComposite.setLayout(layout); buttonComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, Messages.PeerImportWizardPage_selectAll, false); selectButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fViewer.setAllChecked(true); setPageComplete(isComplete()); } }); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, Messages.PeerImportWizardPage_deselectAll, false); deselectButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fViewer.setAllChecked(false); setPageComplete(isComplete()); } }); new Label(resourcesGroup, SWT.NONE); fOverwrite = new Button(resourcesGroup, SWT.CHECK); fOverwrite.setText(Messages.PeerImportWizardPage_overwrite_button); fOverwrite.setSelection(getDialogSettings().getBoolean(OVERWRITE)); }
From source file:org.eclipse.tcf.te.tcf.ui.wizards.pages.PeerImportWizardPage.java
License:Open Source License
private void createLocationGroup(Composite parent) { Font font = parent.getFont(); // destination specification group Composite destinationSelectionGroup = new Composite(parent, SWT.NONE); destinationSelectionGroup.setLayout(new GridLayout(3, false)); destinationSelectionGroup/*from ww w . j a v a 2 s .co m*/ .setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); destinationSelectionGroup.setFont(font); Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE); destinationLabel.setText(Messages.PeerImportWizardPage_destination_label); destinationLabel.setFont(font); // destination name entry field fLocationField = new Text(destinationSelectionGroup, SWT.BORDER); fLocationField.setFont(font); GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = GridData.FILL; gd.widthHint = SIZING_TEXT_FIELD_WIDTH; fLocationField.setLayoutData(gd); fLocationField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { fViewer.setInput(new Path(fLocationField.getText())); } }); fLocationButton = createButton(destinationSelectionGroup, IDialogConstants.SELECT_ALL_ID, Messages.PeerImportWizardPage_destination_button, false); fLocationButton.addSelectionListener(new SelectionAdapter() { /* (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @SuppressWarnings("synthetic-access") @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dd = new DirectoryDialog(getContainer().getShell()); dd.setText(Messages.PeerImportWizardPage_destination_label); String file = dd.open(); if (file != null) { IPath path = new Path(file); fLocationField.setText(path.toOSString()); setPageComplete(isComplete()); } } }); }
From source file:org.eclipse.team.internal.ccvs.ui.AddToVersionControlDialog.java
License:Open Source License
/** * Add the selection and deselection buttons to the dialog. * @param composite org.eclipse.swt.widgets.Composite */// ww w. j a v a2 s . co m private void addSelectionButtons(Composite composite) { Composite buttonComposite = new Composite(composite, SWT.RIGHT); GridLayout layout = new GridLayout(); layout.numColumns = 2; buttonComposite.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace = true; composite.setData(data); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, CVSUIMessages.ReleaseCommentDialog_selectAll, false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { listViewer.setAllChecked(true); resourcesToAdd = null; } }; selectButton.addSelectionListener(listener); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, CVSUIMessages.ReleaseCommentDialog_deselectAll, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { listViewer.setAllChecked(false); resourcesToAdd = new Object[0]; } }; deselectButton.addSelectionListener(listener); }
From source file:org.eclipse.team.internal.ccvs.ui.subscriber.SyncInfoSetDetailsDialog.java
License:Open Source License
/** * Add the selection and deselection buttons to the dialog. * @param composite org.eclipse.swt.widgets.Composite *///from w ww.j a v a2 s . c om private void addSelectionButtons(Composite composite) { Composite buttonComposite = new Composite(composite, SWT.RIGHT); GridLayout layout = new GridLayout(); layout.numColumns = 2; buttonComposite.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace = true; composite.setData(data); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, CVSUIMessages.ReleaseCommentDialog_selectAll, false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { listViewer.setAllChecked(true); selectedResources = null; } }; selectButton.addSelectionListener(listener); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, CVSUIMessages.ReleaseCommentDialog_deselectAll, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { listViewer.setAllChecked(false); selectedResources = new Object[0]; } }; deselectButton.addSelectionListener(listener); }
From source file:org.eclipse.tracecompass.tmf.ui.widgets.timegraph.dialogs.TimeGraphFilterDialog.java
License:Open Source License
/** * Adds the selection and deselection buttons to the dialog. * * @param composite/*from w w w . java2 s .c o m*/ * the parent composite * @return Composite the composite the buttons were created in. */ protected Composite createSelectionButtons(Composite composite) { Composite buttonComposite = new Composite(composite, SWT.RIGHT); GridLayout layout = new GridLayout(); 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); /* Create the buttons in the good order to place them as we want */ Button checkSelectedButton = createButton(buttonComposite, BUTTON_CHECK_SELECTED_ID, Messages.TmfTimeFilterDialog_CHECK_SELECTED, false); Button checkSubtreeButton = createButton(buttonComposite, BUTTON_CHECK_SUBTREE_ID, Messages.TmfTimeFilterDialog_CHECK_SUBTREE, false); Button checkAllButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, Messages.TmfTimeFilterDialog_CHECK_ALL, false); Button checkActiveButton = null; if (fCheckActiveProvider != null) { checkActiveButton = createButton(buttonComposite, BUTTON_CHECK_ACTIVE_ID, fCheckActiveProvider.getLabel(), false); checkActiveButton.setToolTipText(fCheckActiveProvider.getTooltip()); } else if (fUncheckInactiveProvider != null) { // Filler label to ensure correct layout. Label filler = new Label(buttonComposite, 0); filler.setText(""); //$NON-NLS-1$ } Button uncheckSelectedButton = createButton(buttonComposite, BUTTON_UNCHECK_SELECTED_ID, Messages.TmfTimeFilterDialog_UNCHECK_SELECTED, false); Button uncheckSubtreeButton = createButton(buttonComposite, BUTTON_UNCHECK_SUBTREE_ID, Messages.TmfTimeFilterDialog_UNCHECK_SUBTREE, false); Button uncheckAllButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, Messages.TmfTimeFilterDialog_UNCHECK_ALL, false); Button uncheckInactiveButton = null; if (fUncheckInactiveProvider != null) { uncheckInactiveButton = createButton(buttonComposite, BUTTON_UNCHECK_INACTIVE_ID, fUncheckInactiveProvider.getLabel(), false); uncheckInactiveButton.setToolTipText(fUncheckInactiveProvider.getTooltip()); } /* * Apply the layout again after creating the buttons to override * createButton messing with the columns */ layout.numColumns = 3; if (fCheckActiveProvider != null || fUncheckInactiveProvider != null) { layout.numColumns++; } buttonComposite.setLayout(layout); /* Add a listener to each button */ checkSelectedButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeSelection selection = (TreeSelection) fTree.getViewer().getSelection(); for (Object element : selection.toArray()) { checkElement(element); } updateOKStatus(); } }); checkSubtreeButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeSelection selection = (TreeSelection) fTree.getViewer().getSelection(); for (Object element : selection.toArray()) { checkElementAndSubtree(element); } } }); checkAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Object[] viewerElements = fContentProvider.getElements(fInput); for (int i = 0; i < viewerElements.length; i++) { fTree.setSubtreeChecked(viewerElements[i], true); } updateOKStatus(); } }); if (checkActiveButton != null) { checkActiveButton.addSelectionListener(new CheckActiveSelectionAdapter(true)); } uncheckSelectedButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeSelection selection = (TreeSelection) fTree.getViewer().getSelection(); for (Object element : selection.toArray()) { uncheckElement(element); } updateOKStatus(); } }); uncheckSubtreeButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeSelection selection = (TreeSelection) fTree.getViewer().getSelection(); for (Object element : selection.toArray()) { uncheckElement(element); } updateOKStatus(); } }); uncheckAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Object[] viewerElements = fContentProvider.getElements(fInput); for (Object element : viewerElements) { if (fTree.getViewer().testFindItem(element) != null) { // uncheck only visible roots and their children uncheckElement(element); } } updateOKStatus(); } }); if (uncheckInactiveButton != null) { uncheckInactiveButton.addSelectionListener(new CheckActiveSelectionAdapter(false)); } return buttonComposite; }
From source file:org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.java
License:Open Source License
/** * Adds the selection and deselection buttons to the dialog. * //from w w w . j av a 2 s . c om * @param composite * the parent composite * @return Composite the composite the buttons were created in. */ protected Composite createSelectionButtons(Composite composite) { Composite buttonComposite = new Composite(composite, SWT.RIGHT); GridLayout layout = new GridLayout(); layout.numColumns = 0; 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, WorkbenchMessages.CheckedTreeSelectionDialog_select_all, false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { Object[] viewerElements = fContentProvider.getElements(fInput); if (fContainerMode) { fViewer.setCheckedElements(viewerElements); } else { for (int i = 0; i < viewerElements.length; i++) { fViewer.setSubtreeChecked(viewerElements[i], true); } } updateOKStatus(); } }; selectButton.addSelectionListener(listener); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_deselect_all, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fViewer.setCheckedElements(new Object[0]); updateOKStatus(); } }; deselectButton.addSelectionListener(listener); return buttonComposite; }
From source file:org.eclipse.ui.dialogs.TypeFilteringDialog.java
License:Open Source License
/** * Add the selection and deselection buttons to the dialog. * //w ww.j av a 2 s.com * @param composite * org.eclipse.swt.widgets.Composite */ private void addSelectionButtons(Composite composite) { Composite buttonComposite = new Composite(composite, SWT.RIGHT); GridLayout layout = new GridLayout(); layout.numColumns = 2; buttonComposite.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace = true; composite.setData(data); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, WorkbenchMessages.WizardTransferPage_selectAll, false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { listViewer.setAllChecked(true); } }; selectButton.addSelectionListener(listener); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, WorkbenchMessages.WizardTransferPage_deselectAll, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { listViewer.setAllChecked(false); } }; deselectButton.addSelectionListener(listener); }
From source file:org.eclipse.ui.dialogs.WizardExportResourcesPage.java
License:Open Source License
/** * Creates the buttons for selecting specific types or selecting all or none of the * elements./* www . j a va2s. c o m*/ * * @param parent the parent control */ protected 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)); // types edit button Button selectTypesButton = createButton(buttonComposite, IDialogConstants.SELECT_TYPES_ID, SELECT_TYPES_TITLE, false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handleTypesEditButtonPressed(); } }; selectTypesButton.addSelectionListener(listener); selectTypesButton.setFont(font); setButtonLayoutData(selectTypesButton); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { resourceGroup.setAllSelections(true); updateWidgetEnablements(); } }; selectButton.addSelectionListener(listener); selectButton.setFont(font); setButtonLayoutData(selectButton); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, DESELECT_ALL_TITLE, false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { resourceGroup.setAllSelections(false); updateWidgetEnablements(); } }; deselectButton.addSelectionListener(listener); deselectButton.setFont(font); setButtonLayoutData(deselectButton); }
From source file:org.eclipse.ui.ide.examples.projectsnapshot.ProjectRefreshSnapshotExportWizardPage.java
License:Open Source License
/** * Creates the checkbox tree and list for selecting resources. * //from ww w . ja v a2s.com * @param parent * the parent control */ private final void createResourcesGroup(Composite parent) { Composite resourcesGroup = new Composite(parent, SWT.NONE); resourcesGroup.setLayout(new GridLayout()); resourcesGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); resourcesGroup.setFont(parent.getFont()); new Label(resourcesGroup, SWT.NONE).setText(Messages.ProjectRefreshSnapshotExportWizardPage_selectProjects); Table table = new Table(resourcesGroup, SWT.CHECK | SWT.BORDER); table.setLayoutData(new GridData(GridData.FILL_BOTH)); fProjectViewer = new CheckboxTableViewer(table); fProjectViewer.setContentProvider(new IStructuredContentProvider() { List fContents; public Object[] getElements(Object input) { if (fContents != null && fContents == input) return fContents.toArray(); return new Object[0]; } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput instanceof List) fContents = (List) newInput; else fContents = null; // we use a fixed set. } public void dispose() { } }); fProjectViewer.setLabelProvider(new WorkbenchLabelProvider()); ICheckStateListener checkListener = new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { updateWidgetEnablements(); } }; fProjectViewer.addCheckStateListener(checkListener); // top level group Composite buttonComposite = new Composite(resourcesGroup, SWT.NONE); buttonComposite.setFont(parent.getFont()); GridLayout layout = new GridLayout(2, true); layout.marginHeight = layout.marginWidth = 0; buttonComposite.setLayout(layout); buttonComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, Messages.ProjectRefreshSnapshotExportWizardPage_selectAll, false); SelectionAdapter listener = new SelectionAdapter() { // @Override public void widgetSelected(SelectionEvent e) { fProjectViewer.setAllChecked(true); updateWidgetEnablements(); } }; selectButton.addSelectionListener(listener); Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, Messages.ProjectRefreshSnapshotExportWizardPage_deselectAll, false); listener = new SelectionAdapter() { // @Override public void widgetSelected(SelectionEvent e) { fProjectViewer.setAllChecked(false); updateWidgetEnablements(); } }; deselectButton.addSelectionListener(listener); initProjects(); }