Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 119491 Details for
Bug 150626
[Import/Export] Create working sets when importing several projects.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch v02
WorkingSetSelectionWhileImport 01.txt (text/plain), 6.82 KB, created by
Prakash Rangaraj
on 2008-12-04 06:44:58 EST
(
hide
)
Description:
Patch v02
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2008-12-04 06:44:58 EST
Size:
6.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingProjectsWizardTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingProjectsWizardTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ImportExistingProjectsWizardTest.java >--- Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingProjectsWizardTest.java 4 Dec 2007 18:48:31 -0000 1.2 >+++ Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingProjectsWizardTest.java 4 Dec 2008 11:40:44 -0000 >@@ -946,7 +946,7 @@ > wizard.setDialogSettings(wizardSettings); > wizard.setForcePreviousAndNextButtons(true); > >- WizardProjectsImportPage wpip = new WizardProjectsImportPage(); >+ WizardProjectsImportPage wpip = new WizardProjectsImportPage("WizardProjectsImportPage"); > > Shell shell = getShell(); > >#P org.eclipse.ui.ide >Index: src/org/eclipse/ui/wizards/datatransfer/ExternalProjectImportWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/datatransfer/ExternalProjectImportWizard.java,v >retrieving revision 1.17 >diff -u -r1.17 ExternalProjectImportWizard.java >--- src/org/eclipse/ui/wizards/datatransfer/ExternalProjectImportWizard.java 9 May 2008 14:13:07 -0000 1.17 >+++ src/org/eclipse/ui/wizards/datatransfer/ExternalProjectImportWizard.java 4 Dec 2008 11:40:49 -0000 >@@ -45,6 +45,7 @@ > IImportWizard { > private static final String EXTERNAL_PROJECT_SECTION = "ExternalProjectImportWizard";//$NON-NLS-1$ > private WizardProjectsImportPage mainPage; >+ private IStructuredSelection currentSelection; > > /** > * Constructor for ExternalProjectImportWizard. >@@ -69,7 +70,7 @@ > */ > public void addPages() { > super.addPages(); >- mainPage = new WizardProjectsImportPage(); >+ mainPage = new WizardProjectsImportPage(currentSelection); > addPage(mainPage); > } > >@@ -77,7 +78,8 @@ > * Method declared on IWorkbenchWizard. > */ > public void init(IWorkbench workbench, IStructuredSelection currentSelection) { >- setWindowTitle(DataTransferMessages.DataTransfer_importTitle); >+ this.currentSelection = currentSelection; >+ setWindowTitle(DataTransferMessages.DataTransfer_importTitle); > setDefaultPageImageDescriptor( > IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/importproj_wiz.png")); //$NON-NLS-1$ > >Index: src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java,v >retrieving revision 1.50 >diff -u -r1.50 WizardProjectsImportPage.java >--- src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java 5 May 2008 13:02:51 -0000 1.50 >+++ src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java 4 Dec 2008 11:40:49 -0000 >@@ -56,6 +56,7 @@ > import org.eclipse.jface.viewers.CheckStateChangedEvent; > import org.eclipse.jface.viewers.CheckboxTreeViewer; > import org.eclipse.jface.viewers.ICheckStateListener; >+import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.viewers.ITreeContentProvider; > import org.eclipse.jface.viewers.LabelProvider; > import org.eclipse.jface.viewers.Viewer; >@@ -76,8 +77,12 @@ > import org.eclipse.swt.widgets.FileDialog; > import org.eclipse.swt.widgets.Label; > import org.eclipse.swt.widgets.Text; >+import org.eclipse.ui.IWorkingSet; >+import org.eclipse.ui.IWorkingSetManager; >+import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.actions.WorkspaceModifyOperation; > import org.eclipse.ui.dialogs.IOverwriteQuery; >+import org.eclipse.ui.dialogs.WorkingSetGroup; > import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; > import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; > import org.eclipse.ui.internal.ide.StatusUtil; >@@ -290,12 +295,17 @@ > // to mimize searches > private long lastModified; > >+ private WorkingSetGroup workingSetGroup; >+ >+ private IStructuredSelection currentSelection; >+ > /** > * Creates a new project creation wizard page. > * > */ >- public WizardProjectsImportPage() { >+ public WizardProjectsImportPage(IStructuredSelection currentSelection) { > this("wizardExternalProjectsPage"); //$NON-NLS-1$ >+ this.currentSelection = currentSelection; > } > > /** >@@ -331,12 +341,22 @@ > createProjectsRoot(workArea); > createProjectsList(workArea); > createOptionsArea(workArea); >+ createWorkingSetGroup(workArea); > restoreWidgetValues(); > Dialog.applyDialogFont(workArea); > > } > > /** >+ * @param workArea >+ */ >+ private void createWorkingSetGroup(Composite workArea) { >+ String[] workingSetIds = new String[] {"org.eclipse.ui.resourceWorkingSetPage", //$NON-NLS-1$ >+ "org.eclipse.jdt.ui.JavaWorkingSetPage"}; //$NON-NLS-1$ >+ workingSetGroup = new WorkingSetGroup(workArea, currentSelection, workingSetIds); >+ } >+ >+ /** > * Create the area with the extra options. > * > * @param workArea >@@ -1147,7 +1167,9 @@ > */ > public boolean createProjects() { > saveWidgetValues(); >+ > final Object[] selected = projectsList.getCheckedElements(); >+ createdProjects = new ArrayList(); > WorkspaceModifyOperation op = new WorkspaceModifyOperation() { > protected void execute(IProgressMonitor monitor) > throws InvocationTargetException, InterruptedException { >@@ -1186,9 +1208,27 @@ > } > ArchiveFileManipulations.closeStructureProvider(structureProvider, > getShell()); >+ >+ // Adds the projects to the working sets >+ addToWorkingSets(); >+ > return true; > } > >+ List createdProjects; >+ >+ private void addToWorkingSets() { >+ >+ IWorkingSet[] selectedWorkingSets = workingSetGroup.getSelectedWorkingSets(); >+ if(selectedWorkingSets == null || selectedWorkingSets.length == 0) >+ return; // no Working set is selected >+ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); >+ for (Iterator i = createdProjects.iterator(); i.hasNext();) { >+ IProject project = (IProject) i.next(); >+ workingSetManager.addToWorkingSets(project, selectedWorkingSets); >+ } >+ } >+ > /** > * Performs clean-up if the user cancels the wizard without doing anything > */ >@@ -1210,6 +1250,7 @@ > String projectName = record.getProjectName(); > final IWorkspace workspace = ResourcesPlugin.getWorkspace(); > final IProject project = workspace.getRoot().getProject(projectName); >+ createdProjects.add(project); > if (record.description == null) { > // error case > record.description = workspace.newProjectDescription(projectName);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
pwebster
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 150626
:
119488
|
119489
|
119491
|
127703