Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167595
Collapse All | Expand All

(-)src/org/eclipse/team/internal/ui/wizards/WorkingSetsDialog.java (-14 / +1 lines)
Lines 78-103 Link Here
78
78
79
		wsTableViewer.setContentProvider(new ArrayContentProvider());
79
		wsTableViewer.setContentProvider(new ArrayContentProvider());
80
		wsTableViewer.setLabelProvider(new WorkingSetLabelProvider());
80
		wsTableViewer.setLabelProvider(new WorkingSetLabelProvider());
81
		wsTableViewer.setInput(getResourceWorkingSets());
81
		wsTableViewer.setInput(TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSets());
82
82
83
		setupListeners();
83
		setupListeners();
84
84
85
		return parent;
85
		return parent;
86
	}
86
	}
87
87
88
	private Object getResourceWorkingSets() {
89
		IWorkingSet[] allSets = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSets();
90
		ArrayList resourceSets = new ArrayList();
91
		for (int i = 0; i < allSets.length; i++) {
92
			String id = allSets[i].getId();
93
			if (id != null && id.equals(WorkingSetsDialog.resourceWorkingSetId)) {
94
				resourceSets.add(allSets[i]);
95
			}
96
		}
97
		return (IWorkingSet[]) resourceSets.toArray(new IWorkingSet[resourceSets.size()]);
98
99
	}
100
101
	protected void okPressed() {
88
	protected void okPressed() {
102
		selectedWorkingSet = wsNameText.getText();
89
		selectedWorkingSet = wsNameText.getText();
103
90
(-)src/org/eclipse/team/internal/ui/wizards/ProjectSetImportWizard.java (-1 / +2 lines)
Lines 87-93 Link Here
87
			IAdaptable[] tempElements = oldSet.getElements();
87
			IAdaptable[] tempElements = oldSet.getElements();
88
			IAdaptable[] finalElementList = new IAdaptable[tempElements.length + projects.length];
88
			IAdaptable[] finalElementList = new IAdaptable[tempElements.length + projects.length];
89
			System.arraycopy(tempElements, 0, finalElementList, 0, tempElements.length);
89
			System.arraycopy(tempElements, 0, finalElementList, 0, tempElements.length);
90
			System.arraycopy(projects, 0,finalElementList, tempElements.length, projects.length);
90
			IAdaptable[] adaptedProjects = oldSet.adaptElements(projects);
91
			System.arraycopy(adaptedProjects, 0,finalElementList, tempElements.length, adaptedProjects.length);
91
			oldSet.setElements(finalElementList);
92
			oldSet.setElements(finalElementList);
92
		}	
93
		}	
93
	}
94
	}
(-)src/org/eclipse/team/internal/ui/wizards/ImportProjectSetMainPage.java (-9 / +2 lines)
Lines 24-31 Link Here
24
import org.eclipse.swt.layout.GridData;
24
import org.eclipse.swt.layout.GridData;
25
import org.eclipse.swt.layout.GridLayout;
25
import org.eclipse.swt.layout.GridLayout;
26
import org.eclipse.swt.widgets.*;
26
import org.eclipse.swt.widgets.*;
27
import org.eclipse.team.internal.ui.*;
27
import org.eclipse.team.internal.ui.IHelpContextIds;
28
import org.eclipse.ui.IWorkingSet;
28
import org.eclipse.team.internal.ui.TeamUIMessages;
29
import org.eclipse.ui.PlatformUI;
29
import org.eclipse.ui.PlatformUI;
30
30
31
public class ImportProjectSetMainPage extends TeamWizardPage {
31
public class ImportProjectSetMainPage extends TeamWizardPage {
Lines 173-185 Link Here
173
			if (workingSetName.length() == 0) {
173
			if (workingSetName.length() == 0) {
174
				setMessage(TeamUIMessages.ImportProjectSetMainPage_workingSetNameEmpty, ERROR); 
174
				setMessage(TeamUIMessages.ImportProjectSetMainPage_workingSetNameEmpty, ERROR); 
175
				return false;
175
				return false;
176
			} else {
177
				// todo: verify name doesn't already exist
178
				IWorkingSet existingSet = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSet(workingSetName);
179
				if (existingSet != null && !existingSet.getId().equals(WorkingSetsDialog.resourceWorkingSetId)) {
180
					setMessage(TeamUIMessages.ImportProjectSetMainPage_workingSetNameExists, ERROR); 
181
					return false;
182
				}
183
			}
176
			}
184
		}
177
		}
185
		setMessage(null);
178
		setMessage(null);
(-)src/org/eclipse/team/internal/ui/TeamUIMessages.java (-1 lines)
Lines 267-273 Link Here
267
	public static String ImportProjectSetMainPage_The_specified_file_does_not_exist_4;
267
	public static String ImportProjectSetMainPage_The_specified_file_does_not_exist_4;
268
	public static String ImportProjectSetMainPage_You_have_specified_a_folder_5;
268
	public static String ImportProjectSetMainPage_You_have_specified_a_folder_5;
269
	public static String ImportProjectSetMainPage_workingSetNameEmpty;
269
	public static String ImportProjectSetMainPage_workingSetNameEmpty;
270
	public static String ImportProjectSetMainPage_workingSetNameExists;
271
	public static String ImportProjectSetMainPage_createWorkingSetLabel;
270
	public static String ImportProjectSetMainPage_createWorkingSetLabel;
272
	public static String ImportProjectSetMainPage_workingSetLabel;
271
	public static String ImportProjectSetMainPage_workingSetLabel;
273
272
(-)src/org/eclipse/team/internal/ui/messages.properties (-3 / +2 lines)
Lines 94-100 Link Here
94
ImportProjectSetMainPage_The_specified_file_does_not_exist_4=The specified file does not exist
94
ImportProjectSetMainPage_The_specified_file_does_not_exist_4=The specified file does not exist
95
ImportProjectSetMainPage_You_have_specified_a_folder_5=You have specified a folder
95
ImportProjectSetMainPage_You_have_specified_a_folder_5=You have specified a folder
96
ImportProjectSetMainPage_workingSetNameEmpty=The working set name must not be empty
96
ImportProjectSetMainPage_workingSetNameEmpty=The working set name must not be empty
97
ImportProjectSetMainPage_workingSetNameExists=The specified working set already exists
98
ImportProjectSetMainPage_createWorkingSetLabel=&Create a working set containing the imported projects
97
ImportProjectSetMainPage_createWorkingSetLabel=&Create a working set containing the imported projects
99
ImportProjectSetMainPage_workingSetLabel=&Working Set Name:
98
ImportProjectSetMainPage_workingSetLabel=&Working Set Name:
100
ImportProjectSetMainPage_AddToWorkingSet=&Add the imported team project set to a working set
99
ImportProjectSetMainPage_AddToWorkingSet=&Add the imported team project set to a working set
Lines 283-290 Link Here
283
SynchronizationCompareAdapter_0=Workspace
282
SynchronizationCompareAdapter_0=Workspace
284
WorkspaceScope_0=Workspace
283
WorkspaceScope_0=Workspace
285
WorkingSetScope_0=Workspace
284
WorkingSetScope_0=Workspace
286
WorkingSetsDialog_Title=Select a Resource Working Set
285
WorkingSetsDialog_Title=Select a Working Set
287
WorkingSetsDialog_Message=Select an existing working set or type in a new one
286
WorkingSetsDialog_Message=Select an existing working set or enter a new name to create a Resource Working Set
288
WorkingSetsDialog_Label=Working Set:
287
WorkingSetsDialog_Label=Working Set:
289
SubscriberParticipant_namePattern={0} ({1})
288
SubscriberParticipant_namePattern={0} ({1})
290
SubscriberParticipantWizard_0=There are no {0} resources to synchronize
289
SubscriberParticipantWizard_0=There are no {0} resources to synchronize
(-)src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java (-2 / +5 lines)
Lines 30-35 Link Here
30
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
30
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
31
import org.eclipse.team.internal.ccvs.ui.*;
31
import org.eclipse.team.internal.ccvs.ui.*;
32
import org.eclipse.team.internal.ccvs.ui.Policy;
32
import org.eclipse.team.internal.ccvs.ui.Policy;
33
import org.eclipse.team.internal.ui.wizards.WorkingSetsDialog;
33
import org.eclipse.ui.*;
34
import org.eclipse.ui.*;
34
/**
35
/**
35
 * This class acts as an abstract class for checkout operations.
36
 * This class acts as an abstract class for checkout operations.
Lines 514-526 Link Here
514
		IWorkingSet oldSet = manager.getWorkingSet(workingSetName);
515
		IWorkingSet oldSet = manager.getWorkingSet(workingSetName);
515
		if (oldSet == null) {
516
		if (oldSet == null) {
516
			IWorkingSet newSet = manager.createWorkingSet(workingSetName, projects);
517
			IWorkingSet newSet = manager.createWorkingSet(workingSetName, projects);
518
			newSet.setId(WorkingSetsDialog.resourceWorkingSetId);
517
			manager.addWorkingSet(newSet);
519
			manager.addWorkingSet(newSet);
518
		}else {
520
		} else {
519
			//don't overwrite the old elements
521
			//don't overwrite the old elements
520
			IAdaptable[] tempElements = oldSet.getElements();
522
			IAdaptable[] tempElements = oldSet.getElements();
521
			IAdaptable[] finalElementList = new IAdaptable[tempElements.length + projects.length];
523
			IAdaptable[] finalElementList = new IAdaptable[tempElements.length + projects.length];
522
			System.arraycopy(tempElements, 0, finalElementList, 0, tempElements.length);
524
			System.arraycopy(tempElements, 0, finalElementList, 0, tempElements.length);
523
			System.arraycopy(projects, 0,finalElementList, tempElements.length, projects.length);
525
			IAdaptable[] adaptedProjects = oldSet.adaptElements(projects);
526
			System.arraycopy(adaptedProjects, 0,finalElementList, tempElements.length, adaptedProjects.length);
524
			oldSet.setElements(finalElementList);
527
			oldSet.setElements(finalElementList);
525
		}	
528
		}	
526
	}
529
	}
(-)src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsMainPage.java (-9 / +2 lines)
Lines 24-32 Link Here
24
import org.eclipse.swt.layout.GridLayout;
24
import org.eclipse.swt.layout.GridLayout;
25
import org.eclipse.swt.widgets.*;
25
import org.eclipse.swt.widgets.*;
26
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
26
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
27
import org.eclipse.team.internal.ccvs.ui.*;
27
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
28
import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
28
import org.eclipse.team.internal.ui.wizards.WorkingSetsDialog;
29
import org.eclipse.team.internal.ui.wizards.WorkingSetsDialog;
29
import org.eclipse.ui.IWorkingSet;
30
import org.eclipse.ui.PlatformUI;
30
import org.eclipse.ui.PlatformUI;
31
31
32
/**
32
/**
Lines 342-354 Link Here
342
			if (workingSetName.length() == 0) {
342
			if (workingSetName.length() == 0) {
343
				setMessage(CVSUIMessages.CheckoutAsMainPage_EmptyWorkingSetErrorMessage, ERROR);
343
				setMessage(CVSUIMessages.CheckoutAsMainPage_EmptyWorkingSetErrorMessage, ERROR);
344
				return false;
344
				return false;
345
			} else {
346
				// todo: verify name doesn't already exist
347
				IWorkingSet existingSet = CVSUIPlugin.getPlugin().getWorkbench().getWorkingSetManager().getWorkingSet(workingSetName);
348
				if (existingSet != null && !existingSet.getId().equals(WorkingSetsDialog.resourceWorkingSetId)) {
349
					setMessage(CVSUIMessages.CheckoutAsMainPage_WorkingSetExistsErrorMessage, ERROR);
350
					return false;
351
				}
352
			}
345
			}
353
		}
346
		}
354
		setMessage(null);
347
		setMessage(null);

Return to bug 167595