issue_id
int64
2.04k
425k
title
stringlengths
9
251
body
stringlengths
4
32.8k
status
stringclasses
6 values
after_fix_sha
stringlengths
7
7
project_name
stringclasses
6 values
repo_url
stringclasses
6 values
repo_name
stringclasses
6 values
language
stringclasses
1 value
issue_url
null
before_fix_sha
null
pull_url
null
commit_datetime
timestamp[us, tz=UTC]
report_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
23
187
chunk_content
stringlengths
1
22k
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
Object getFirstElement(Object object) { if (object instanceof StructuredSelection) return ((StructuredSelection)object).getFirstElement(); if (object instanceof Collection) { Collection col= (Collection)object; if (col.isEmpty()) return null; else return col.iterator().next(); } if (object instanceof Object[]) { Object[] array= (Object[])object; if (array.length > 0) return array[0]; else return null; } return object; } /** * Gets the typeComparator. * @return Returns a JavaElementTypeComparator */ protected Comparator getTypeComparator() { return fTypeComparator; } /** * Links to editor (if option enabled) */
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
private void linkToEditor(IStructuredSelection selection) { if (selection == null || selection.isEmpty()) return; Object obj= selection.getFirstElement(); Object element= null; if (selection.size() == 1) { if (obj instanceof IJavaElement) { IJavaElement cu= JavaModelUtil.findElementOfKind((IJavaElement)obj, IJavaElement.COMPILATION_UNIT); if (cu != null) element= getResourceFor(cu); if (element == null) element= JavaModelUtil.findElementOfKind((IJavaElement)obj, IJavaElement.CLASS_FILE); } else if (obj instanceof IFile) element= obj; if (element == null) return; IWorkbenchPage page= getSite().getPage(); IEditorPart editorArray[]= page.getEditors(); for (int i= 0; i < editorArray.length; ++i) { IEditorPart editor= editorArray[i]; Object input= getElementOfInput(editor.getEditorInput()); if (input != null && input.equals(element)) { page.bringToTop(editor); if (obj instanceof IJavaElement) EditorUtility.revealInEditor(editor, (IJavaElement) obj); return; } }
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
} } private void setSelectionFromEditor(IWorkbenchPart part) { if (part == null) return; IWorkbenchPartSite site= part.getSite(); if (site == null) return; ISelectionProvider provider= site.getSelectionProvider(); if (provider != null) setSelectionFromEditor(part, provider.getSelection()); } private void setSelectionFromEditor(IWorkbenchPart part, ISelection selection) { if (part instanceof IEditorPart && JavaBrowsingPreferencePage.linkViewSelectionToEditor()) { IEditorInput ei= ((IEditorPart)part).getEditorInput(); if (selection instanceof ITextSelection) { int offset= ((ITextSelection)selection).getOffset(); IJavaElement element= getElementForInputAt(ei, offset); if (element != null) { adjustInputAndSetSelection(element); return; } } if (ei instanceof IFileEditorInput) { IFile file= ((IFileEditorInput)ei).getFile(); IJavaElement je= (IJavaElement)file.getAdapter(IJavaElement.class); if (je == null) { setSelection(null, false); return; }
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
adjustInputAndSetSelection(je); } else if (ei instanceof IClassFileEditorInput) { IClassFile cf= ((IClassFileEditorInput)ei).getClassFile(); adjustInputAndSetSelection(cf); } return; } } /** * Returns the element contained in the EditorInput */ Object getElementOfInput(IEditorInput input) { if (input instanceof IClassFileEditorInput) return ((IClassFileEditorInput)input).getClassFile(); else if (input instanceof IFileEditorInput) return ((IFileEditorInput)input).getFile(); else if (input instanceof JarEntryEditorInput) return ((JarEntryEditorInput)input).getStorage(); return null; } private IResource getResourceFor(Object element) { if (element instanceof IJavaElement) { if (element instanceof IWorkingCopy) { IWorkingCopy wc= (IWorkingCopy)element; IJavaElement original= wc.getOriginalElement(); if (original != null) element= original; }
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
try { element= ((IJavaElement)element).getUnderlyingResource(); } catch (JavaModelException e) { return null; } } if (!(element instanceof IResource) || ((IResource)element).isPhantom()) { return null; } return (IResource)element; } private void setSelection(ISelection selection, boolean reveal) { if (selection != null && selection.equals(fViewer.getSelection())) return; fProcessSelectionEvents= false; fViewer.setSelection(selection, reveal); fProcessSelectionEvents= true; } /** * Tries to find the given element in a workingcopy. */ protected static IJavaElement getWorkingCopy(IJavaElement input) { try { if (input instanceof ICompilationUnit) return EditorUtility.getWorkingCopy((ICompilationUnit)input); else return EditorUtility.getWorkingCopy(input, true); } catch (JavaModelException ex) { } return null;
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
} /** * Returns the original element from which the specified working copy * element was created from. This is a handle only method, the * returned element may or may not exist. * * @param workingCopy the element for which to get the original * @return the original Java element or <code>null</code> if this is not a working copy element */ protected static IJavaElement getOriginal(IJavaElement workingCopy) { ICompilationUnit cu= getCompilationUnit(workingCopy); if (cu != null) return ((IWorkingCopy)cu).getOriginal(workingCopy); return null; } /** * Returns the compilation unit for the given java element. * * @param element the java element whose compilation unit is searched for * @return the compilation unit of the given java element */ protected static ICompilationUnit getCompilationUnit(IJavaElement element) { if (element == null) return null; if (element instanceof IMember) return ((IMember) element).getCompilationUnit(); int type= element.getElementType(); if (IJavaElement.COMPILATION_UNIT == type)
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
return (ICompilationUnit) element; if (IJavaElement.CLASS_FILE == type) return null; return getCompilationUnit(element.getParent()); } /** * Converts the given Java element to one which is suitable for this * view. It takes into account wether the view shows working copies or not. * * @param element the Java element to be converted * @return an element suitable for this view */ protected IJavaElement getSuitableJavaElement(Object obj) { if (!(obj instanceof IJavaElement)) return null; IJavaElement element= (IJavaElement)obj; if (fTypeComparator.compare(element, IJavaElement.COMPILATION_UNIT) > 0) return element; if (element.getElementType() == IJavaElement.CLASS_FILE) return element; if (((BaseJavaElementContentProvider)getViewer().getContentProvider()).getProvideWorkingCopy()) { IJavaElement wc= getWorkingCopy(element); if (wc != null) element= wc; return element; } else { ICompilationUnit cu= getCompilationUnit(element); if (cu != null && ((IWorkingCopy)cu).isWorkingCopy())
9,666
Bug 9666 Browser Perspective: No Code Generation Actions
20020212 Add getter/setter. override ect not avaiable in browser perspective Need to use GenerateGroup
resolved fixed
8ef1f2c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-26T16:00:24Z
2002-02-13T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
return ((IWorkingCopy)cu).getOriginal(element); else return element; } } /** * @see JavaEditor#getElementAt(int) */ protected IJavaElement getElementForInputAt(IEditorInput input, int offset) { if (input instanceof IClassFileEditorInput) { try { return ((IClassFileEditorInput)input).getClassFile().getElementAt(offset); } catch (JavaModelException ex) { return null; } } IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); ICompilationUnit unit= manager.getWorkingCopy(input); if (unit != null) synchronized (unit) { try { unit.reconcile(); return unit.getElementAt(offset); } catch (JavaModelException x) { } } return null; } }
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.search; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.search.ui.ISearchResultViewEntry; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider; import org.eclipse.jdt.internal.ui.dialogs.ElementListSelectionDialog; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; /** * Abstract class for actions that run on IJavaElement. */ public abstract class JavaElementAction extends Action {
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
protected static final IJavaElement RETURN_WITHOUT_BEEP= JavaCore.create(JavaPlugin.getDefault().getWorkspace().getRoot()); private Class[] fValidTypes; public JavaElementAction(String label, Class[] validTypes) {
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
super(label); fValidTypes= validTypes; } public boolean canOperateOn(IStructuredSelection sel) { boolean hasSelection= !sel.isEmpty(); if (!hasSelection || fValidTypes == null) return hasSelection; if (fValidTypes.length == 0) return false; IJavaElement element= getJavaElement(sel, true); if (element != null) { for (int i= 0; i < fValidTypes.length; i++) { if (fValidTypes[i].isInstance(element)) return true; } } return false; } public void run() { if (!canOperateOn(getSelection())) { beep(); return; } IJavaElement element= getJavaElement(getSelection(), false); if (element == null) { beep(); return; } else if (element == RETURN_WITHOUT_BEEP)
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
return; run(element); } protected abstract void run(IJavaElement element); private IJavaElement getJavaElement(IJavaElement o, boolean silent) { if (o == null) return null; switch (o.getElementType()) { case IJavaElement.COMPILATION_UNIT: return findType((ICompilationUnit)o, silent); case IJavaElement.CLASS_FILE: return findType((IClassFile)o); } return o; } private IJavaElement getJavaElement(IMarker o, boolean silent) { try { return getJavaElement(JavaCore.create((String) ((IMarker) o).getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID)), silent); } catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); return null; } } private IJavaElement getJavaElement(Object o, boolean silent) { if (o instanceof IJavaElement) return getJavaElement((IJavaElement)o, silent); else if (o instanceof IMarker) return getJavaElement((IMarker)o, silent); else if (o instanceof ISelection)
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
return getJavaElement((IStructuredSelection)o, silent); else if (o instanceof ISearchResultViewEntry) return getJavaElement((ISearchResultViewEntry)o, silent); return null; } private IJavaElement getJavaElement(ISearchResultViewEntry entry, boolean silent) { if (entry != null) return getJavaElement(entry.getSelectedMarker(), silent); return null; } protected IJavaElement getJavaElement(IStructuredSelection selection, boolean silent) { if (selection.size() == 1) return getJavaElement(selection.getFirstElement(), silent); return null; } public IStructuredSelection getSelection() { IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow(); if (window != null) return StructuredSelectionProvider.createFrom(window.getSelectionService()).getSelection(); else return StructuredSelection.EMPTY; } private IJavaElement chooseFromList(IJavaElement[] openChoices) { int flags= JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_QUALIFIED; ILabelProvider labelProvider= new JavaElementLabelProvider(flags); ElementListSelectionDialog dialog= new ElementListSelectionDialog(JavaPlugin.getActiveWorkbenchShell(), labelProvider); dialog.setTitle(SearchMessages.getString("SearchElementSelectionDialog.title")); dialog.setMessage(SearchMessages.getString("SearchElementSelectionDialog.message")); dialog.setElements(openChoices);
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
if (dialog.open() == dialog.OK) return (IJavaElement)dialog.getFirstResult(); return null; } /** * Answers if a dialog should prompt the user for a unique Java element */ protected boolean shouldUserBePrompted() { return true; } protected void beep() { Shell shell= JavaPlugin.getActiveWorkbenchShell(); if (shell != null && shell.getDisplay() != null) shell.getDisplay().beep(); } protected IJavaElement findType(ICompilationUnit cu, boolean silent) { IType[] types= null; try { types= cu.getAllTypes(); } catch (JavaModelException ex) { ExceptionHandler.log(ex, SearchMessages.getString("OpenTypeAction.error.open.message")); if (silent) return RETURN_WITHOUT_BEEP; else return null; } if (types.length == 1 || (silent && types.length > 0)) return types[0];
10,276
Bug 10276 Search dialog has wrong labels
null
resolved fixed
0875ffb
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-02-28T09:30:38Z
2002-02-26T16:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
if (silent) return RETURN_WITHOUT_BEEP; if (types.length == 0) return null; String title= SearchMessages.getString("ShowTypeHierarchyAction.selectionDialog.title"); String message = SearchMessages.getString("ShowTypeHierarchyAction.selectionDialog.message"); Shell parent= JavaPlugin.getActiveWorkbenchShell(); int flags= (JavaElementLabelProvider.SHOW_DEFAULT); ElementListSelectionDialog dialog= new ElementListSelectionDialog(parent, new JavaElementLabelProvider(flags)); dialog.setTitle(title); dialog.setMessage(message); dialog.setElements(types); if (dialog.open() == dialog.OK) return (IType)dialog.getFirstResult(); else return RETURN_WITHOUT_BEEP; } protected IType findType(IClassFile cf) { IType mainType; try { mainType= cf.getType(); } catch (JavaModelException ex) { ExceptionHandler.log(ex, SearchMessages.getString("OpenTypeAction.error.open.message")); return null; } return mainType; } }
5,793
Bug 5793 Searching and search result presentation
I should be able to tell search whether it should consider potential matcher or not. Often I use search for references as the peer operation to open on selection, i.e., e.g., I know there is exactly one caller and I want to jump to it. In addition, potential matches should be presented at the end of the result list and not at it's beginning.
resolved fixed
4bf90d7
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:07:59Z
2001-11-12T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultLabelProvider.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.search; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.swt.graphics.Image; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.search.ui.ISearchResultViewEntry; import org.eclipse.jdt.core.IImportDeclaration; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.search.IJavaSearchResultCollector; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; public class JavaSearchResultLabelProvider extends LabelProvider {
5,793
Bug 5793 Searching and search result presentation
I should be able to tell search whether it should consider potential matcher or not. Often I use search for references as the peer operation to open on selection, i.e., e.g., I know there is exactly one caller and I want to jump to it. In addition, potential matches should be presented at the end of the result list and not at it's beginning.
resolved fixed
4bf90d7
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:07:59Z
2001-11-12T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultLabelProvider.java
public static final int SHOW_ELEMENT_CONTAINER= 1; public static final int SHOW_CONTAINER_ELEMENT= 2; public static final int SHOW_PATH= 3; private JavaElementLabelProvider fLabelProvider; private int fTextFlags= 0; private IMarker fLastMarker; private IJavaElement fLastJavaElement; private StringBuffer fBufffer= new StringBuffer(50); public static final JavaSearchResultLabelProvider INSTANCE= new JavaSearchResultLabelProvider(); public JavaSearchResultLabelProvider() { fLabelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_OVERLAY_ICONS | JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_ROOT | JavaElementLabelProvider.SHOW_QUALIFIED); } public String getText(Object o) { fLastMarker= null; IJavaElement javaElement= getJavaElement(o); boolean isAccurate= true; if (fLastMarker != null && (fLastMarker.getAttribute(IJavaSearchUIConstants.ATT_ACCURACY, -1) == IJavaSearchResultCollector.POTENTIAL_MATCH))
5,793
Bug 5793 Searching and search result presentation
I should be able to tell search whether it should consider potential matcher or not. Often I use search for references as the peer operation to open on selection, i.e., e.g., I know there is exactly one caller and I want to jump to it. In addition, potential matches should be presented at the end of the result list and not at it's beginning.
resolved fixed
4bf90d7
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:07:59Z
2001-11-12T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultLabelProvider.java
isAccurate= false; if (javaElement == null) { if (fLastMarker != null) { if (isAccurate) return fLabelProvider.getText(fLastMarker.getResource()); else return "?: " + fLabelProvider.getText(fLastMarker.getResource()); } else return ""; } if (javaElement instanceof IImportDeclaration) javaElement= ((IImportDeclaration)javaElement).getParent().getParent(); fBufffer.setLength(0); if (!isAccurate) fBufffer.append("?: "); JavaElementLabels.getElementLabel(javaElement, fTextFlags, fBufffer); return fBufffer.toString(); } public Image getImage(Object o) { IJavaElement javaElement= getJavaElement(o); if (javaElement == null) return null; return fLabelProvider.getImage(javaElement); } public void setOrder(int orderFlag) { if (orderFlag == SHOW_ELEMENT_CONTAINER) fTextFlags = JavaElementLabels.F_POST_QUALIFIED | JavaElementLabels.M_POST_QUALIFIED | JavaElementLabels.I_POST_QUALIFIED | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.T_POST_QUALIFIED | JavaElementLabels.D_POST_QUALIFIED | JavaElementLabels.CF_POST_QUALIFIED | JavaElementLabels.CU_POST_QUALIFIED;
5,793
Bug 5793 Searching and search result presentation
I should be able to tell search whether it should consider potential matcher or not. Often I use search for references as the peer operation to open on selection, i.e., e.g., I know there is exactly one caller and I want to jump to it. In addition, potential matches should be presented at the end of the result list and not at it's beginning.
resolved fixed
4bf90d7
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:07:59Z
2001-11-12T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultLabelProvider.java
else if (orderFlag == SHOW_CONTAINER_ELEMENT) fTextFlags= JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.M_FULLY_QUALIFIED | JavaElementLabels.I_FULLY_QUALIFIED | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.T_FULLY_QUALIFIED | JavaElementLabels.D_QUALIFIED | JavaElementLabels.CF_QUALIFIED | JavaElementLabels.CU_QUALIFIED; else if (orderFlag == SHOW_PATH) { fTextFlags= JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.M_FULLY_QUALIFIED | JavaElementLabels.I_FULLY_QUALIFIED | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.T_FULLY_QUALIFIED | JavaElementLabels.D_QUALIFIED | JavaElementLabels.CF_QUALIFIED | JavaElementLabels.CU_QUALIFIED; fTextFlags |= JavaElementLabels.PREPEND_ROOT_PATH; } } private IJavaElement getJavaElement(Object o) { if (o instanceof IJavaElement) return (IJavaElement)o; if (!(o instanceof ISearchResultViewEntry)) return null; IMarker marker= getMarker(o); if (marker == null || !marker.exists()) return null; return getJavaElement(marker); } private IMarker getMarker(Object o) { if (!(o instanceof ISearchResultViewEntry)) return null; return ((ISearchResultViewEntry)o).getSelectedMarker(); } private IJavaElement getJavaElement(IMarker marker) { if (fLastMarker != marker) { String handle; try { handle= (String)marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID);
5,793
Bug 5793 Searching and search result presentation
I should be able to tell search whether it should consider potential matcher or not. Often I use search for references as the peer operation to open on selection, i.e., e.g., I know there is exactly one caller and I want to jump to it. In addition, potential matches should be presented at the end of the result list and not at it's beginning.
resolved fixed
4bf90d7
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:07:59Z
2001-11-12T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultLabelProvider.java
} catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); handle= null; } if (handle != null) fLastJavaElement= JavaCore.create(handle); else fLastJavaElement= null; fLastMarker= marker; } return fLastJavaElement; } private boolean handleContainsWrongCU(String handle, String resourceName) { int start= handle.indexOf('{'); int end= handle.indexOf(".java"); if (start >= end || start == -1) return false; String name= handle.substring(start + 1, end + 5); return !name.equals(resourceName); } private String computeFixedHandle(String handle, String resourceName) { int start= handle.indexOf('{'); int end= handle.indexOf(".java"); handle= handle.substring(0, start + 1) + resourceName + handle.substring(end + 5); return handle; } }
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.search; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IMarker;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.model.IWorkbenchAdapter;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
import org.eclipse.search.ui.ISearchPage; import org.eclipse.search.ui.ISearchPageContainer; import org.eclipse.search.ui.ISearchResultViewEntry; import org.eclipse.search.ui.IWorkingSet; import org.eclipse.search.ui.SearchUI; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IImportDeclaration; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMethod; 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.IJavaSearchScope; import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.RowLayouter; public class JavaSearchPage extends DialogPage implements ISearchPage, IJavaSearchConstants { public static final String EXTENSION_POINT_ID= "org.eclipse.jdt.ui.JavaSearchPage"; private final static String PAGE_NAME= "JavaSearchPage"; private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; private static List fgPreviousSearchPatterns= new ArrayList(20); private SearchPatternData fInitialData;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
private IJavaElement fJavaElement; private boolean fFirstTime= true; private IDialogSettings fDialogSettings; private boolean fIsCaseSensitive; private Combo fPattern; private ISearchPageContainer fContainer; private Button fCaseSensitive; private Button[] fSearchFor; private String[] fSearchForText= { SearchMessages.getString("SearchPage.searchFor.type"), SearchMessages.getString("SearchPage.searchFor.method"), SearchMessages.getString("SearchPage.searchFor.package"), SearchMessages.getString("SearchPage.searchFor.constructor"), SearchMessages.getString("SearchPage.searchFor.field")}; private Button[] fLimitTo; private String[] fLimitToText= { SearchMessages.getString("SearchPage.limitTo.declarations"), SearchMessages.getString("SearchPage.limitTo.implementors"), SearchMessages.getString("SearchPage.limitTo.references"), SearchMessages.getString("SearchPage.limitTo.allOccurrences"), SearchMessages.getString("SearchPage.limitTo.readReferences"), SearchMessages.getString("SearchPage.limitTo.writeReferences")}; private class SearchPatternData { int searchFor; int limitTo; String pattern; boolean isCaseSensitive;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
IJavaElement javaElement; int scope; IWorkingSet workingSet; public SearchPatternData(int s, int l, String p, IJavaElement element) { this(s, l, p, fIsCaseSensitive || element != null, element, ISearchPageContainer.WORKSPACE_SCOPE, null); } public SearchPatternData(int s, int l, String p, boolean i, IJavaElement element, int scope, IWorkingSet workingSet) { searchFor= s; limitTo= l; pattern= p; isCaseSensitive= i; javaElement= element; this.scope= scope; this.workingSet= workingSet; } } public boolean performAction() { SearchUI.activateSearchResultView(); SearchPatternData data= getPatternData(); IWorkspace workspace= JavaPlugin.getWorkspace(); IJavaSearchScope scope= null; String scopeDescription= ""; switch (getContainer().getSelectedScope()) { case ISearchPageContainer.WORKSPACE_SCOPE: scopeDescription= SearchMessages.getString("WorkspaceScope");
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
scope= SearchEngine.createWorkspaceScope(); break; case ISearchPageContainer.SELECTION_SCOPE: scopeDescription= SearchMessages.getString("SelectionScope"); scope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(getSelection()); break; case ISearchPageContainer.WORKING_SET_SCOPE: IWorkingSet workingSet= getContainer().getSelectedWorkingSet(); if (workingSet == null) return false; scopeDescription= SearchMessages.getFormattedString("WorkingSetScope", new String[] {workingSet.getName()}); scope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(getContainer().getSelectedWorkingSet()); ElementSearchAction.updateLRUWorkingSet(getContainer().getSelectedWorkingSet()); } JavaSearchResultCollector collector= new JavaSearchResultCollector(); JavaSearchOperation op= null; if (data.javaElement != null && getPattern().equals(fInitialData.pattern)) op= new JavaSearchOperation(workspace, data.javaElement, data.limitTo, scope, scopeDescription, collector); else { data.javaElement= null; op= new JavaSearchOperation(workspace, data.pattern, data.isCaseSensitive, data.searchFor, data.limitTo, scope, scopeDescription, collector); } Shell shell= getControl().getShell(); try { getContainer().getRunnableContext().run(true, true, op); } catch (InvocationTargetException ex) { ExceptionHandler.handle(ex, shell, SearchMessages.getString("Search.Error.search.title"), SearchMessages.getString("Search.Error.search.message")); return false;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} catch (InterruptedException ex) { return false; } return true; } private int getLimitTo() { for (int i= 0; i < fLimitTo.length; i++) { if (fLimitTo[i].getSelection()) return i; } return -1; } private void setLimitTo(int searchFor) { fLimitTo[DECLARATIONS].setEnabled(true); fLimitTo[IMPLEMENTORS].setEnabled(false); fLimitTo[REFERENCES].setEnabled(true); fLimitTo[ALL_OCCURRENCES].setEnabled(true); fLimitTo[READ_ACCESSES].setEnabled(false); fLimitTo[WRITE_ACCESSES].setEnabled(false); if (!(searchFor == TYPE || searchFor == INTERFACE) && fLimitTo[IMPLEMENTORS].getSelection()) { fLimitTo[IMPLEMENTORS].setSelection(false); fLimitTo[REFERENCES].setSelection(true); } if (!(searchFor == FIELD) && (getLimitTo() == READ_ACCESSES || getLimitTo() == WRITE_ACCESSES)) { fLimitTo[getLimitTo()].setSelection(false); fLimitTo[REFERENCES].setSelection(true); } switch (searchFor) {
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
case TYPE | INTERFACE: fLimitTo[IMPLEMENTORS].setEnabled(true); case FIELD: fLimitTo[READ_ACCESSES].setEnabled(true); fLimitTo[WRITE_ACCESSES].setEnabled(true); break; default : break; } } private String[] getPreviousSearchPatterns() { int patternCount= fgPreviousSearchPatterns.size(); String [] patterns= new String[patternCount]; for (int i= 0; i < patternCount; i++) patterns[i]= ((SearchPatternData) fgPreviousSearchPatterns.get(patternCount - 1 - i)).pattern; return patterns; } private int getSearchFor() { for (int i= 0; i < fSearchFor.length; i++) { if (fSearchFor[i].getSelection()) return i; } Assert.isTrue(false, "shouldNeverHappen"); return -1; } private String getPattern() { return fPattern.getText();
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} /** * Return search pattern data and update previous searches. * An existing entry will be updated. */ private SearchPatternData getPatternData() { String pattern= getPattern(); SearchPatternData match= null; int i= 0; int size= fgPreviousSearchPatterns.size(); while (match == null && i < size) { match= (SearchPatternData) fgPreviousSearchPatterns.get(i); i++; if (!pattern.equals(match.pattern)) match= null; }; if (match == null) { match= new SearchPatternData( getSearchFor(), getLimitTo(), pattern, fCaseSensitive.getSelection(), fJavaElement, getContainer().getSelectedScope(), getContainer().getSelectedWorkingSet()); fgPreviousSearchPatterns.add(match); } else { match.searchFor= getSearchFor(); match.limitTo= getLimitTo();
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
match.isCaseSensitive= fCaseSensitive.getSelection(); match.javaElement= fJavaElement; match.scope= getContainer().getSelectedScope(); match.workingSet= getContainer().getSelectedWorkingSet(); }; return match; } /* * Implements method from IDialogPage */ public void setVisible(boolean visible) { if (visible && fPattern != null) { if (fFirstTime) { fFirstTime= false; fPattern.setItems(getPreviousSearchPatterns()); initSelections(); } fPattern.setFocus(); getContainer().setPerformActionEnabled(fPattern.getText().length() > 0 && getContainer().hasValidScope()); } super.setVisible(visible); } public boolean isValid() { return true; } /** * Creates the page's content.
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
*/ public void createControl(Composite parent) { readConfiguration(); GridData gd; Composite result= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.makeColumnsEqualWidth= true; layout.horizontalSpacing= 10; result.setLayout(layout); RowLayouter layouter= new RowLayouter(layout.numColumns); gd= new GridData(); gd.horizontalAlignment= gd.FILL; layouter.setDefaultGridData(gd, 0); layouter.setDefaultGridData(gd, 1); layouter.setDefaultSpan(); layouter.perform(createExpression(result)); layouter.perform(createSearchFor(result), createLimitTo(result), -1); SelectionAdapter javaElementInitializer= new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { if (getSearchFor() == fInitialData.searchFor) fJavaElement= fInitialData.javaElement; else fJavaElement= null; setLimitTo(getSearchFor()); updateCaseSensitiveCheckbox(); }
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
}; fSearchFor[TYPE].addSelectionListener(javaElementInitializer); fSearchFor[METHOD].addSelectionListener(javaElementInitializer); fSearchFor[FIELD].addSelectionListener(javaElementInitializer); fSearchFor[CONSTRUCTOR].addSelectionListener(javaElementInitializer); fSearchFor[PACKAGE].addSelectionListener(javaElementInitializer); setControl(result); WorkbenchHelp.setHelp(result, new Object[] { IJavaHelpContextIds.JAVA_SEARCH_PAGE }); } private Control createExpression(Composite parent) { Group result= new Group(parent, SWT.NONE); result.setText(SearchMessages.getString("SearchPage.expression.label")); GridLayout layout= new GridLayout(); layout.numColumns= 2; result.setLayout(layout); fPattern= new Combo(result, SWT.SINGLE | SWT.BORDER); fPattern.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handlePatternSelected(); } }); fPattern.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { getContainer().setPerformActionEnabled(getPattern().length() > 0 && getContainer().hasValidScope()); updateCaseSensitiveCheckbox(); } });
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.widthHint= convertWidthInCharsToPixels(30); gd.horizontalSpan= 2; fPattern.setLayoutData(gd); Label label= new Label(result, SWT.LEFT); label.setText(SearchMessages.getString("SearchPage.expression.pattern")); fCaseSensitive= new Button(result, SWT.CHECK); fCaseSensitive.setText(SearchMessages.getString("SearchPage.expression.caseSensitive")); gd= new GridData(); gd.horizontalAlignment= gd.END; fCaseSensitive.setLayoutData(gd); fCaseSensitive.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fIsCaseSensitive= fCaseSensitive.getSelection(); writeConfiguration(); } }); return result; } private void updateCaseSensitiveCheckbox() { if (fInitialData != null && getPattern().equals(fInitialData.pattern) && fJavaElement != null) { fCaseSensitive.setEnabled(false); fCaseSensitive.setSelection(true); } else { fCaseSensitive.setEnabled(true); fCaseSensitive.setSelection(fIsCaseSensitive);
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} } private void handlePatternSelected() { if (fPattern.getSelectionIndex() < 0) return; int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex(); fInitialData= (SearchPatternData) fgPreviousSearchPatterns.get(index); for (int i= 0; i < fSearchFor.length; i++) fSearchFor[i].setSelection(false); for (int i= 0; i < fLimitTo.length; i++) fLimitTo[i].setSelection(false); fSearchFor[fInitialData.searchFor].setSelection(true); setLimitTo(fInitialData.searchFor); fLimitTo[fInitialData.limitTo].setSelection(true); fPattern.setText(fInitialData.pattern); fIsCaseSensitive= fInitialData.isCaseSensitive; fJavaElement= fInitialData.javaElement; fCaseSensitive.setEnabled(fJavaElement == null); fCaseSensitive.setSelection(fInitialData.isCaseSensitive); if (fInitialData.workingSet != null) getContainer().setSelectedWorkingSet(fInitialData.workingSet); else getContainer().setSelectedScope(fInitialData.scope); } private Control createSearchFor(Composite parent) { Group result= new Group(parent, SWT.NONE); result.setText(SearchMessages.getString("SearchPage.searchFor.label")); GridLayout layout= new GridLayout(); layout.numColumns= 3; result.setLayout(layout);
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
result.setLayoutData(new GridData(GridData.FILL_VERTICAL)); fSearchFor= new Button[fSearchForText.length]; for (int i= 0; i < fSearchForText.length; i++) { Button button= new Button(result, SWT.RADIO); button.setText(fSearchForText[i]); fSearchFor[i]= button; } return result; } private Control createLimitTo(Composite parent) { Group result= new Group(parent, SWT.NONE); result.setText(SearchMessages.getString("SearchPage.limitTo.label")); GridLayout layout= new GridLayout(); layout.numColumns= 2; result.setLayout(layout); fLimitTo= new Button[fLimitToText.length]; for (int i= 0; i < fLimitToText.length; i++) { Button button= new Button(result, SWT.RADIO); button.setText(fLimitToText[i]); fLimitTo[i]= button; } return result; } private void initSelections() { ISelection selection= getSelection(); fInitialData= tryStructuredSelection(selection); if (fInitialData == null)
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
fInitialData= trySimpleTextSelection(selection); if (fInitialData == null) fInitialData= getDefaultInitValues(); fJavaElement= fInitialData.javaElement; fCaseSensitive.setSelection(fInitialData.isCaseSensitive); fCaseSensitive.setEnabled(fInitialData.javaElement == null); fSearchFor[fInitialData.searchFor].setSelection(true); setLimitTo(fInitialData.searchFor); fLimitTo[fInitialData.limitTo].setSelection(true); fPattern.setText(fInitialData.pattern); } private SearchPatternData tryStructuredSelection(ISelection selection) { if (!(selection instanceof IStructuredSelection)) return null; Object o= ((IStructuredSelection)selection).getFirstElement(); if (o instanceof IJavaElement) { return determineInitValuesFrom((IJavaElement)o); } else if (o instanceof ISearchResultViewEntry) { IJavaElement element= getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker()); return determineInitValuesFrom(element); } else if (o instanceof IAdaptable) { IJavaElement element= (IJavaElement)((IAdaptable)o).getAdapter(IJavaElement.class); if (element != null) { return determineInitValuesFrom(element); } else { IWorkbenchAdapter adapter= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class); return new SearchPatternData(TYPE, REFERENCES, adapter.getLabel(o), null); } } return null;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} private IJavaElement getJavaElement(IMarker marker) { try { return JavaCore.create((String)marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID)); } catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); return null; } } private SearchPatternData determineInitValuesFrom(IJavaElement element) { if (element == null) return null; int searchFor= UNKNOWN; int limitTo= UNKNOWN; String pattern= null; switch (element.getElementType()) { case IJavaElement.PACKAGE_FRAGMENT: searchFor= PACKAGE; limitTo= REFERENCES; pattern= element.getElementName(); break; case IJavaElement.PACKAGE_FRAGMENT_ROOT: searchFor= PACKAGE; limitTo= REFERENCES; pattern= element.getElementName(); break; case IJavaElement.PACKAGE_DECLARATION: searchFor= PACKAGE; limitTo= REFERENCES;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
pattern= element.getElementName(); break; case IJavaElement.IMPORT_DECLARATION: pattern= element.getElementName(); IImportDeclaration declaration= (IImportDeclaration)element; if (declaration.isOnDemand()) { searchFor= PACKAGE; int index= pattern.lastIndexOf('.'); pattern= pattern.substring(0, index); } else { searchFor= TYPE; } limitTo= DECLARATIONS; break; case IJavaElement.TYPE: searchFor= TYPE; limitTo= REFERENCES; pattern= JavaModelUtil.getFullyQualifiedName((IType)element); break; case IJavaElement.COMPILATION_UNIT: ICompilationUnit cu= (ICompilationUnit)element; String mainTypeName= element.getElementName().substring(0, element.getElementName().indexOf(".")); IType mainType= cu.getType(mainTypeName); mainTypeName= JavaModelUtil.getTypeQualifiedName(mainType); try { mainType= JavaModelUtil.findTypeInCompilationUnit(cu, mainTypeName); if (mainType == null) { IType[] types= cu.getTypes(); if (types.length > 0)
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
mainType= types[0]; else break; } } catch (JavaModelException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); break; } searchFor= TYPE; element= mainType; limitTo= REFERENCES; pattern= JavaModelUtil.getFullyQualifiedName((IType)mainType); break; case IJavaElement.CLASS_FILE: IClassFile cf= (IClassFile)element; try { mainType= cf.getType(); } catch (JavaModelException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); break; } if (mainType == null) break; element= mainType; searchFor= TYPE; limitTo= REFERENCES; pattern= JavaModelUtil.getFullyQualifiedName(mainType); break; case IJavaElement.FIELD: searchFor= FIELD;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
limitTo= REFERENCES; IType type= ((IField)element).getDeclaringType(); StringBuffer buffer= new StringBuffer(); buffer.append(JavaModelUtil.getFullyQualifiedName(type)); buffer.append('.'); buffer.append(element.getElementName()); pattern= buffer.toString(); break; case IJavaElement.METHOD: searchFor= METHOD; try { IMethod method= (IMethod)element; if (method.isConstructor()) searchFor= CONSTRUCTOR; } catch (JavaModelException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); break; } limitTo= REFERENCES; pattern= PrettySignature.getMethodSignature((IMethod)element); break; } if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null) return new SearchPatternData(searchFor, limitTo, pattern, element); return null; } private SearchPatternData trySimpleTextSelection(ISelection selection) { SearchPatternData result= null;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
if (selection instanceof ITextSelection) { BufferedReader reader= new BufferedReader(new StringReader(((ITextSelection)selection).getText())); String text; try { text= reader.readLine(); if (text == null) text= ""; } catch (IOException ex) { text= ""; } result= new SearchPatternData(TYPE, REFERENCES, text, null); } return result; } private SearchPatternData getDefaultInitValues() { return new SearchPatternData(TYPE, REFERENCES, "", null); } /* * Implements method from ISearchPage */ public void setContainer(ISearchPageContainer container) { fContainer= container; } /** * Returns the search page's container. */ private ISearchPageContainer getContainer() { return fContainer;
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} /** * Returns the current active selection. */ private ISelection getSelection() { IWorkbenchWindow wbWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (wbWindow == null) return fContainer.getSelection(); StructuredSelectionProvider provider= StructuredSelectionProvider.createFrom(wbWindow.getSelectionService()); ISelection selection= provider.getSelection(); if (selection.equals(StructuredSelection.EMPTY)) return fContainer.getSelection(); else return selection; } /** * Returns the current active editor part. */ private IEditorPart getEditorPart() { IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow(); if (window != null) { IWorkbenchPage page= window.getActivePage(); if (page != null) return page.getActiveEditor(); } return null; }
10,577
Bug 10577 Java Search: search scope "Selected resource" not working
Switch to new StructuredSelectionProvider intruduced this bug a) because the provider does not do code resolve if the input is not a selection service b) because at the time the selection service is asked for the selection it takes the selection form the newly opened Search view
resolved fixed
146a199
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:08:56Z
2002-03-01T13:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
/** * Returns the page settings for this Java search page. * * @return the page settings to be used */ private IDialogSettings getDialogSettings() { IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings(); fDialogSettings= settings.getSection(PAGE_NAME); if (fDialogSettings == null) fDialogSettings= settings.addNewSection(PAGE_NAME); return fDialogSettings; } /** * Initializes itself from the stored page settings. */ private void readConfiguration() { IDialogSettings s= getDialogSettings(); fIsCaseSensitive= s.getBoolean(STORE_CASE_SENSITIVE); } /** * Stores it current configuration in the dialog store. */ private void writeConfiguration() { IDialogSettings s= getDialogSettings(); s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive); } }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
package org.eclipse.jdt.internal.ui.javaeditor; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.lang.reflect.InvocationTargetException; import java.util.Iterator; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener;
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.BadPositionCategoryException; import org.eclipse.jface.text.DefaultPositionUpdater; import org.eclipse.jface.text.IDocument;
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
import org.eclipse.jface.text.IPositionUpdater; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextInputListener; import org.eclipse.jface.text.ITextListener; import org.eclipse.jface.text.ITextOperationTarget; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.TextEvent; import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistant; import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.jface.text.source.SourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SaveAsDialog; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditorActionConstants;
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
import org.eclipse.ui.texteditor.MarkerAnnotation; import org.eclipse.ui.texteditor.MarkerUtilities; import org.eclipse.ui.texteditor.TextOperationAction; import org.eclipse.ui.views.tasklist.TaskList; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.ui.IWorkingCopyManager; import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.refactoring.actions.SurroundWithTryCatchAction; import org.eclipse.jdt.internal.ui.reorg.DeleteAction; import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; import org.eclipse.jdt.internal.ui.text.JavaPairMatcher; /** * Java specific text editor. */ public class CompilationUnitEditor extends JavaEditor { /** * Responsible for highlighting matching pairs of brackets. */ class BracketHighlighter implements KeyListener, MouseListener, ISelectionChangedListener, ITextListener, ITextInputListener {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
/** * Highlights the brackets. */ class HighlightBrackets implements PaintListener { private JavaPairMatcher fMatcher= new JavaPairMatcher(new char[] { '{', '}', '(', ')', '[', ']' }); private Position fBracketPosition= new Position(0, 0); private int fAnchor; private boolean fIsActive= false; private StyledText fTextWidget; private Color fColor; public HighlightBrackets() { fTextWidget= fSourceViewer.getTextWidget(); } public void setHighlightColor(Color color) { fColor= color; } public void dispose() { if (fMatcher != null) { fMatcher.dispose(); fMatcher= null; }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
fColor= null; fTextWidget= null; } public void deactivate(boolean redraw) { if (fIsActive) { fIsActive= false; fTextWidget.removePaintListener(this); fManager.unmanage(fBracketPosition); if (redraw) handleDrawRequest(null); } } public void run() { Point selection= fSourceViewer.getSelectedRange(); if (selection.y > 0) { deactivate(true); return; } IRegion pair= fMatcher.match(fSourceViewer.getDocument(), selection.x); if (pair == null) { deactivate(true); return; } if (fIsActive) {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (pair.getOffset() != fBracketPosition.getOffset() || pair.getLength() != fBracketPosition.getLength() || fMatcher.getAnchor() != fAnchor) { handleDrawRequest(null); fBracketPosition.isDeleted= false; fBracketPosition.offset= pair.getOffset(); fBracketPosition.length= pair.getLength(); fAnchor= fMatcher.getAnchor(); handleDrawRequest(null); } } else { fIsActive= true; fBracketPosition.isDeleted= false; fBracketPosition.offset= pair.getOffset(); fBracketPosition.length= pair.getLength(); fAnchor= fMatcher.getAnchor(); fTextWidget.addPaintListener(this); fManager.manage(fBracketPosition); handleDrawRequest(null); } }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
public void paintControl(PaintEvent event) { if (fTextWidget != null) handleDrawRequest(event.gc); } private void handleDrawRequest(GC gc) { if (fBracketPosition.isDeleted) return; int length= fBracketPosition.getLength(); if (length < 1) return; int offset= fBracketPosition.getOffset(); IRegion region= fSourceViewer.getVisibleRegion(); if (region.getOffset() <= offset && region.getOffset() + region.getLength() >= offset + length) { offset -= region.getOffset(); if (fMatcher.RIGHT == fAnchor) draw(gc, offset, 1); else draw(gc, offset + length -1, 1); } } private void draw(GC gc, int offset, int length) { if (gc != null) { Point left= fTextWidget.getLocationAtOffset(offset);
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
Point right= fTextWidget.getLocationAtOffset(offset + length); gc.setForeground(fColor); gc.drawRectangle(left.x, left.y, right.x - left.x - 1, gc.getFontMetrics().getHeight() - 1); } else { fTextWidget.redrawRange(offset, length, true); } } }; /** * Manages the registration and updating of the bracket position. */ class BracketPositionManager { private IDocument fDocument; private IPositionUpdater fPositionUpdater; private String fCategory; public BracketPositionManager() { fCategory= getClass().getName() + hashCode(); fPositionUpdater= new DefaultPositionUpdater(fCategory); } public void install(IDocument document) { fDocument= document; fDocument.addPositionCategory(fCategory); fDocument.addPositionUpdater(fPositionUpdater); }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
public void dispose() { uninstall(fDocument); } public void uninstall(IDocument document) { if (document == fDocument && document != null) { try { fDocument.removePositionUpdater(fPositionUpdater); fDocument.removePositionCategory(fCategory); } catch (BadPositionCategoryException x) { } fDocument= null; } } public void manage(Position position) { try { fDocument.addPosition(fCategory, position); } catch (BadPositionCategoryException x) { } catch (BadLocationException x) { } } public void unmanage(Position position) { try { fDocument.removePosition(fCategory, position);
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} catch (BadPositionCategoryException x) { } } }; private BracketPositionManager fManager= new BracketPositionManager(); private HighlightBrackets fHighlightBrackets; private ISourceViewer fSourceViewer; private boolean fTextChanged= false; public BracketHighlighter(ISourceViewer sourceViewer) { fSourceViewer= sourceViewer; fHighlightBrackets= new HighlightBrackets(); } public void setHighlightColor(Color color) { fHighlightBrackets.setHighlightColor(color); } public void install() { fManager.install(fSourceViewer.getDocument()); fSourceViewer.addTextInputListener(this); ISelectionProvider provider= fSourceViewer.getSelectionProvider(); provider.addSelectionChangedListener(this);
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
fSourceViewer.addTextListener(this); StyledText text= fSourceViewer.getTextWidget(); text.addKeyListener(this); text.addMouseListener(this); } public void dispose() { if (fManager != null) { fManager.dispose(); fManager= null; } if (fHighlightBrackets != null) { fHighlightBrackets.dispose(); fHighlightBrackets= null; } if (fSourceViewer != null && fBracketHighlighter != null) { fSourceViewer.removeTextInputListener(this); ISelectionProvider provider= fSourceViewer.getSelectionProvider(); provider.removeSelectionChangedListener(this); fSourceViewer.removeTextListener(this); StyledText text= fSourceViewer.getTextWidget(); if (text != null && !text.isDisposed()) {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
text.removeKeyListener(fBracketHighlighter); text.removeMouseListener(fBracketHighlighter); } fSourceViewer= null; } } /** * @see KeyListener#keyPressed(KeyEvent) */ public void keyPressed(KeyEvent e) { fTextChanged= false; } /** * @see KeyListener#keyReleased(KeyEvent) */ public void keyReleased(KeyEvent e) { if (!fTextChanged) fHighlightBrackets.run(); } /** * @see MouseListener#mouseDoubleClick(MouseEvent) */ public void mouseDoubleClick(MouseEvent e) { } /** * @see MouseListener#mouseDown(MouseEvent) */
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
public void mouseDown(MouseEvent e) { } /** * @see MouseListener#mouseUp(MouseEvent) */ public void mouseUp(MouseEvent e) { fHighlightBrackets.run(); } /** * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent) */ public void selectionChanged(SelectionChangedEvent event) { fHighlightBrackets.run(); } /** * @see ITextListener#textChanged(TextEvent) */ public void textChanged(TextEvent event) { fTextChanged= true; Control control= fSourceViewer.getTextWidget(); if (control != null) { control.getDisplay().asyncExec(new Runnable() { public void run() { if (fTextChanged && fHighlightBrackets != null) fHighlightBrackets.run(); } });
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} } /** * @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument) */ public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { if (oldInput != null) { fHighlightBrackets.deactivate(false); fManager.uninstall(oldInput); } } /** * @see ITextInputListener#inputDocumentChanged(IDocument, IDocument) */ public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { if (newInput != null) fManager.install(newInput); } }; class InternalSourceViewer extends SourceViewer { public InternalSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { super(parent, ruler, styles); } public IContentAssistant getContentAssistant() {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
return fContentAssistant; } }; private final static String CODE_FORMATTER_TAB_SIZE= "org.eclipse.jdt.core.formatter.tabulation.size"; private final static String CODE_FORMATTER_TAB_CHAR= "org.eclipse.jdt.core.formatter.tabulation.char"; public final static String MATCHING_BRACKETS= "matchingBrackets"; public final static String MATCHING_BRACKETS_COLOR= "matchingBracketsColor"; protected ISelectionChangedListener fStatusLineClearer; protected ISavePolicy fSavePolicy; private JavaEditorErrorTickUpdater fJavaEditorErrorTickUpdater; private BracketHighlighter fBracketHighlighter; /** * Creates a new compilation unit editor. */ public CompilationUnitEditor() { super();
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
setDocumentProvider(JavaPlugin.getDefault().getCompilationUnitDocumentProvider()); setEditorContextMenuId("#CompilationUnitEditorContext"); setRulerContextMenuId("#CompilationUnitRulerContext"); setOutlinerContextMenuId("#CompilationUnitOutlinerContext"); setHelpContextId(IJavaHelpContextIds.COMPILATION_UNIT_EDITOR); fSavePolicy= null; fJavaEditorErrorTickUpdater= new JavaEditorErrorTickUpdater(this); } /** * @see AbstractTextEditor#createActions() */ protected void createActions() { super.createActions(); setAction("ContentAssistProposal", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS)); setAction("ContentAssistContextInformation", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistContextInformation.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION)); setAction("AddImportOnSelection", new AddImportOnSelectionAction(this)); setAction("OrganizeImports", new OrganizeImportsAction(this)); setAction("Comment", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Comment.", this, ITextOperationTarget.PREFIX)); setAction("Uncomment", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX)); setAction("Format", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Format.", this, ISourceViewer.FORMAT)); setAction("ManageBreakpoints", new BreakpointRulerAction(getVerticalRuler(), this)); setAction("SurroundWithTryCatch", new SurroundWithTryCatchAction(this)); setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, getAction("ManageBreakpoints"));
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} /** * @see JavaEditor#getElementAt(int) */ protected IJavaElement getElementAt(int offset) { IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); ICompilationUnit unit= manager.getWorkingCopy(getEditorInput()); if (unit != null) { synchronized (unit) { try { unit.reconcile(); return unit.getElementAt(offset); } catch (JavaModelException x) { } } } return null; } /** * @see JavaEditor#getCorrespondingElement(IJavaElement) */ protected IJavaElement getCorrespondingElement(IJavaElement element) { try { return EditorUtility.getWorkingCopy(element, true); } catch (JavaModelException x) {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} return null; } /** * @see AbstractTextEditor#editorContextMenuAboutToShow(IMenuManager) */ public void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=8735 * Removed duplicates of Edit menu entries to shorten context menu. * Will be reworked for overal context menu reorganization. */ addAction(menu, IContextMenuConstants.GROUP_GENERATE, "AddImportOnSelection"); addAction(menu, IContextMenuConstants.GROUP_GENERATE, "OrganizeImports"); addAction(menu, IContextMenuConstants.GROUP_GENERATE, "SurroundWithTryCatch"); addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Uncomment"); addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Format"); } /** * @see AbstractTextEditor#rulerContextMenuAboutToShow(IMenuManager) */ protected void rulerContextMenuAboutToShow(IMenuManager menu) { super.rulerContextMenuAboutToShow(menu); addAction(menu, "ManageBreakpoints");
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} /** * @see JavaEditor#createOutlinePage() */ protected JavaOutlinePage createOutlinePage() { JavaOutlinePage page= super.createOutlinePage(); page.setAction("OrganizeImports", new OrganizeImportsAction(this)); DeleteAction deleteElement= new DeleteAction(page); page.setAction("DeleteElement", deleteElement); return page; } /** * @see JavaEditor#setOutlinePageInput(JavaOutlinePage, IEditorInput) */ protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input) { if (page != null) { IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); page.setInput(manager.getWorkingCopy(input)); } } /** * @see AbstractTextEditor#performSaveOperation(WorkspaceModifyOperation, IProgressMonitor) */
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
protected void performSaveOperation(WorkspaceModifyOperation operation, IProgressMonitor progressMonitor) { IDocumentProvider p= getDocumentProvider(); if (p instanceof CompilationUnitDocumentProvider) { CompilationUnitDocumentProvider cp= (CompilationUnitDocumentProvider) p; cp.setSavePolicy(fSavePolicy); } try { super.performSaveOperation(operation, progressMonitor); } finally { if (p instanceof CompilationUnitDocumentProvider) { CompilationUnitDocumentProvider cp= (CompilationUnitDocumentProvider) p; cp.setSavePolicy(null); } } } /** * @see AbstractTextEditor#doSave(IProgressMonitor) */ public void doSave(IProgressMonitor progressMonitor) { IDocumentProvider p= getDocumentProvider(); if (p == null) return; if (p.isDeleted(getEditorInput())) { if (isSaveAsAllowed()) {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
/* * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. * Changed Behavior to make sure that if called inside a regular save (because * of deletion of input element) there is a way to report back to the caller. */ performSaveAs(progressMonitor); } else { /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Missing resources. */ Shell shell= getSite().getShell(); MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title1"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message1")); } } else { getStatusLineManager().setErrorMessage(""); IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); ICompilationUnit unit= manager.getWorkingCopy(getEditorInput()); if (unit != null) { synchronized (unit) { performSaveOperation(createSaveOperation(false), progressMonitor); } } else performSaveOperation(createSaveOperation(false), progressMonitor);
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} } /** * Jumps to the error next according to the given direction. */ public void gotoError(boolean forward) { ISelectionProvider provider= getSelectionProvider(); if (fStatusLineClearer != null) { provider.removeSelectionChangedListener(fStatusLineClearer); fStatusLineClearer= null; } ITextSelection s= (ITextSelection) provider.getSelection(); IMarker nextError= getNextError(s.getOffset(), forward); if (nextError != null) { gotoMarker(nextError); IWorkbenchPage page= getSite().getPage(); IViewPart view= view= page.findView("org.eclipse.ui.views.TaskList"); if (view instanceof TaskList) { StructuredSelection ss= new StructuredSelection(nextError); ((TaskList) view).setSelection(ss, true); }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
getStatusLineManager().setErrorMessage(nextError.getAttribute(IMarker.MESSAGE, "")); fStatusLineClearer= new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { getSelectionProvider().removeSelectionChangedListener(fStatusLineClearer); fStatusLineClearer= null; getStatusLineManager().setErrorMessage(""); } }; provider.addSelectionChangedListener(fStatusLineClearer); } else { getStatusLineManager().setErrorMessage(""); } } private IMarker getNextError(int offset, boolean forward) { IMarker nextError= null; IDocument document= getDocumentProvider().getDocument(getEditorInput()); int endOfDocument= document.getLength(); int distance= 0; IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput()); Iterator e= model.getAnnotationIterator(); while (e.hasNext()) { Annotation a= (Annotation) e.next(); if (a instanceof MarkerAnnotation) { MarkerAnnotation ma= (MarkerAnnotation) a;
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IMarker marker= ma.getMarker(); if (MarkerUtilities.isMarkerType(marker, IMarker.PROBLEM)) { Position p= model.getPosition(a); if (!p.includes(offset)) { int currentDistance= 0; if (forward) { currentDistance= p.getOffset() - offset; if (currentDistance < 0) currentDistance= endOfDocument - offset + p.getOffset(); } else { currentDistance= offset - p.getOffset(); if (currentDistance < 0) currentDistance= offset + endOfDocument - p.getOffset(); } if (nextError == null || currentDistance < distance) { distance= currentDistance; nextError= marker; } } } } } return nextError; }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
/** * @see AbstractTextEditor#isSaveAsAllowed() */ public boolean isSaveAsAllowed() { return true; } /* * 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails */ protected IPackageFragment getPackage(IWorkspaceRoot root, IPath path) { if (path.segmentCount() == 1) { IProject project= root.getProject(path.toString()); if (project != null) { IJavaProject jProject= JavaCore.create(project); if (jProject != null) { try { IJavaElement element= jProject.findElement(new Path("")); if (element instanceof IPackageFragment) { IPackageFragment fragment= (IPackageFragment) element; IJavaElement parent= fragment.getParent(); if (parent instanceof IPackageFragmentRoot) { IPackageFragmentRoot pRoot= (IPackageFragmentRoot) parent; if ( !pRoot.isArchive() && !pRoot.isExternal() && path.equals(pRoot.getPath())) return fragment; } }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} catch (JavaModelException x) { } } } return null; } else if (path.segmentCount() > 1) { IFolder folder= root.getFolder(path); IJavaElement element= JavaCore.create(folder); if (element instanceof IPackageFragment) return (IPackageFragment) element; } return null; } /* * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. * Changed behavior to make sure that if called inside a regular save (because * of deletion of input element) there is a way to report back to the caller. */ protected void performSaveAs(IProgressMonitor progressMonitor) { Shell shell= getSite().getShell(); SaveAsDialog dialog= new SaveAsDialog(shell); IEditorInput input = getEditorInput();
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IFile original= null; if (input instanceof IFileEditorInput) original= ((IFileEditorInput) input).getFile(); if (original != null) dialog.setOriginalFile(original); if (dialog.open() == Dialog.CANCEL) { if (progressMonitor != null) progressMonitor.setCanceled(true); return; } IPath filePath= dialog.getResult(); if (filePath == null) { if (progressMonitor != null) progressMonitor.setCanceled(true); return; } filePath= filePath.removeTrailingSeparator(); final String fileName= filePath.lastSegment(); IPath folderPath= filePath.removeLastSegments(1); if (folderPath == null) { if (progressMonitor != null) progressMonitor.setCanceled(true); return; }
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); /* * 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails */ final IPackageFragment fragment= getPackage(root, folderPath); IFile file= root.getFile(filePath); /* * Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=8873 * Problem caused by http://dev.eclipse.org/bugs/show_bug.cgi?id=9351 * Will be removed if #9351 is solved. */ if (original != null && original.equals(file)) { doSave(progressMonitor); return; } final FileEditorInput newInput= new FileEditorInput(file); WorkspaceModifyOperation op= new WorkspaceModifyOperation() { public void execute(final IProgressMonitor monitor) throws CoreException { if (fragment != null) { try { IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
ICompilationUnit unit= manager.getWorkingCopy(getEditorInput()); /* * 1GJXY0L: ITPJUI:WINNT - NPE during save As in Java editor * Introduced null check, just go on in the null case */ if (unit != null) { /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Changed false to true. */ unit.copy(fragment, null, fileName, true, monitor); return; } } catch (JavaModelException x) { } } /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Changed false to true. */ getDocumentProvider().saveDocument(monitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true); } };
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
boolean success= false; try { if (fragment == null) getDocumentProvider().aboutToChange(newInput); new ProgressMonitorDialog(shell).run(false, true, op); setInput(newInput); success= true; } catch (InterruptedException x) { } catch (InvocationTargetException x) { /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Missing resources. */ Throwable t= x.getTargetException(); if (t instanceof CoreException) { CoreException cx= (CoreException) t; ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), cx.getStatus()); } else { MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title3"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message3") + t.getMessage()); } } finally { if (fragment == null) getDocumentProvider().changed(newInput);
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (progressMonitor != null) progressMonitor.setCanceled(!success); } } /** * @see AbstractTextEditor#doSetInput(IEditorInput) */ protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); fJavaEditorErrorTickUpdater.setAnnotationModel(getDocumentProvider().getAnnotationModel(input)); } private void startBracketHighlighting() { if (fBracketHighlighter == null) { ISourceViewer sourceViewer= getSourceViewer(); fBracketHighlighter= new BracketHighlighter(sourceViewer); fBracketHighlighter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR)); fBracketHighlighter.install(); } } private void stopBracketHighlighting() { if (fBracketHighlighter != null) { fBracketHighlighter.dispose(); fBracketHighlighter= null; } } private boolean isBracketHighlightingEnabled() {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IPreferenceStore store= getPreferenceStore(); return store.getBoolean(MATCHING_BRACKETS); } private Color getColor(String key) { RGB rgb= PreferenceConverter.getColor(getPreferenceStore(), key); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); return textTools.getColorManager().getColor(rgb); } /** * @see AbstractTextEditor#dispose() */ public void dispose() { if (fJavaEditorErrorTickUpdater != null) { fJavaEditorErrorTickUpdater.setAnnotationModel(null); fJavaEditorErrorTickUpdater= null; } stopBracketHighlighting(); super.dispose(); } /** * @see AbstractTextEditor#createPartControl(Composite) */ public void createPartControl(Composite parent) { super.createPartControl(parent); if (isBracketHighlightingEnabled())
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
startBracketHighlighting(); } /** * @see AbstractTextEditor#handlePreferenceStoreChanged(PropertyChangeEvent) */ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { try { InternalSourceViewer isv= (InternalSourceViewer) getSourceViewer(); if (isv != null) { String p= event.getProperty(); if (CODE_FORMATTER_TAB_SIZE.equals(p) || CODE_FORMATTER_TAB_CHAR.equals(p)) { SourceViewerConfiguration configuration= getSourceViewerConfiguration(); String[] types= configuration.getConfiguredContentTypes(isv); for (int i= 0; i < types.length; i++) isv.setIndentPrefixes(configuration.getIndentPrefixes(isv, types[i]), types[i]); } if (MATCHING_BRACKETS.equals(p)) { if (isBracketHighlightingEnabled()) startBracketHighlighting(); else stopBracketHighlighting(); return; } if (MATCHING_BRACKETS_COLOR.equals(p)) {
6,700
Bug 6700 Code assist should not just beep
suggest to show a status message: Could not complete due to syntax errors. This is also better for accessability reasons.
resolved fixed
e728bec
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-01T15:15:17Z
2001-12-08T00:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (fBracketHighlighter != null) fBracketHighlighter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR)); return; } IContentAssistant c= isv.getContentAssistant(); if (c instanceof ContentAssistant) ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event); } } finally { super.handlePreferenceStoreChanged(event); } } /** * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent) */ protected boolean affectsTextPresentation(PropertyChangeEvent event) { String p= event.getProperty(); boolean affects=MATCHING_BRACKETS_COLOR.equals(p); return affects ? affects : super.affectsTextPresentation(event); } /** * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int) */ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { return new InternalSourceViewer(parent, ruler, styles); } }
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.typehierarchy; import java.util.ArrayList; import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.swt.widgets.Table; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.viewers.DoubleClickEvent;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IMemento; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup; import org.eclipse.jdt.internal.ui.actions.GenerateGroup; import org.eclipse.jdt.internal.ui.actions.OpenJavaElementAction; import org.eclipse.jdt.internal.ui.search.JavaSearchGroup; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SelectionUtil; import org.eclipse.jdt.internal.ui.viewsupport.ErrorTickImageProvider; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementSorter; import org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider; import org.eclipse.jdt.internal.ui.viewsupport.ProblemTableViewer; /** * Method viewer shows a list of methods of a input type. * Offers filter actions. * No dependency to the type hierarchy view */ public class MethodsViewer extends ProblemTableViewer {
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
private static final String TAG_HIDEFIELDS= "hidefields"; private static final String TAG_HIDESTATIC= "hidestatic"; private static final String TAG_HIDENONPUBLIC= "hidenonpublic"; private static final String TAG_SHOWINHERITED= "showinherited"; private static final String TAG_VERTICAL_SCROLL= "mv_vertical_scroll"; private static final int LABEL_BASEFLAGS= JavaElementLabels.M_PARAMETER_TYPES; private MethodsViewerFilterAction[] fFilterActions; private MethodsViewerFilter fFilter; private JavaUILabelProvider fLabelProvider;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
private OpenJavaElementAction fOpen; private ShowInheritedMembersAction fShowInheritedMembersAction; private ContextMenuGroup[] fStandardGroups; public MethodsViewer(Composite parent, IWorkbenchPart part) { super(new Table(parent, SWT.MULTI)); fLabelProvider= new JavaUILabelProvider(new ErrorTickImageProvider()); MethodsContentProvider contentProvider= new MethodsContentProvider(); setLabelProvider(fLabelProvider); setContentProvider(contentProvider); fOpen= new OpenJavaElementAction(this); addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { fOpen.run(); } }); fFilter= new MethodsViewerFilter(); String title= TypeHierarchyMessages.getString("MethodsViewer.hide_fields.label"); String helpContext= IJavaHelpContextIds.FILTER_FIELDS_ACTION; MethodsViewerFilterAction hideFields= new MethodsViewerFilterAction(this, title, MethodsViewerFilter.FILTER_FIELDS, helpContext, false); hideFields.setDescription(TypeHierarchyMessages.getString("MethodsViewer.hide_fields.description")); hideFields.setToolTipChecked(TypeHierarchyMessages.getString("MethodsViewer.hide_fields.tooltip.checked"));
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
hideFields.setToolTipUnchecked(TypeHierarchyMessages.getString("MethodsViewer.hide_fields.tooltip.unchecked")); JavaPluginImages.setLocalImageDescriptors(hideFields, "fields_co.gif"); title= TypeHierarchyMessages.getString("MethodsViewer.hide_static.label"); helpContext= IJavaHelpContextIds.FILTER_STATIC_ACTION; MethodsViewerFilterAction hideStatic= new MethodsViewerFilterAction(this, title, MethodsViewerFilter.FILTER_STATIC, helpContext, false); hideStatic.setDescription(TypeHierarchyMessages.getString("MethodsViewer.hide_static.description")); hideStatic.setToolTipChecked(TypeHierarchyMessages.getString("MethodsViewer.hide_static.tooltip.checked")); hideStatic.setToolTipUnchecked(TypeHierarchyMessages.getString("MethodsViewer.hide_static.tooltip.unchecked")); JavaPluginImages.setLocalImageDescriptors(hideStatic, "static_co.gif"); title= TypeHierarchyMessages.getString("MethodsViewer.hide_nonpublic.label"); helpContext= IJavaHelpContextIds.FILTER_PUBLIC_ACTION; MethodsViewerFilterAction hideNonPublic= new MethodsViewerFilterAction(this, title, MethodsViewerFilter.FILTER_NONPUBLIC, helpContext, false); hideNonPublic.setDescription(TypeHierarchyMessages.getString("MethodsViewer.hide_nonpublic.description")); hideNonPublic.setToolTipChecked(TypeHierarchyMessages.getString("MethodsViewer.hide_nonpublic.tooltip.checked")); hideNonPublic.setToolTipUnchecked(TypeHierarchyMessages.getString("MethodsViewer.hide_nonpublic.tooltip.unchecked")); JavaPluginImages.setLocalImageDescriptors(hideNonPublic, "public_co.gif"); fFilterActions= new MethodsViewerFilterAction[] { hideFields, hideStatic, hideNonPublic }; addFilter(fFilter); fShowInheritedMembersAction= new ShowInheritedMembersAction(this, false); showInheritedMethods(false); fStandardGroups= new ContextMenuGroup[] {
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
new JavaSearchGroup(), new GenerateGroup() }; setSorter(new JavaElementSorter()); } /** * Show inherited methods */ public void showInheritedMethods(boolean on) { MethodsContentProvider cprovider= (MethodsContentProvider) getContentProvider(); try { getTable().setRedraw(false); cprovider.showInheritedMethods(on); fShowInheritedMembersAction.setChecked(on); if (on) { fLabelProvider.setTextFlags(LABEL_BASEFLAGS | JavaElementLabels.ALL_POST_QUALIFIED); } else { fLabelProvider.setTextFlags(LABEL_BASEFLAGS); } refresh(); } catch (JavaModelException e) { ExceptionHandler.handle(e, getControl().getShell(), TypeHierarchyMessages.getString("MethodsViewer.toggle.error.title"), TypeHierarchyMessages.getString("MethodsViewer.toggle.error.message")); } finally { getTable().setRedraw(true); } } /* * @see Viewer#inputChanged(Object, Object)
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
*/ protected void inputChanged(Object input, Object oldInput) { super.inputChanged(input, oldInput); } /** * Returns <code>true</code> if inherited methods are shown. */ public boolean isShowInheritedMethods() { return ((MethodsContentProvider) getContentProvider()).isShowInheritedMethods(); } /** * Filters the method list */ public void setMemberFilter(int filterProperty, boolean set) { if (set) { fFilter.addFilter(filterProperty); } else { fFilter.removeFilter(filterProperty); } for (int i= 0; i < fFilterActions.length; i++) { if (fFilterActions[i].getFilterProperty() == filterProperty) { fFilterActions[i].setChecked(set); } } refresh(); } /** * Returns <code>true</code> if the given filter is set. */
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
public boolean hasMemberFilter(int filterProperty) { return fFilter.hasFilter(filterProperty); } /** * Saves the state of the filter actions */ public void saveState(IMemento memento) { memento.putString(TAG_HIDEFIELDS, String.valueOf(hasMemberFilter(MethodsViewerFilter.FILTER_FIELDS))); memento.putString(TAG_HIDESTATIC, String.valueOf(hasMemberFilter(MethodsViewerFilter.FILTER_STATIC))); memento.putString(TAG_HIDENONPUBLIC, String.valueOf(hasMemberFilter(MethodsViewerFilter.FILTER_NONPUBLIC))); memento.putString(TAG_SHOWINHERITED, String.valueOf(isShowInheritedMethods())); ScrollBar bar= getTable().getVerticalBar(); int position= bar != null ? bar.getSelection() : 0; memento.putString(TAG_VERTICAL_SCROLL, String.valueOf(position)); } /** * Restores the state of the filter actions */ public void restoreState(IMemento memento) { boolean set= Boolean.valueOf(memento.getString(TAG_HIDEFIELDS)).booleanValue(); setMemberFilter(MethodsViewerFilter.FILTER_FIELDS, set); set= Boolean.valueOf(memento.getString(TAG_HIDESTATIC)).booleanValue(); setMemberFilter(MethodsViewerFilter.FILTER_STATIC, set); set= Boolean.valueOf(memento.getString(TAG_HIDENONPUBLIC)).booleanValue(); setMemberFilter(MethodsViewerFilter.FILTER_NONPUBLIC, set); set= Boolean.valueOf(memento.getString(TAG_SHOWINHERITED)).booleanValue(); showInheritedMethods(set);
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
ScrollBar bar= getTable().getVerticalBar(); if (bar != null) { Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL); if (vScroll != null) { bar.setSelection(vScroll.intValue()); } } } /** * Attaches a contextmenu listener to the table */ public void initContextMenu(IMenuListener menuListener, String popupId, IWorkbenchPartSite viewSite) { MenuManager menuMgr= new MenuManager(); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(menuListener); Menu menu= menuMgr.createContextMenu(getTable()); getTable().setMenu(menu); viewSite.registerContextMenu(popupId, menuMgr, this); } /** * Fills up the context menu with items for the method viewer * Should be called by the creator of the context menu */ public void contributeToContextMenu(IMenuManager menu) { if (fOpen.canActionBeAdded()) { menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpen); }
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
ContextMenuGroup.add(menu, fStandardGroups, this); } /** * Fills up the tool bar with items for the method viewer * Should be called by the creator of the tool bar */ public void contributeToToolBar(ToolBarManager tbm) { tbm.add(fShowInheritedMembersAction); tbm.add(new Separator()); tbm.add(fFilterActions[0]); tbm.add(fFilterActions[1]); tbm.add(fFilterActions[2]); } /* * @see StructuredViewer#handleInvalidSelection(ISelection, ISelection) */ protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) { List oldSelections= SelectionUtil.toList(invalidSelection); List newSelections= SelectionUtil.toList(newSelection); if (!oldSelections.isEmpty()) { ArrayList newSelectionElements= new ArrayList(newSelections); try { Object[] currElements= getFilteredChildren(getInput()); for (int i= 0; i < oldSelections.size(); i++) { Object curr= oldSelections.get(i); if (curr instanceof IMethod && !newSelections.contains(curr)) { IMethod method= (IMethod) curr; if (method.exists()) {
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
IMethod similar= findSimilarMethod(method, currElements); if (similar != null) { newSelectionElements.add(similar); } } } } newSelection= new StructuredSelection(newSelectionElements); } catch (JavaModelException e) { JavaPlugin.log(e); } } setSelection(newSelection); updateSelection(newSelection); } private IMethod findSimilarMethod(IMethod meth, Object[] elements) throws JavaModelException { String name= meth.getElementName(); String[] paramTypes= meth.getParameterTypes(); boolean isConstructor= meth.isConstructor(); for (int i= 0; i < elements.length; i++) { Object curr= elements[i]; if (curr instanceof IMethod && JavaModelUtil.isSameMethodSignature(name, paramTypes, isConstructor, (IMethod) curr)) { return (IMethod) curr; } } return null; } }
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.typehierarchy; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.ViewForm; import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.DragSource; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.jface.action.IMenuListener;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.IBasicPropertyConstants; import org.eclipse.jface.viewers.IInputSelectionProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IMemento; import org.eclipse.ui.IPartListener; import org.eclipse.ui.IViewSite; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.PartInitException; import org.eclipse.ui.actions.OpenWithMenu; import org.eclipse.ui.help.ViewContextComputer; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.part.PageBook; import org.eclipse.ui.part.ViewPart;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.ui.ITypeHierarchyViewPart; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.AddMethodStubAction; import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup; import org.eclipse.jdt.internal.ui.dnd.BasicSelectionTransferDragAdapter; import org.eclipse.jdt.internal.ui.dnd.LocalSelectionTransfer; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.packageview.BuildGroup; import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage; import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringGroup; import org.eclipse.jdt.internal.ui.reorg.ReorgGroup; import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil; import org.eclipse.jdt.internal.ui.viewsupport.ErrorTickImageProvider; import org.eclipse.jdt.internal.ui.viewsupport.IProblemChangedListener; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider; import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater; /** * view showing the supertypes/subtypes of its input. */ public class TypeHierarchyViewPart extends ViewPart implements ITypeHierarchyViewPart {
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
public static final int VIEW_ID_TYPE= 2; public static final int VIEW_ID_SUPER= 0; public static final int VIEW_ID_SUB= 1; public static final int VIEW_ORIENTATION_VERTICAL= 0; public static final int VIEW_ORIENTATION_HORIZONTAL= 1; public static final int VIEW_ORIENTATION_SINGLE= 2; private static final String DIALOGSTORE_HIERARCHYVIEW= "TypeHierarchyViewPart.hierarchyview"; private static final String DIALOGSTORE_VIEWORIENTATION= "TypeHierarchyViewPart.orientation"; private static final String TAG_INPUT= "input"; private static final String TAG_VIEW= "view"; private static final String TAG_ORIENTATION= "orientation"; private static final String TAG_RATIO= "ratio"; private static final String TAG_SELECTION= "selection"; private static final String TAG_VERTICAL_SCROLL= "vertical_scroll"; private IType fSelectedType; private IJavaElement fInputElement; private ArrayList fInputHistory;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
private IMemento fMemento; private IProblemChangedListener fHierarchyProblemListener; private TypeHierarchyLifeCycle fHierarchyLifeCycle; private ITypeHierarchyLifeCycleListener fTypeHierarchyLifeCycleListener; private MethodsViewer fMethodsViewer; private int fCurrentViewerIndex; private TypeHierarchyViewer[] fAllViewers; private SelectionProviderMediator fSelectionProviderMediator; private ISelectionChangedListener fSelectionChangedListener; private boolean fIsEnableMemberFilter; private SashForm fTypeMethodsSplitter; private PageBook fViewerbook; private PageBook fPagebook; private Label fNoHierarchyShownLabel; private Label fEmptyTypesViewer; private ViewForm fTypeViewerViewForm; private ViewForm fMethodViewerViewForm; private CLabel fMethodViewerPaneLabel; private JavaUILabelProvider fPaneLabelProvider;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
private IDialogSettings fDialogSettings; private ToggleViewAction[] fViewActions; private HistoryDropDownAction fHistoryDropDownAction; private ToggleOrientationAction[] fToggleOrientationActions; private int fCurrentOrientation; private EnableMemberFilterAction fEnableMemberFilterAction; private AddMethodStubAction fAddStubAction; private FocusOnTypeAction fFocusOnTypeAction; private FocusOnSelectionAction fFocusOnSelectionAction; private IPartListener fPartListener; public TypeHierarchyViewPart() { fSelectedType= null; fInputElement= null; fHierarchyLifeCycle= new TypeHierarchyLifeCycle(); fTypeHierarchyLifeCycleListener= new ITypeHierarchyLifeCycleListener() { public void typeHierarchyChanged(TypeHierarchyLifeCycle typeHierarchy, IType[] changedTypes) { doTypeHierarchyChanged(typeHierarchy, changedTypes); } }; fHierarchyLifeCycle.addChangedListener(fTypeHierarchyLifeCycleListener); fHierarchyProblemListener= null;
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
fIsEnableMemberFilter= false; fInputHistory= new ArrayList(); fAllViewers= null; fViewActions= new ToggleViewAction[] { new ToggleViewAction(this, VIEW_ID_TYPE), new ToggleViewAction(this, VIEW_ID_SUPER), new ToggleViewAction(this, VIEW_ID_SUB) }; fDialogSettings= JavaPlugin.getDefault().getDialogSettings(); fHistoryDropDownAction= new HistoryDropDownAction(this); fHistoryDropDownAction.setEnabled(false); fToggleOrientationActions= new ToggleOrientationAction[] { new ToggleOrientationAction(this, VIEW_ORIENTATION_VERTICAL), new ToggleOrientationAction(this, VIEW_ORIENTATION_HORIZONTAL), new ToggleOrientationAction(this, VIEW_ORIENTATION_SINGLE) }; fEnableMemberFilterAction= new EnableMemberFilterAction(this, false); fFocusOnTypeAction= new FocusOnTypeAction(this); fPaneLabelProvider= new JavaUILabelProvider(); fAddStubAction= new AddMethodStubAction();
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
fFocusOnSelectionAction= new FocusOnSelectionAction(this); fPartListener= new IPartListener() { public void partActivated(IWorkbenchPart part) { if (part instanceof IEditorPart) editorActivated((IEditorPart) part); } public void partBroughtToTop(IWorkbenchPart part) {} public void partClosed(IWorkbenchPart part) {} public void partDeactivated(IWorkbenchPart part) {} public void partOpened(IWorkbenchPart part) {} }; fSelectionChangedListener= new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { doSelectionChanged(event); } }; } /** * Adds the entry if new. Inserted at the beginning of the history entries list. */ private void addHistoryEntry(IJavaElement entry) { if (fInputHistory.contains(entry)) { fInputHistory.remove(entry); } fInputHistory.add(0, entry); fHistoryDropDownAction.setEnabled(true);
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
} private void updateHistoryEntries() { for (int i= fInputHistory.size() - 1; i >= 0; i--) { IJavaElement type= (IJavaElement) fInputHistory.get(i); if (!type.exists()) { fInputHistory.remove(i); } } fHistoryDropDownAction.setEnabled(!fInputHistory.isEmpty()); } /** * Goes to the selected entry, without updating the order of history entries. */ public void gotoHistoryEntry(IJavaElement entry) { if (fInputHistory.contains(entry)) { updateInput(entry); } } /** * Gets all history entries. */ public IJavaElement[] getHistoryEntries() { if (fInputHistory.size() > 0) { updateHistoryEntries(); } return (IJavaElement[]) fInputHistory.toArray(new IJavaElement[fInputHistory.size()]); }
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
/** * Sets the history entries */ public void setHistoryEntries(IJavaElement[] elems) { fInputHistory.clear(); for (int i= 0; i < elems.length; i++) { fInputHistory.add(elems[i]); } updateHistoryEntries(); } /** * Selects an member in the methods list or in the current hierarchy. */ public void selectMember(IMember member) { ICompilationUnit cu= member.getCompilationUnit(); if (cu != null && cu.isWorkingCopy()) { member= (IMember) cu.getOriginal(member); if (member == null) { return; } } if (member.getElementType() != IJavaElement.TYPE) { Control methodControl= fMethodsViewer.getControl(); if (methodControl != null && !methodControl.isDisposed()) { methodControl.setFocus(); } fMethodsViewer.setSelection(new StructuredSelection(member), true); } else {
10,236
Bug 10236 Enable decorators in Type hierarchy view
See the packages view for how to do this.
resolved fixed
af6ae76
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-04T18:05:13Z
2002-02-26T07:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
Control viewerControl= getCurrentViewer().getControl(); if (viewerControl != null && !viewerControl.isDisposed()) { viewerControl.setFocus(); } getCurrentViewer().setSelection(new StructuredSelection(member), true); } } /** * @deprecated */ public IType getInput() { if (fInputElement instanceof IType) { return (IType) fInputElement; } return null; } /** * Sets the input to a new type * @deprecated */ public void setInput(IType type) { setInputElement(type); } /** * Returns the input element of the type hierarchy. * Can be of type <code>IType</code> or <code>IPackageFragment</code> */ public IJavaElement getInputElement() {