1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 18:35:32 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-09-11 18:54:40 -07:00
parent 24233a0c60
commit bb0f0865d8
2 changed files with 19 additions and 26 deletions

View file

@ -9,7 +9,6 @@
* Anton Leherbauer (Wind River Systems) - initial API and implementation * Anton Leherbauer (Wind River Systems) - initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.browser.opentype; package org.eclipse.cdt.internal.ui.browser.opentype;
import java.util.Arrays; import java.util.Arrays;
@ -62,12 +61,10 @@ import org.eclipse.cdt.internal.ui.ICHelpContextIds;
* @noextend This class is not intended to be subclassed by clients. * @noextend This class is not intended to be subclassed by clients.
*/ */
public class ElementSelectionDialog extends TypeSelectionDialog { public class ElementSelectionDialog extends TypeSelectionDialog {
/** /**
* Job to update the element list in the background. * Job to update the element list in the background.
*/ */
private class UpdateElementsJob extends Job { private class UpdateElementsJob extends Job {
/** /**
* The last used prefix to query the index. <code>null</code> means * The last used prefix to query the index. <code>null</code> means
* the query result should be empty. * the query result should be empty.
@ -111,14 +108,12 @@ public class ElementSelectionDialog extends TypeSelectionDialog {
} }
return Status.CANCEL_STATUS; return Status.CANCEL_STATUS;
} }
} }
/** /**
* A job listener for simple job status reporting. * A job listener for simple job status reporting.
*/ */
private final class UpdateJobListener extends JobChangeAdapter { private final class UpdateJobListener extends JobChangeAdapter {
boolean fDone; boolean fDone;
private IProgressMonitor fMonitor; private IProgressMonitor fMonitor;
@ -326,10 +321,10 @@ public class ElementSelectionDialog extends TypeSelectionDialog {
} finally { } finally {
index.releaseReadLock(); index.releaseReadLock();
} }
} catch(CoreException ce) { } catch (CoreException e) {
CUIPlugin.log(ce); CUIPlugin.log(e);
} catch(InterruptedException ie) { } catch (InterruptedException e) {
CUIPlugin.log(ie); CUIPlugin.log(e);
} }
} }
return types.toArray(new ITypeInfo[types.size()]); return types.toArray(new ITypeInfo[types.size()]);
@ -393,8 +388,8 @@ public class ElementSelectionDialog extends TypeSelectionDialog {
} }
int asterisk= userFilter.indexOf("*"); //$NON-NLS-1$ int asterisk= userFilter.indexOf("*"); //$NON-NLS-1$
int questionMark= userFilter.indexOf("?"); //$NON-NLS-1$ int questionMark= userFilter.indexOf("?"); //$NON-NLS-1$
int prefixEnd = asterisk < 0 ? questionMark int prefixEnd = asterisk < 0 ? questionMark :
: (questionMark < 0 ? asterisk : Math.min(asterisk, questionMark)); questionMark < 0 ? asterisk : Math.min(asterisk, questionMark);
return (prefixEnd == -1 ? userFilter : userFilter.substring(0, prefixEnd)).toCharArray(); return (prefixEnd == -1 ? userFilter : userFilter.substring(0, prefixEnd)).toCharArray();
} }
@ -406,5 +401,4 @@ public class ElementSelectionDialog extends TypeSelectionDialog {
} }
return new String(currentPrefix).equals(new String(newPrefix, 0, currentPrefix.length)); return new String(currentPrefix).equals(new String(newPrefix, 0, currentPrefix.length));
} }
} }

View file

@ -15,7 +15,6 @@ import org.eclipse.cdt.ui.browser.typeinfo.TypeSelectionDialog;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
public class NamespaceSelectionDialog extends TypeSelectionDialog { public class NamespaceSelectionDialog extends TypeSelectionDialog {
private static final String DIALOG_SETTINGS = NamespaceSelectionDialog.class.getName(); private static final String DIALOG_SETTINGS = NamespaceSelectionDialog.class.getName();
private static final int[] VISIBLE_TYPES = { ICElement.C_NAMESPACE }; private static final int[] VISIBLE_TYPES = { ICElement.C_NAMESPACE };