1
/*******************************************************************************
2
* Copyright (c) 2009 QNX Software Systems and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* QNX Software Systems - initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.internal.ui.workingsets;
14
import org.eclipse.jface.dialogs.IDialogConstants;
15
import org.eclipse.jface.dialogs.TrayDialog;
16
import org.eclipse.jface.window.IShellProvider;
17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.layout.GridData;
19
import org.eclipse.swt.widgets.Composite;
20
import org.eclipse.swt.widgets.Control;
21
import org.eclipse.swt.widgets.Shell;
24
* A dialog for management of working set configurations. These collect the selection of project
25
* configurations for the member projects of the working sets into named presets.
27
* @author Christian W. Damus (cdamus)
31
public class WorkingSetConfigurationDialog extends TrayDialog {
33
private WorkingSetConfigurationBlock block;
36
* Initializes me with my shell.
40
public WorkingSetConfigurationDialog(Shell shell) {
45
* Initializes me with my shell provider.
49
public WorkingSetConfigurationDialog(IShellProvider parentShell) {
54
protected boolean isResizable() {
59
protected void configureShell(Shell newShell) {
60
setHelpAvailable(false);
62
super.configureShell(newShell);
64
newShell.setText(WorkingSetMessages.WSConfigDialog_title);
68
protected Control createDialogArea(Composite parent) {
69
Composite result = (Composite) super.createDialogArea(parent);
71
block = new WorkingSetConfigurationBlock(WorkingSetConfigurationManager.getDefault()
72
.createWorkspaceSnapshot());
73
Control contents = block.createContents(result);
74
contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
80
protected void buttonPressed(int buttonId) {
81
if (buttonId == IDialogConstants.OK_ID) {
83
// user cancelled: don't save, and don't close the dialog
90
super.buttonPressed(buttonId);