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 127703 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]
wizard patch v03
wizard-v03.txt (text/plain), 6.38 KB, created by
Paul Webster
on 2009-03-05 14:55:03 EST
(
hide
)
Description:
wizard patch v03
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2009-03-05 14:55:03 EST
Size:
6.38 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >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.53 >diff -u -r1.53 WizardProjectsImportPage.java >--- src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java 24 Feb 2009 13:55:49 -0000 1.53 >+++ src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java 5 Mar 2009 19:54:08 -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.IColorProvider; > import org.eclipse.jface.viewers.ITreeContentProvider; > import org.eclipse.jface.viewers.LabelProvider; >@@ -78,8 +79,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; >@@ -335,12 +340,16 @@ > // to mimize searches > private long lastModified; > >+ private WorkingSetGroup workingSetGroup; >+ >+ private IStructuredSelection currentSelection; >+ > /** > * Creates a new project creation wizard page. > * > */ > public WizardProjectsImportPage() { >- this("wizardExternalProjectsPage"); //$NON-NLS-1$ >+ this("wizardExternalProjectsPage", null, null); //$NON-NLS-1$ > } > > /** >@@ -349,12 +358,22 @@ > * @param pageName > */ > public WizardProjectsImportPage(String pageName) { >- this(pageName,null); >+ this(pageName,null, null); > } > >- public WizardProjectsImportPage(String pageName,String initialPath) { >+ /** >+ * More (many more) parameters. >+ * >+ * @param pageName >+ * @param initialPath >+ * @param currentSelection >+ * @since 3.5 >+ */ >+ public WizardProjectsImportPage(String pageName,String initialPath, >+ IStructuredSelection currentSelection) { > super(pageName); > this.initialPath = initialPath; >+ this.currentSelection = currentSelection; > setPageComplete(false); > setTitle(DataTransferMessages.WizardProjectsImportPage_ImportProjectsTitle); > setDescription(DataTransferMessages.WizardProjectsImportPage_ImportProjectsDescription); >@@ -381,12 +400,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 >@@ -1205,7 +1234,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 { >@@ -1244,9 +1275,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 > */ >@@ -1268,6 +1317,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); >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.18 >diff -u -r1.18 ExternalProjectImportWizard.java >--- src/org/eclipse/ui/wizards/datatransfer/ExternalProjectImportWizard.java 24 Feb 2009 13:55:49 -0000 1.18 >+++ src/org/eclipse/ui/wizards/datatransfer/ExternalProjectImportWizard.java 5 Mar 2009 19:54:08 -0000 >@@ -45,6 +45,7 @@ > IImportWizard { > private static final String EXTERNAL_PROJECT_SECTION = "ExternalProjectImportWizard";//$NON-NLS-1$ > private WizardProjectsImportPage mainPage; >+ private IStructuredSelection currentSelection = null; > private String initialPath = null; > > /** >@@ -82,7 +83,8 @@ > */ > public void addPages() { > super.addPages(); >- mainPage = new WizardProjectsImportPage("wizardExternalProjectsPage",initialPath); //$NON-NLS-1$ >+ mainPage = new WizardProjectsImportPage( >+ "wizardExternalProjectsPage", initialPath, currentSelection); //$NON-NLS-1$ > addPage(mainPage); > } > >@@ -93,7 +95,7 @@ > setWindowTitle(DataTransferMessages.DataTransfer_importTitle); > setDefaultPageImageDescriptor( > IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/importproj_wiz.png")); //$NON-NLS-1$ >- >+ this.currentSelection = currentSelection; > } > > /* (non-Javadoc)
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
Actions:
View
|
Diff
Attachments on
bug 150626
:
119488
|
119489
|
119491
| 127703