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 60055 Details for
Bug 172142
'Open Type' does not indicate that it is indexing.
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]
Proposition of changes
patch_172142_20070301.txt (text/plain), 6.34 KB, created by
Krzysztof Michalski
on 2007-03-01 05:55:03 EST
(
hide
)
Description:
Proposition of changes
Filename:
MIME Type:
Creator:
Krzysztof Michalski
Created:
2007-03-01 05:55:03 EST
Size:
6.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java,v >retrieving revision 1.7 >diff -u -r1.7 FilteredTypesSelectionDialog.java >--- ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java 28 Feb 2007 14:34:39 -0000 1.7 >+++ ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java 1 Mar 2007 10:45:48 -0000 >@@ -13,6 +13,7 @@ > import java.io.IOException; > import java.io.StringReader; > import java.io.StringWriter; >+import java.lang.reflect.InvocationTargetException; > import java.text.MessageFormat; > import java.util.ArrayList; > import java.util.Comparator; >@@ -26,6 +27,9 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.SubProgressMonitor; >+import org.eclipse.core.runtime.jobs.IJobManager; >+import org.eclipse.core.runtime.jobs.Job; > > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.layout.GridData; >@@ -39,6 +43,7 @@ > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.operation.IRunnableContext; >+import org.eclipse.jface.operation.IRunnableWithProgress; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.util.IPropertyChangeListener; > import org.eclipse.jface.util.PropertyChangeEvent; >@@ -71,6 +76,7 @@ > import org.eclipse.jdt.core.search.SearchEngine; > import org.eclipse.jdt.core.search.TypeNameMatch; > import org.eclipse.jdt.core.search.TypeNameMatchRequestor; >+import org.eclipse.jdt.core.search.TypeNameRequestor; > > import org.eclipse.jdt.internal.corext.util.Messages; > import org.eclipse.jdt.internal.corext.util.OpenTypeHistory; >@@ -84,6 +90,7 @@ > import org.eclipse.jdt.launching.LibraryLocation; > > import org.eclipse.jdt.ui.JavaElementLabels; >+import org.eclipse.jdt.ui.JavaUI; > import org.eclipse.jdt.ui.dialogs.ITypeInfoFilterExtension; > import org.eclipse.jdt.ui.dialogs.ITypeInfoImageProvider; > import org.eclipse.jdt.ui.dialogs.TypeSelectionExtension; >@@ -92,6 +99,7 @@ > import org.eclipse.jdt.internal.ui.JavaPlugin; > import org.eclipse.jdt.internal.ui.JavaUIMessages; > import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; >+import org.eclipse.jdt.internal.ui.util.ExceptionHandler; > import org.eclipse.jdt.internal.ui.util.TypeNameMatchLabelProvider; > import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; > import org.eclipse.jdt.internal.ui.workingsets.WorkingSetFilterActionGroup; >@@ -129,6 +137,10 @@ > private ISelectionStatusValidator fValidator; > > private TypeInfoUtil fTypeInfoUtil; >+ >+ private IRunnableContext fRunnableContext; >+ >+ private static boolean fgFirstTime= true; > > /** > * Creates new FilteredTypesSelectionDialog instance >@@ -185,6 +197,8 @@ > */ > public FilteredTypesSelectionDialog(Shell shell, boolean multi, IRunnableContext context, IJavaSearchScope scope, int elementKinds, TypeSelectionExtension extension) { > super(shell, multi); >+ >+ fRunnableContext= context; > > setSelectionHistory(new TypeSelectionHistory()); > >@@ -404,6 +418,17 @@ > * @see org.eclipse.jface.window.Window#open() > */ > public int open() { >+ >+ try { >+ ensureConsistency(); >+ } catch (InvocationTargetException e) { >+ ExceptionHandler.handle(e, JavaUIMessages.TypeSelectionDialog_error3Title, JavaUIMessages.TypeSelectionDialog_error3Message); >+ return CANCEL; >+ } catch (InterruptedException e) { >+ // cancelled by user >+ return CANCEL; >+ } >+ > if (getInitialPattern() == null) { > IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow(); > if (window != null) { >@@ -514,6 +539,62 @@ > private void setSearchScope(IJavaSearchScope scope) { > fSearchScope= scope; > } >+ >+ private void ensureConsistency() throws InvocationTargetException, InterruptedException { >+ // we only have to ensure history consistency here since the search engine >+ // takes care of working copies. >+ class ConsistencyRunnable implements IRunnableWithProgress { >+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { >+ if (fgFirstTime) { >+ // Join the initialize after load job. >+ IJobManager manager= Job.getJobManager(); >+ manager.join(JavaUI.ID_PLUGIN, monitor); >+ } >+ OpenTypeHistory history= OpenTypeHistory.getInstance(); >+ if (fgFirstTime || history.isEmpty()) { >+ monitor.beginTask(JavaUIMessages.TypeSelectionDialog_progress_consistency, 100); >+ if (history.needConsistencyCheck()) { >+ refreshSearchIndices(new SubProgressMonitor(monitor, 90)); >+ history.checkConsistency(new SubProgressMonitor(monitor, 10)); >+ } else { >+ refreshSearchIndices(monitor); >+ } >+ monitor.done(); >+ fgFirstTime= false; >+ } else { >+ history.checkConsistency(monitor); >+ } >+ } >+ public boolean needsExecution() { >+ OpenTypeHistory history= OpenTypeHistory.getInstance(); >+ return fgFirstTime || history.isEmpty() || history.needConsistencyCheck(); >+ } >+ private void refreshSearchIndices(IProgressMonitor monitor) throws InvocationTargetException { >+ try { >+ new SearchEngine().searchAllTypeNames( >+ null, >+ 0, >+ // make sure we search a concrete name. This is faster according to Kent >+ "_______________".toCharArray(), //$NON-NLS-1$ >+ SearchPattern.RULE_EXACT_MATCH | SearchPattern.RULE_CASE_SENSITIVE, >+ IJavaSearchConstants.ENUM, >+ SearchEngine.createWorkspaceScope(), >+ new TypeNameRequestor() {}, >+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, >+ monitor); >+ } catch (JavaModelException e) { >+ throw new InvocationTargetException(e); >+ } >+ } >+ } >+ ConsistencyRunnable runnable= new ConsistencyRunnable(); >+ if (!runnable.needsExecution()) >+ return; >+ IRunnableContext context= fRunnableContext != null >+ ? fRunnableContext >+ : PlatformUI.getWorkbench().getProgressService(); >+ context.run(true, true, runnable); >+ } > > /** > * The <code>ShowContainerForDuplicatesAction</code> provides means to
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 172142
: 60055