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 23187 Details for
Bug 97120
[search] SearchEngine.createHierarchyScope() proposes an empty list in a TypeDialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch against open type action
OpenTypeAction.patch (text/plain), 3.32 KB, created by
Dirk Baeumer
on 2005-06-15 09:52:50 EDT
(
hide
)
Description:
Patch against open type action
Filename:
MIME Type:
Creator:
Dirk Baeumer
Created:
2005-06-15 09:52:50 EDT
Size:
3.32 KB
patch
obsolete
>Index: OpenTypeAction.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenTypeAction.java,v >retrieving revision 1.31 >diff -u -r1.31 OpenTypeAction.java >--- OpenTypeAction.java 27 Apr 2005 17:42:28 -0000 1.31 >+++ OpenTypeAction.java 15 Jun 2005 13:49:32 -0000 >@@ -12,6 +12,8 @@ > > import org.eclipse.core.runtime.CoreException; > >+import org.eclipse.core.resources.ResourcesPlugin; >+ > import org.eclipse.swt.widgets.Shell; > > import org.eclipse.jface.action.Action; >@@ -24,8 +26,13 @@ > import org.eclipse.ui.IWorkbenchWindowActionDelegate; > import org.eclipse.ui.PlatformUI; > >+import org.eclipse.jdt.core.IJavaModel; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.IType; >+import org.eclipse.jdt.core.JavaCore; >+import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.core.search.IJavaSearchConstants; >+import org.eclipse.jdt.core.search.SearchEngine; > > import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; > import org.eclipse.jdt.internal.ui.JavaPlugin; >@@ -47,28 +54,37 @@ > } > > public void run() { >- Shell parent= JavaPlugin.getActiveWorkbenchShell(); >- OpenTypeSelectionDialog2 dialog= new OpenTypeSelectionDialog2(parent, false, >- PlatformUI.getWorkbench().getProgressService(), >- null, IJavaSearchConstants.TYPE); >- dialog.setTitle(JavaUIMessages.OpenTypeAction_dialogTitle); >- dialog.setMessage(JavaUIMessages.OpenTypeAction_dialogMessage); >- >- int result= dialog.open(); >- if (result != IDialogConstants.OK_ID) >- return; >- >- Object[] types= dialog.getResult(); >- if (types != null && types.length > 0) { >- IType type= (IType)types[0]; >- try { >- IEditorPart part= EditorUtility.openInEditor(type, true); >- EditorUtility.revealInEditor(part, type); >- } catch (CoreException x) { >- String title= JavaUIMessages.OpenTypeAction_errorTitle; >- String message= JavaUIMessages.OpenTypeAction_errorMessage; >- ExceptionHandler.handle(x, title, message); >+ try { >+ Shell parent= JavaPlugin.getActiveWorkbenchShell(); >+ IJavaModel model= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); >+ IJavaProject p= model.getJavaProject("XX"); >+ IType tt= p.findType("java.lang.Throwable"); >+ OpenTypeSelectionDialog2 dialog= new OpenTypeSelectionDialog2(parent, false, >+ PlatformUI.getWorkbench().getProgressService(), >+ SearchEngine.createHierarchyScope(tt), >+ IJavaSearchConstants.TYPE); >+ dialog.setTitle(JavaUIMessages.OpenTypeAction_dialogTitle); >+ dialog.setMessage(JavaUIMessages.OpenTypeAction_dialogMessage); >+ >+ int result= dialog.open(); >+ if (result != IDialogConstants.OK_ID) >+ return; >+ >+ Object[] types= dialog.getResult(); >+ if (types != null && types.length > 0) { >+ IType type= (IType)types[0]; >+ try { >+ IEditorPart part= EditorUtility.openInEditor(type, true); >+ EditorUtility.revealInEditor(part, type); >+ } catch (CoreException x) { >+ String title= JavaUIMessages.OpenTypeAction_errorTitle; >+ String message= JavaUIMessages.OpenTypeAction_errorMessage; >+ ExceptionHandler.handle(x, title, message); >+ } > } >+ } catch (JavaModelException e) { >+ // TODO Auto-generated catch block >+ e.printStackTrace(); > } > } >
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 97120
: 23187 |
23189
|
23298