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 64177 Details for
Bug 150009
[build path] allow selecting a working set for new Java project
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]
fix 15-17
fix_150009.txt (text/plain), 6.41 KB, created by
Benno Baumgartner
on 2007-04-18 08:51:40 EDT
(
hide
)
Description:
fix 15-17
Filename:
MIME Type:
Creator:
Benno Baumgartner
Created:
2007-04-18 08:51:40 EDT
Size:
6.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/workingsets/SimpleWorkingSetSelectionDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/SimpleWorkingSetSelectionDialog.java,v >retrieving revision 1.1 >diff -u -r1.1 SimpleWorkingSetSelectionDialog.java >--- ui/org/eclipse/jdt/internal/ui/workingsets/SimpleWorkingSetSelectionDialog.java 16 Apr 2007 13:24:10 -0000 1.1 >+++ ui/org/eclipse/jdt/internal/ui/workingsets/SimpleWorkingSetSelectionDialog.java 18 Apr 2007 12:50:38 -0000 >@@ -122,6 +122,8 @@ > public SimpleWorkingSetSelectionDialog(Shell shell, IWorkingSet[] workingSet, String[] workingSetIDs) { > super(shell); > setTitle(WorkingSetMessages.SimpleWorkingSetSelectionDialog_SimpleSelectWorkingSetDialog_title); >+ setHelpAvailable(false); >+ setShellStyle(getShellStyle() | SWT.RESIZE); > fWorkingSet= workingSet; > fWorkingSetIDs= workingSetIDs; > } >Index: ui/org/eclipse/jdt/internal/ui/wizards/JavaProjectWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/JavaProjectWizard.java,v >retrieving revision 1.22 >diff -u -r1.22 JavaProjectWizard.java >--- ui/org/eclipse/jdt/internal/ui/wizards/JavaProjectWizard.java 18 Apr 2007 09:40:38 -0000 1.22 >+++ ui/org/eclipse/jdt/internal/ui/wizards/JavaProjectWizard.java 18 Apr 2007 12:50:38 -0000 >@@ -19,6 +19,7 @@ > import org.eclipse.core.runtime.IExecutableExtension; > import org.eclipse.core.runtime.IProgressMonitor; > >+import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; > > import org.eclipse.jface.viewers.IStructuredSelection; >@@ -77,25 +78,32 @@ > public boolean performFinish() { > boolean res= super.performFinish(); > if (res) { >- IJavaElement newElement= getCreatedElement(); >+ final IJavaElement newElement= getCreatedElement(); > > IWorkingSet[] workingSets= fFirstPage.getWorkingSets(); > for (int i= 0; i < workingSets.length; i++) { > IWorkingSet workingSet= workingSets[i]; >- IAdaptable[] elements= workingSet.getElements(); >- IAdaptable[] newElements= new IAdaptable[elements.length + 1]; >- System.arraycopy(elements, 0, newElements, 0, elements.length); >- newElements[newElements.length - 1]= newElement; >- workingSet.setElements(workingSet.adaptElements(newElements)); >+ IAdaptable[] adaptedNewElements= workingSet.adaptElements(new IAdaptable[] {newElement}); >+ if (adaptedNewElements.length == 1) { >+ IAdaptable[] elements= workingSet.getElements(); >+ IAdaptable[] newElements= new IAdaptable[elements.length + 1]; >+ System.arraycopy(elements, 0, newElements, 0, elements.length); >+ newElements[newElements.length - 1]= adaptedNewElements[0]; >+ workingSet.setElements(newElements); >+ } > } > > BasicNewProjectResourceWizard.updatePerspective(fConfigElement); >- PackageExplorerPart activePackageExplorer= getActivePackageExplorer(); >- if (activePackageExplorer == null) { >- selectAndReveal(fSecondPage.getJavaProject().getProject()); >- } else { >- activePackageExplorer.tryToReveal(newElement); >- } >+ selectAndReveal(fSecondPage.getJavaProject().getProject()); >+ >+ Display.getDefault().asyncExec(new Runnable() { >+ public void run() { >+ PackageExplorerPart activePackageExplorer= getActivePackageExplorer(); >+ if (activePackageExplorer != null) { >+ activePackageExplorer.tryToReveal(newElement); >+ } >+ } >+ }); > } > return res; > } >@@ -130,6 +138,41 @@ > } > > private IWorkingSet[] getWorkingSets(IStructuredSelection selection) { >+ IWorkingSet selected= getSelectedWorkingSet(selection); >+ if (selected != null) >+ return new IWorkingSet[] {selected}; >+ >+ PackageExplorerPart explorerPart= getActivePackageExplorer(); >+ if (explorerPart == null) >+ return null; >+ >+ if (explorerPart.getRootMode() == ViewActionGroup.SHOW_PROJECTS) { >+ //Get active filter >+ IWorkingSet filterWorkingSet= explorerPart.getFilterWorkingSet(); >+ if (filterWorkingSet == null) >+ return null; >+ >+ if (!isValidWorkingSet(filterWorkingSet)) >+ return null; >+ >+ return new IWorkingSet[] {filterWorkingSet}; >+ } else if (explorerPart.getRootMode() == ViewActionGroup.SHOW_WORKING_SETS) { >+ //If we have been gone into a working set return the working set >+ Object input= explorerPart.getViewPartInput(); >+ if (!(input instanceof IWorkingSet)) >+ return null; >+ >+ IWorkingSet workingSet= (IWorkingSet)input; >+ if (!isValidWorkingSet(workingSet)) >+ return null; >+ >+ return new IWorkingSet[] {workingSet}; >+ } >+ >+ return null; >+ } >+ >+ private IWorkingSet getSelectedWorkingSet(IStructuredSelection selection) { > if (!(selection instanceof ITreeSelection)) > return null; > >@@ -148,39 +191,14 @@ > return null; > > Object candidate= path.getSegment(0); >- if (candidate instanceof IWorkingSet) { >- if (isValidWorkingSet((IWorkingSet)candidate)) >- return new IWorkingSet[] {(IWorkingSet)candidate}; >- } else { >- PackageExplorerPart explorerPart= getActivePackageExplorer(); >- if (explorerPart == null) >- return null; >+ if (!(candidate instanceof IWorkingSet)) >+ return null; > >- if (explorerPart.getRootMode() == ViewActionGroup.SHOW_PROJECTS) { >- //Get active filter >- IWorkingSet filterWorkingSet= explorerPart.getFilterWorkingSet(); >- if (filterWorkingSet == null) >- return null; >- >- if (!isValidWorkingSet(filterWorkingSet)) >- return null; >- >- return new IWorkingSet[] {filterWorkingSet}; >- } else if (explorerPart.getRootMode() == ViewActionGroup.SHOW_WORKING_SETS) { >- //If we have been gone into a working set return the working set >- Object input= explorerPart.getViewPartInput(); >- if (!(input instanceof IWorkingSet)) >- return null; >- >- IWorkingSet workingSet= (IWorkingSet)input; >- if (!isValidWorkingSet(workingSet)) >- return null; >- >- return new IWorkingSet[] {workingSet}; >- } >- } >+ IWorkingSet result= (IWorkingSet)candidate; >+ if (!isValidWorkingSet(result)) >+ return null; > >- return null; >+ return result; > } > > private PackageExplorerPart getActivePackageExplorer() { >@@ -208,5 +226,5 @@ > > return true; > } >- >+ > }
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 150009
:
63899
|
64028
|
64151
| 64177