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
unknown | report_datetime
unknown | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | /**
* Gets the curret active view index.
*/
public int getViewIndex() {
return fCurrentViewerIndex;
}
private TypeHierarchyViewer getCurrentViewer() {
return fAllViewers[fCurrentViewerIndex];
}
/**
* called from EnableMemberFilterAction.
* Must be called after creation of the viewpart.
*/
public void enableMemberFilter(boolean on) {
if (on != fIsEnableMemberFilter) {
fIsEnableMemberFilter= on;
if (!on) {
Object methodViewerInput= fMethodsViewer.getInput();
IType input= getInput();
setMemberFilter(null);
if (methodViewerInput != null && getCurrentViewer().isElementShown(methodViewerInput)) {
getCurrentViewer().setSelection(new StructuredSelection(methodViewerInput));
} else if (input != null) {
getCurrentViewer().setSelection(new StructuredSelection(input));
updateMethodViewer(input);
}
} else { |
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | methodSelectionChanged(fMethodsViewer.getSelection());
}
}
fEnableMemberFilterAction.setChecked(on);
}
/**
* Called from ITypeHierarchyLifeCycleListener.
* Can be called from any thread
*/
private void doTypeHierarchyChanged(final TypeHierarchyLifeCycle typeHierarchy, final IType[] changedTypes) {
Display display= getDisplay();
if (display != null) {
display.asyncExec(new Runnable() {
public void run() {
doTypeHierarchyChangedOnViewers(changedTypes);
}
});
}
}
private void doTypeHierarchyChangedOnViewers(IType[] changedTypes) {
if (changedTypes == null) {
if (!fHierarchyLifeCycle.getHierarchy().exists()) {
clearInput();
} else {
try {
fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInput);
} catch (JavaModelException e) { |
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | JavaPlugin.log(e.getStatus());
clearInput();
return;
}
updateHierarchyViewer();
}
} else {
if (getCurrentViewer().isMethodFiltering()) {
if (changedTypes.length == 1) {
getCurrentViewer().refresh(changedTypes[0]);
} else {
updateHierarchyViewer();
}
} else {
getCurrentViewer().update(changedTypes, new String[] { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE } );
}
}
}
/**
* Determines the input element to be used initially .
*/
private IType determineInputElement() {
Object input= getSite().getPage().getInput();
if (input instanceof IType) {
return (IType)input;
}
return null; |
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
/*
* @see IViewPart#init
*/
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
fMemento= memento;
}
/*
* @see ViewPart#saveState(IMemento)
*/
public void saveState(IMemento memento) {
if (fPagebook == null) {
if (fMemento != null) {
memento.putMemento(fMemento);
}
return;
}
if (fInput != null) {
memento.putString(TAG_INPUT, fInput.getHandleIdentifier());
}
memento.putInteger(TAG_VIEW, getViewIndex());
memento.putInteger(TAG_ORIENTATION, fToggleOrientationAction.isChecked() ? 1 : 0);
int weigths[]= fTypeMethodsSplitter.getWeights();
int ratio= (weigths[0] * 1000) / (weigths[0] + weigths[1]);
memento.putInteger(TAG_RATIO, ratio); |
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | ScrollBar bar= getCurrentViewer().getTree().getVerticalBar();
int position= bar != null ? bar.getSelection() : 0;
memento.putInteger(TAG_VERTICAL_SCROLL, position);
IJavaElement selection= (IJavaElement)((IStructuredSelection) getCurrentViewer().getSelection()).getFirstElement();
if (selection != null) {
memento.putString(TAG_SELECTION, selection.getHandleIdentifier());
}
fMethodsViewer.saveState(memento);
}
/**
* Restores the type hierarchy settings from a memento.
*/
private void restoreState(IMemento memento, IType defaultInput) {
IType input= defaultInput;
String elementId= memento.getString(TAG_INPUT);
if (elementId != null) {
input= (IType) JavaCore.create(elementId);
if (!input.exists()) {
input= null;
}
}
setInput(input);
Integer viewerIndex= memento.getInteger(TAG_VIEW);
if (viewerIndex != null) {
setView(viewerIndex.intValue());
}
Integer orientation= memento.getInteger(TAG_ORIENTATION);
if (orientation != null) { |
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | setOrientation(orientation.intValue() == 1);
}
Integer ratio= memento.getInteger(TAG_RATIO);
if (ratio != null) {
fTypeMethodsSplitter.setWeights(new int[] { ratio.intValue(), 1000 - ratio.intValue() });
}
ScrollBar bar= getCurrentViewer().getTree().getVerticalBar();
if (bar != null) {
Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL);
if (vScroll != null) {
bar.setSelection(vScroll.intValue());
}
}
String selectionId= memento.getString(TAG_SELECTION);
if (selectionId != null) {
IJavaElement elem= JavaCore.create(selectionId);
if (getCurrentViewer().isElementShown(elem)) {
getCurrentViewer().setSelection(new StructuredSelection(elem));
}
}
fMethodsViewer.restoreState(memento);
}
/**
* Link selection to active editor.
*/
private void editorActivated(IEditorPart editor) {
if (!JavaBasePreferencePage.linkTypeHierarchySelectionToEditor()) {
return; |
5,116 | Bug 5116 Showing methods in the Type Hierarchy View is redundant | It seems that showing methods in the Type Hierarchy View is reduntant. Couldn't we remove it and make the Type Hierarchy Perspective composed by the upper part of the Type Hierarchy View (showing the types) plus the outliner? | resolved fixed | 0fa38ed | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-23T11:00:10Z" | "2001-10-19T16:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java | }
if (fInput == null) {
return;
}
IJavaElement elem= (IJavaElement)editor.getEditorInput().getAdapter(IJavaElement.class);
try {
TypeHierarchyViewer currentViewer= getCurrentViewer();
if (elem instanceof IClassFile) {
IType type= ((IClassFile)elem).getType();
if (currentViewer.isElementShown(type)) {
currentViewer.setSelection(new StructuredSelection(type));
}
} else if (elem instanceof ICompilationUnit) {
IType[] allTypes= ((ICompilationUnit)elem).getAllTypes();
for (int i= 0; i < allTypes.length; i++) {
if (currentViewer.isElementShown(allTypes[i])) {
currentViewer.setSelection(new StructuredSelection(allTypes[i]));
return;
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
} |
5,048 | Bug 5048 Too many declarations in hierarchy of (jdt)Parser.initialize() | Build 204 In a self-hosting workspace, open type Parser (from JDT), and select its initialize() method in outliner. Request to search declarations in hierarchy, it incorrectly finds over 100 matches, as if it was not taking into account the accurate location of the Parser. | resolved fixed | f57e9cf | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T08:40:31Z" | "2001-10-17T17:33:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindDeclarationsAction.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
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.IPackageDeclaration;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
public class FindDeclarationsAction extends ElementSearchAction {
public FindDeclarationsAction() {
this(SearchMessages.getString("Search.FindDeclarationAction.label"), new Class[] {IField.class, IMethod.class, IType.class, IPackageDeclaration.class, IImportDeclaration.class, IPackageFragment.class});
setToolTipText(SearchMessages.getString("Search.FindDeclarationAction.tooltip"));
}
public FindDeclarationsAction(String label, Class[] validTypes) {
super(label, validTypes);
setImageDescriptor(JavaPluginImages.DESC_OBJS_SEARCH_DECL);
}
protected JavaSearchOperation makeOperation(IJavaElement element) throws JavaModelException {
if (element.getElementType() == IJavaElement.TYPE) { |
5,048 | Bug 5048 Too many declarations in hierarchy of (jdt)Parser.initialize() | Build 204 In a self-hosting workspace, open type Parser (from JDT), and select its initialize() method in outliner. Request to search declarations in hierarchy, it incorrectly finds over 100 matches, as if it was not taking into account the accurate location of the Parser. | resolved fixed | f57e9cf | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T08:40:31Z" | "2001-10-17T17:33:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindDeclarationsAction.java | IType type= (IType)element;
int searchFor= IJavaSearchConstants.TYPE;
String pattern= PrettySignature.getUnqualifiedTypeSignature(type);
return new JavaSearchOperation(JavaPlugin.getWorkspace(), pattern,
searchFor, getLimitTo(), getScope(type), getScopeDescription(type), getCollector());
}
else if (element.getElementType() == IJavaElement.METHOD) {
IMethod method= (IMethod)element;
int searchFor= IJavaSearchConstants.METHOD;
if (method.isConstructor())
searchFor= IJavaSearchConstants.CONSTRUCTOR;
IType type= method.getDeclaringType();
String pattern= PrettySignature.getUnqualifiedMethodSignature(method);
return new JavaSearchOperation(JavaPlugin.getWorkspace(), pattern,
searchFor, getLimitTo(), getScope(type), getScopeDescription(type), getCollector());
}
else
return super.makeOperation(element);
}
protected int getLimitTo() {
return IJavaSearchConstants.DECLARATIONS;
}
protected boolean shouldUserBePrompted() {
return false;
}
protected String getScopeDescription(IType type) {
return super.getScopeDescription(type);
}
} |
5,048 | Bug 5048 Too many declarations in hierarchy of (jdt)Parser.initialize() | Build 204 In a self-hosting workspace, open type Parser (from JDT), and select its initialize() method in outliner. Request to search declarations in hierarchy, it incorrectly finds over 100 matches, as if it was not taking into account the accurate location of the Parser. | resolved fixed | f57e9cf | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T08:40:31Z" | "2001-10-17T17:33:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindHierarchyDeclarationsAction.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
public class FindHierarchyDeclarationsAction extends FindDeclarationsAction { |
5,048 | Bug 5048 Too many declarations in hierarchy of (jdt)Parser.initialize() | Build 204 In a self-hosting workspace, open type Parser (from JDT), and select its initialize() method in outliner. Request to search declarations in hierarchy, it incorrectly finds over 100 matches, as if it was not taking into account the accurate location of the Parser. | resolved fixed | f57e9cf | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T08:40:31Z" | "2001-10-17T17:33:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindHierarchyDeclarationsAction.java | public FindHierarchyDeclarationsAction() {
super(SearchMessages.getString("Search.FindHierarchyDeclarationsAction.label"), new Class[] {IField.class, IMethod.class, IType.class} );
setToolTipText(SearchMessages.getString("Search.FindHierarchyDeclarationsAction.tooltip"));
}
protected IJavaSearchScope getScope(IType type) throws JavaModelException {
ICompilationUnit cu= type.getCompilationUnit();
if (cu != null && cu.isWorkingCopy()) {
type= (IType)cu.getOriginal(type);
}
return SearchEngine.createHierarchyScope(type);
}
protected boolean shouldUserBePrompted() {
return true;
}
protected String getScopeDescription(IType type) {
return SearchMessages.getFormattedString("HierarchyScope", new String[] {type.getElementName()});
}
} |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | 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.Arrays;
import java.util.Iterator; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | import java.util.List;
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.text.ITextSelection;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.search.internal.ui.SearchManager;
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.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICodeAssist;
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.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditorInput;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.util.RowLayouter;
public class JavaSearchPage extends DialogPage implements ISearchPage, IJavaSearchConstants { |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | public static final String EXTENSION_POINT_ID= "org.eclipse.jdt.ui.JavaSearchPage";
private static List fgPreviousSearchPatterns= new ArrayList(20);
private Combo fPattern;
private String fInitialPattern;
private boolean fFirstTime= true;
private ISearchPageContainer fContainer;
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")};
private IJavaElement fJavaElement;
private static class SearchPatternData { |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | int searchFor;
int limitTo;
String pattern;
IJavaElement javaElement;
int scope;
IWorkingSet workingSet;
public SearchPatternData(int s, int l, String p, IJavaElement element) { |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | this(s, l, p, element, ISearchPageContainer.WORKSPACE_SCOPE, null);
}
public SearchPatternData(int s, int l, String p, IJavaElement element, int scope, IWorkingSet workingSet) {
searchFor= s;
limitTo= l;
pattern= p;
javaElement= element;
this.scope= scope;
this.workingSet= workingSet;
}
}
public boolean performAction() {
SearchPatternData data= getPatternData();
IWorkspace workspace= JavaPlugin.getWorkspace();
IJavaSearchScope scope= null;
String scopeDescription= "";
switch (getContainer().getSelectedScope()) {
case ISearchPageContainer.WORKSPACE_SCOPE:
scopeDescription= SearchMessages.getString("WorkspaceScope");
scope= SearchEngine.createWorkspaceScope();
break;
case ISearchPageContainer.SELECTION_SCOPE:
scopeDescription= SearchMessages.getString("SelectionScope");
scope= getSelectedResourcesScope();
break;
case ISearchPageContainer.WORKING_SET_SCOPE: |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | IWorkingSet workingSet= getContainer().getSelectedWorkingSet();
scopeDescription= SearchMessages.getFormattedString("WorkingSetScope", new String[] {workingSet.getName()});
scope= SearchEngine.createJavaSearchScope(getContainer().getSelectedWorkingSet().getResources());
}
JavaSearchResultCollector collector= new JavaSearchResultCollector();
JavaSearchOperation op= null;
if (data.javaElement != null && getPattern().equals(fInitialPattern))
op= new JavaSearchOperation(workspace, data.javaElement, data.limitTo, scope, scopeDescription, collector);
else {
data.javaElement= null;
op= new JavaSearchOperation(workspace, data.pattern, 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;
} catch (InterruptedException ex) {
return false;
}
return true;
}
private int getLimitTo() {
for (int i= 0; i < fLimitTo.length; i++) {
if (fLimitTo[i].getSelection())
return i;
} |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | Assert.isTrue(false, SearchMessages.getString("SearchPage.shouldNeverHappen"));
return -1;
}
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, SearchMessages.getString("SearchPage.shouldNeverHappen"));
return -1;
}
private String getPattern() {
return fPattern.getText();
}
/**
* Return search pattern data and update previous searches.
* An existing entry will be updated.
*/
private SearchPatternData getPatternData() {
String pattern= getPattern(); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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(),
getPattern(),
fJavaElement,
getContainer().getSelectedScope(),
getContainer().getSelectedWorkingSet());
fgPreviousSearchPatterns.add(match);
}
else {
match.searchFor= getSearchFor();
match.limitTo= getLimitTo();
match.javaElement= fJavaElement;
match.scope= getContainer().getSelectedScope();
match.workingSet= getContainer().getSelectedWorkingSet();
};
return match;
}
/*
* Implements method from IDialogPage |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | */
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);
}
super.setVisible(visible);
}
public boolean isValid() {
return true;
}
/**
* Creates the page's content.
*/
public void createControl(Composite parent) {
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); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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) {
fJavaElement= null;
}
};
fSearchFor[FIELD].addSelectionListener(javaElementInitializer);
fSearchFor[METHOD].addSelectionListener(javaElementInitializer);
fSearchFor[PACKAGE].addSelectionListener(javaElementInitializer);
fSearchFor[TYPE].addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleSearchForSelected(((Button)e.widget).getSelection());
}
});
setControl(result);
WorkbenchHelp.setHelp(result, new Object[] { IJavaHelpContextIds.JAVA_SEARCH_PAGE });
}
private Control createExpression(Composite parent) {
Group result= new Group(parent, SWT.NONE); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | result.setText(SearchMessages.getString("SearchPage.expression.label"));
GridLayout layout= new GridLayout();
layout.numColumns= 1;
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);
}
});
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint= convertWidthInCharsToPixels(30);
fPattern.setLayoutData(gd);
Label label= new Label(result, SWT.LEFT);
label.setText(SearchMessages.getString("SearchPage.expression.pattern"));
return result;
}
private void handlePatternSelected() {
if (fPattern.getSelectionIndex() < 0)
return;
int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex(); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | SearchPatternData values= (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[values.searchFor].setSelection(true);
fLimitTo[values.limitTo].setSelection(true);
fLimitTo[IMPLEMENTORS].setEnabled((values.searchFor == TYPE));
fLimitTo[DECLARATIONS].setEnabled((values.searchFor != PACKAGE));
fLimitTo[ALL_OCCURRENCES].setEnabled((values.searchFor != PACKAGE));
fInitialPattern= values.pattern;
fPattern.setText(fInitialPattern);
fJavaElement= values.javaElement;
if (values.workingSet != null)
getContainer().setSelectedWorkingSet(values.workingSet);
else
getContainer().setSelectedScope(values.scope);
}
private void handleSearchForSelected(boolean state) {
boolean implState= fLimitTo[IMPLEMENTORS].getSelection();
if (!state && implState) {
fLimitTo[IMPLEMENTORS].setSelection(false);
fLimitTo[REFERENCES].setSelection(true);
}
fLimitTo[IMPLEMENTORS].setEnabled(state);
fJavaElement= null;
}
private Control createSearchFor(Composite parent) {
Group result= new Group(parent, SWT.NONE); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | result.setText(SearchMessages.getString("SearchPage.searchFor.label"));
GridLayout layout= new GridLayout();
layout.numColumns= 3;
result.setLayout(layout);
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() { |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | fJavaElement= null;
ISelection selection= getSelection();
SearchPatternData values= null;
values= tryTypedTextSelection(selection);
if (values == null)
values= trySelection(selection);
if (values == null)
values= trySimpleTextSelection(selection);
if (values == null)
values= getDefaultInitValues();
fSearchFor[values.searchFor].setSelection(true);
fLimitTo[values.limitTo].setSelection(true);
if (values.searchFor != TYPE)
fLimitTo[IMPLEMENTORS].setEnabled(false);
fInitialPattern= values.pattern;
fPattern.setText(fInitialPattern);
}
private SearchPatternData tryTypedTextSelection(ISelection selection) {
if (selection instanceof ITextSelection) {
IEditorPart e= getEditorPart();
if (e != null) {
ITextSelection ts= (ITextSelection)selection;
ICodeAssist assist= getCodeAssist(e);
if (assist != null) {
IJavaElement[] elements= null;
try {
elements= assist.codeSelect(ts.getOffset(), ts.getLength());
} catch (JavaModelException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | }
if (elements != null && elements.length > 0) {
if (elements.length == 1)
fJavaElement= elements[0];
else
fJavaElement= chooseFromList(elements);
if (fJavaElement != null)
return determineInitValuesFrom(fJavaElement);
}
}
}
}
return null;
}
private ICodeAssist getCodeAssist(IEditorPart editorPart) {
IEditorInput input= editorPart.getEditorInput();
if (input instanceof ClassFileEditorInput)
return ((ClassFileEditorInput)input).getClassFile();
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
return manager.getWorkingCopy(input);
}
private SearchPatternData trySelection(ISelection selection) {
SearchPatternData result= null;
if (selection == null)
return result;
Object o= null;
if (selection instanceof IStructuredSelection)
o= ((IStructuredSelection)selection).getFirstElement();
if (o instanceof IJavaElement) { |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | fJavaElement= (IJavaElement)o;
result= determineInitValuesFrom(fJavaElement);
} else if (o instanceof ISearchResultViewEntry) {
fJavaElement= getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker());
result= determineInitValuesFrom(fJavaElement);
} else if (o instanceof IAdaptable) {
IWorkbenchAdapter element= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class);
if (element != null)
result= new SearchPatternData(TYPE, REFERENCES, element.getLabel(o), null);
}
return result;
}
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; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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;
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; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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)
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;
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; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | }
if (mainType == null)
break;
searchFor= TYPE;
limitTo= REFERENCES;
pattern= JavaModelUtil.getFullyQualifiedName(mainType);
break;
case IJavaElement.FIELD:
searchFor= FIELD;
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; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | }
if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null)
return new SearchPatternData(searchFor, limitTo, pattern, element);
return null;
}
private SearchPatternData trySimpleTextSelection(ISelection selection) {
SearchPatternData result= null;
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);
}
private IJavaElement chooseFromList(IJavaElement[] openChoices) {
ILabelProvider labelProvider= new JavaElementLabelProvider(
JavaElementLabelProvider.SHOW_DEFAULT |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | | JavaElementLabelProvider.SHOW_CONTAINER_QUALIFICATION);
ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
dialog.setTitle(SearchMessages.getString("SearchElementSelectionDialog.title"));
dialog.setMessage(SearchMessages.getString("SearchElementSelectionDialog.message"));
dialog.setElements(openChoices);
if (dialog.open() == dialog.OK)
return (IJavaElement)dialog.getFirstResult();
return null;
}
/*
* Implements method from ISearchPage
*/
public void setContainer(ISearchPageContainer container) {
fContainer= container;
}
/**
* Returns the search page's container.
*/
private ISearchPageContainer getContainer() {
return fContainer;
}
/**
* Returns the current active selection.
*/
private ISelection getSelection() {
return fContainer.getSelection();
} |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | /**
* 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;
}
private IJavaSearchScope getSelectedResourcesScope() {
ArrayList resources= new ArrayList(10);
if (!getSelection().isEmpty() && getSelection() instanceof IStructuredSelection) {
Iterator iter= ((IStructuredSelection)getSelection()).iterator();
while (iter.hasNext()) {
Object selection= iter.next();
if (selection instanceof IResource)
resources.add(selection);
else if (selection instanceof IAdaptable) {
IResource resource= (IResource)((IAdaptable)selection).getAdapter(IResource.class);
if (resource != null)
resources.add(resource);
}
}
}
return SearchEngine.createJavaSearchScope((IResource[])resources.toArray(new IResource[resources.size()]));
}
} |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import java.text.MessageFormat;
import java.util.HashMap;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.IInputSelectionProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPage; |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java | import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.search.ui.IContextMenuContributor;
import org.eclipse.search.ui.ISearchResultView;
import org.eclipse.search.ui.ISearchResultViewEntry;
import org.eclipse.search.ui.SearchUI;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.search.IJavaSearchResultCollector;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.GroupContext;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
import org.eclipse.jdt.internal.ui.util.SelectionUtil;
public class JavaSearchResultCollector implements IJavaSearchResultCollector {
private static final String MATCH= SearchMessages.getString("SearchResultCollector.match");
private static final String MATCHES= SearchMessages.getString("SearchResultCollector.matches");
private static final String DONE= SearchMessages.getString("SearchResultCollector.done");
private static final String SEARCHING= SearchMessages.getString("SearchResultCollector.searching");
private static final Integer POTENTIAL_MATCH_VALUE= new Integer(POTENTIAL_MATCH);
private IProgressMonitor fMonitor;
private IContextMenuContributor fContextMenu;
private ISearchResultView fView;
private JavaSearchOperation fOperation;
private int fMatchCount= 0;
private Integer[] fMessageFormatArgs= new Integer[1];
private class ContextMenuContributor implements IContextMenuContributor { |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java | public void fill(IMenuManager menu, IInputSelectionProvider inputProvider) {
JavaPlugin.createStandardGroups(menu);
new JavaSearchGroup().fill(menu, new GroupContext(inputProvider));
OpenTypeHierarchyUtil.addToMenu(getWorbenchWindow(), menu, convertSelection(inputProvider.getSelection()));
}
private Object convertSelection(ISelection selection) {
Object element= SelectionUtil.getSingleElement(selection);
if (!(element instanceof ISearchResultViewEntry))
return null;
IMarker marker= ((ISearchResultViewEntry)element).getSelectedMarker();
try {
return JavaCore.create((String) ((IMarker) marker).getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID));
} catch (CoreException ex) {
ExceptionHandler.log(ex, SearchMessages.getString("Search.Error.createJavaElement.message"));
return null;
}
}
}
public JavaSearchResultCollector() {
fContextMenu= new ContextMenuContributor();
}
/**
* @see IJavaSearchResultCollector#aboutToStart(). |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java | */
public void aboutToStart() {
fView= SearchUI.getSearchResultView();
fMatchCount= 0;
if (fView != null) {
fView.searchStarted(
JavaSearchPage.EXTENSION_POINT_ID,
fOperation.getDescription(),
fOperation.getImageDescriptor(),
fContextMenu,
JavaSearchResultLabelProvider.INSTANCE,
new GotoMarkerAction(),
new GroupByKeyComputer(),
fOperation);
}
if (!getProgressMonitor().isCanceled())
getProgressMonitor().subTask(SEARCHING);
}
/**
* @see IJavaSearchResultCollector#accept
*/
public void accept(IResource resource, int start, int end, IJavaElement enclosingElement, int accuracy) throws CoreException {
IMarker marker= resource.createMarker(SearchUI.SEARCH_MARKER);
HashMap attributes;
if (accuracy == POTENTIAL_MATCH) {
attributes= new HashMap(6);
attributes.put(IJavaSearchUIConstants.ATT_ACCURACY, POTENTIAL_MATCH_VALUE);
} else
attributes= new HashMap(5); |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java | JavaCore.addJavaElementMarkerAttributes(attributes, enclosingElement);
attributes.put(IJavaSearchUIConstants.ATT_JE_HANDLE_ID, enclosingElement.getHandleIdentifier());
attributes.put(IMarker.CHAR_START, new Integer(Math.max(start, 0)));
attributes.put(IMarker.CHAR_END, new Integer(Math.max(end, 0)));
if (enclosingElement instanceof IMember && ((IMember)enclosingElement).isBinary())
attributes.put(IWorkbenchPage.EDITOR_ID_ATTR, JavaUI.ID_CF_EDITOR);
else
attributes.put(IWorkbenchPage.EDITOR_ID_ATTR, JavaUI.ID_CU_EDITOR);
marker.setAttributes(attributes);
fView.addMatch(enclosingElement.getElementName(), enclosingElement, resource, marker);
fMatchCount++;
if (!getProgressMonitor().isCanceled())
getProgressMonitor().subTask(getFormattedMatchesString(fMatchCount));
}
/**
* @see IJavaSearchResultCollector#done().
*/
public void done() {
if (!getProgressMonitor().isCanceled()) {
String matchesString= getFormattedMatchesString(fMatchCount);
getProgressMonitor().setTaskName(MessageFormat.format(DONE, new String[]{matchesString}));
}
if (fView != null)
fView.searchFinished();
fView= null;
fMonitor= null;
} |
4,329 | Bug 4329 No results If searched via Package view selection and dialog (1GLDN1X) | The package view initializes the Search dialog with the fully qualified name. This is not found when searching for declarations. Search via context menu in packages view works. ==> (Java) Search should first try to get the Java element and if that fails, display the the element name and not the fully qualified name. NOTES: | resolved fixed | b975be2 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-24T17:13:09Z" | "2001-10-11T03:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultCollector.java | /**
* @see IJavaSearchResultCollector#getProgressMonitor().
*/
public IProgressMonitor getProgressMonitor() {
return fMonitor;
};
void setProgressMonitor(IProgressMonitor pm) {
fMonitor= pm;
}
void setOperation(JavaSearchOperation operation) {
fOperation= operation;
}
private String getFormattedMatchesString(int count) {
if (fMatchCount == 1)
return MATCH;
fMessageFormatArgs[0]= new Integer(count);
return MessageFormat.format(MATCHES, fMessageFormatArgs);
}
private IWorkbenchWindow getWorbenchWindow() {
IWorkbenchWindow wbWindow= null;
if (fView != null && fView.getSite() != null)
wbWindow= fView.getSite().getWorkbenchWindow();
if (wbWindow == null)
wbWindow= JavaPlugin.getActiveWorkbenchWindow();
return wbWindow;
}
} |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | 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.Arrays;
import java.util.Iterator; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | import java.util.List;
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.text.ITextSelection;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.search.internal.ui.SearchManager;
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.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICodeAssist;
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.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditorInput;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.util.RowLayouter;
public class JavaSearchPage extends DialogPage implements ISearchPage, IJavaSearchConstants { |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | public static final String EXTENSION_POINT_ID= "org.eclipse.jdt.ui.JavaSearchPage";
private static List fgPreviousSearchPatterns= new ArrayList(20);
private Combo fPattern;
private String fInitialPattern;
private boolean fFirstTime= true;
private ISearchPageContainer fContainer;
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")};
private IJavaElement fJavaElement;
private static class SearchPatternData { |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | int searchFor;
int limitTo;
String pattern;
IJavaElement javaElement;
int scope;
IWorkingSet workingSet;
public SearchPatternData(int s, int l, String p, IJavaElement element) {
this(s, l, p, element, ISearchPageContainer.WORKSPACE_SCOPE, null);
} |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | public SearchPatternData(int s, int l, String p, IJavaElement element, int scope, IWorkingSet workingSet) {
searchFor= s;
limitTo= l;
pattern= p;
javaElement= element;
this.scope= scope;
this.workingSet= workingSet;
}
}
public boolean performAction() {
SearchPatternData data= getPatternData();
IWorkspace workspace= JavaPlugin.getWorkspace();
IJavaSearchScope scope= null;
String scopeDescription= "";
switch (getContainer().getSelectedScope()) {
case ISearchPageContainer.WORKSPACE_SCOPE:
scopeDescription= SearchMessages.getString("WorkspaceScope");
scope= SearchEngine.createWorkspaceScope();
break;
case ISearchPageContainer.SELECTION_SCOPE:
scopeDescription= SearchMessages.getString("SelectionScope");
scope= getSelectedResourcesScope();
break;
case ISearchPageContainer.WORKING_SET_SCOPE:
IWorkingSet workingSet= getContainer().getSelectedWorkingSet();
scopeDescription= SearchMessages.getFormattedString("WorkingSetScope", new String[] {workingSet.getName()});
scope= SearchEngine.createJavaSearchScope(getContainer().getSelectedWorkingSet().getResources()); |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | }
JavaSearchResultCollector collector= new JavaSearchResultCollector();
JavaSearchOperation op= null;
if (data.javaElement != null && getPattern().equals(fInitialPattern))
op= new JavaSearchOperation(workspace, data.javaElement, data.limitTo, scope, scopeDescription, collector);
else {
data.javaElement= null;
op= new JavaSearchOperation(workspace, data.pattern, 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;
} catch (InterruptedException ex) {
return false;
}
return true;
}
private int getLimitTo() {
for (int i= 0; i < fLimitTo.length; i++) {
if (fLimitTo[i].getSelection())
return i;
}
Assert.isTrue(false, SearchMessages.getString("SearchPage.shouldNeverHappen"));
return -1;
} |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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, SearchMessages.getString("SearchPage.shouldNeverHappen"));
return -1;
}
private String getPattern() {
return fPattern.getText();
}
/**
* 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(); |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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(),
getPattern(),
fJavaElement,
getContainer().getSelectedScope(),
getContainer().getSelectedWorkingSet());
fgPreviousSearchPatterns.add(match);
}
else {
match.searchFor= getSearchFor();
match.limitTo= getLimitTo();
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) { |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | if (fFirstTime) {
fFirstTime= false;
fPattern.setItems(getPreviousSearchPatterns());
initSelections();
}
fPattern.setFocus();
getContainer().setPerformActionEnabled(fPattern.getText().length() > 0);
}
super.setVisible(visible);
}
public boolean isValid() {
return true;
}
/**
* Creates the page's content.
*/
public void createControl(Composite parent) {
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; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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) {
fJavaElement= null;
}
};
fSearchFor[FIELD].addSelectionListener(javaElementInitializer);
fSearchFor[METHOD].addSelectionListener(javaElementInitializer);
fSearchFor[PACKAGE].addSelectionListener(javaElementInitializer);
fSearchFor[TYPE].addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleSearchForSelected(((Button)e.widget).getSelection());
}
});
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= 1; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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);
}
});
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint= convertWidthInCharsToPixels(30);
fPattern.setLayoutData(gd);
Label label= new Label(result, SWT.LEFT);
label.setText(SearchMessages.getString("SearchPage.expression.pattern"));
return result;
}
private void handlePatternSelected() {
if (fPattern.getSelectionIndex() < 0)
return;
int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex();
SearchPatternData values= (SearchPatternData) fgPreviousSearchPatterns.get(index);
for (int i= 0; i < fSearchFor.length; i++)
fSearchFor[i].setSelection(false); |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | for (int i= 0; i < fLimitTo.length; i++)
fLimitTo[i].setSelection(false);
fSearchFor[values.searchFor].setSelection(true);
fLimitTo[values.limitTo].setSelection(true);
fLimitTo[IMPLEMENTORS].setEnabled((values.searchFor == TYPE));
fLimitTo[DECLARATIONS].setEnabled((values.searchFor != PACKAGE));
fLimitTo[ALL_OCCURRENCES].setEnabled((values.searchFor != PACKAGE));
fInitialPattern= values.pattern;
fPattern.setText(fInitialPattern);
fJavaElement= values.javaElement;
if (values.workingSet != null)
getContainer().setSelectedWorkingSet(values.workingSet);
else
getContainer().setSelectedScope(values.scope);
}
private void handleSearchForSelected(boolean state) {
boolean implState= fLimitTo[IMPLEMENTORS].getSelection();
if (!state && implState) {
fLimitTo[IMPLEMENTORS].setSelection(false);
fLimitTo[REFERENCES].setSelection(true);
}
fLimitTo[IMPLEMENTORS].setEnabled(state);
fJavaElement= null;
}
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; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | result.setLayout(layout);
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() {
fJavaElement= null;
ISelection selection= getSelection();
SearchPatternData values= null; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | values= tryTypedTextSelection(selection);
if (values == null)
values= trySelection(selection);
if (values == null)
values= trySimpleTextSelection(selection);
if (values == null)
values= getDefaultInitValues();
fSearchFor[values.searchFor].setSelection(true);
fLimitTo[values.limitTo].setSelection(true);
if (values.searchFor != TYPE)
fLimitTo[IMPLEMENTORS].setEnabled(false);
fInitialPattern= values.pattern;
fPattern.setText(fInitialPattern);
fJavaElement= values.javaElement;
}
private SearchPatternData tryTypedTextSelection(ISelection selection) {
if (selection instanceof ITextSelection) {
IEditorPart e= getEditorPart();
if (e != null) {
ITextSelection ts= (ITextSelection)selection;
ICodeAssist assist= getCodeAssist(e);
if (assist != null) {
IJavaElement[] elements= null;
try {
elements= assist.codeSelect(ts.getOffset(), ts.getLength());
} catch (JavaModelException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message"));
}
if (elements != null && elements.length > 0) { |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | if (elements.length == 1)
fJavaElement= elements[0];
else
fJavaElement= chooseFromList(elements);
if (fJavaElement != null)
return determineInitValuesFrom(fJavaElement);
}
}
}
}
return null;
}
private ICodeAssist getCodeAssist(IEditorPart editorPart) {
IEditorInput input= editorPart.getEditorInput();
if (input instanceof ClassFileEditorInput)
return ((ClassFileEditorInput)input).getClassFile();
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
return manager.getWorkingCopy(input);
}
private SearchPatternData trySelection(ISelection selection) {
SearchPatternData result= null;
if (selection == null)
return result;
Object o= null;
if (selection instanceof IStructuredSelection)
o= ((IStructuredSelection)selection).getFirstElement();
if (o instanceof IJavaElement) {
fJavaElement= (IJavaElement)o;
result= determineInitValuesFrom(fJavaElement); |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | } else if (o instanceof ISearchResultViewEntry) {
fJavaElement= getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker());
result= determineInitValuesFrom(fJavaElement);
} else if (o instanceof IAdaptable) {
IWorkbenchAdapter element= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class);
if (element != null)
result= new SearchPatternData(TYPE, REFERENCES, element.getLabel(o), null);
}
return result;
}
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(); |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | break;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
searchFor= PACKAGE;
limitTo= REFERENCES;
pattern= element.getElementName();
break;
case IJavaElement.PACKAGE_DECLARATION:
searchFor= PACKAGE;
limitTo= REFERENCES;
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; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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)
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;
} |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | if (mainType == null)
break;
element= mainType;
searchFor= TYPE;
limitTo= REFERENCES;
pattern= JavaModelUtil.getFullyQualifiedName(mainType);
break;
case IJavaElement.FIELD:
searchFor= FIELD;
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; |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | }
if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null)
return new SearchPatternData(searchFor, limitTo, pattern, element);
return null;
}
private SearchPatternData trySimpleTextSelection(ISelection selection) {
SearchPatternData result= null;
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);
}
private IJavaElement chooseFromList(IJavaElement[] openChoices) {
ILabelProvider labelProvider= new JavaElementLabelProvider(
JavaElementLabelProvider.SHOW_DEFAULT |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | | JavaElementLabelProvider.SHOW_CONTAINER_QUALIFICATION);
ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
dialog.setTitle(SearchMessages.getString("SearchElementSelectionDialog.title"));
dialog.setMessage(SearchMessages.getString("SearchElementSelectionDialog.message"));
dialog.setElements(openChoices);
if (dialog.open() == dialog.OK)
return (IJavaElement)dialog.getFirstResult();
return null;
}
/*
* Implements method from ISearchPage
*/
public void setContainer(ISearchPageContainer container) {
fContainer= container;
}
/**
* Returns the search page's container.
*/
private ISearchPageContainer getContainer() {
return fContainer;
}
/**
* Returns the current active selection.
*/
private ISelection getSelection() {
return fContainer.getSelection();
} |
5,232 | Bug 5232 Java Search page not initialized correctly from Navigator | 1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view. | resolved fixed | 431fffb | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T10:25:34Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | /**
* 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;
}
private IJavaSearchScope getSelectedResourcesScope() {
ArrayList resources= new ArrayList(10);
if (!getSelection().isEmpty() && getSelection() instanceof IStructuredSelection) {
Iterator iter= ((IStructuredSelection)getSelection()).iterator();
while (iter.hasNext()) {
Object selection= iter.next();
if (selection instanceof IResource)
resources.add(selection);
else if (selection instanceof IAdaptable) {
IResource resource= (IResource)((IAdaptable)selection).getAdapter(IResource.class);
if (resource != null)
resources.add(resource);
}
}
}
return SearchEngine.createJavaSearchScope((IResource[])resources.toArray(new IResource[resources.size()]));
}
} |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | package org.eclipse.jdt.internal.ui.javaeditor;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.Iterator;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection; |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.ui.IEditorActionBarContributor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.EditorActionBarContributor;
import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.DefaultRangeIndicator;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.texteditor.TextOperationAction;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.debug.ui.display.InspectAction;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.AddMethodEntryBreakpointAction;
import org.eclipse.jdt.internal.ui.actions.AddWatchpointAction;
import org.eclipse.jdt.internal.ui.actions.OpenImportDeclarationAction;
import org.eclipse.jdt.internal.ui.actions.ShowInPackageViewAction;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
/**
* Java specific text editor.
*/
public abstract class JavaEditor extends AbstractTextEditor implements ISelectionChangedListener { |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | protected JavaOutlinePage fOutlinePage;
protected String fOutlinerContextMenuId;
/**
* Returns the smallest ISourceReference also implementing IJavaElement
* containing the given position.
*/
abstract protected ISourceReference getJavaSourceReferenceAt(int position); |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | /**
* Sets the input of the editor's outline page.
*/
abstract protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input);
/**
* Default constructor.
*/
public JavaEditor() {
super();
JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
setSourceViewerConfiguration(new JavaSourceViewerConfiguration(textTools, this));
setRangeIndicator(new DefaultRangeIndicator());
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
}
/**
* @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int)
*
* This is the code that can be found in 1.0 fixing the bidi rendering of Java code.
* Looking for something less vulernable in this stream.
*
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
ISourceViewer viewer= super.createSourceViewer(parent, ruler, styles);
StyledText text= viewer.getTextWidget();
text.setBidiColoring(true);
return viewer;
} |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | */
/**
* @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent)
*/
protected boolean affectsTextPresentation(PropertyChangeEvent event) {
JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
return textTools.affectsBehavior(event);
}
/**
* Sets the outliner's context menu ID.
*/
protected void setOutlinerContextMenuId(String menuId) {
fOutlinerContextMenuId= menuId;
}
/**
* @see AbstractTextEditor#editorContextMenuAboutToShow
*/
public void editorContextMenuAboutToShow(IMenuManager menu) {
super.editorContextMenuAboutToShow(menu);
addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_REORGANIZE);
addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_GENERATE);
addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_NEW);
MenuManager search= new JavaSearchGroup().getMenuManagerForGroup(isTextSelectionEmpty());
menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, search);
addAction(menu, ITextEditorActionConstants.GROUP_FIND, "ShowJavaDoc"); |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | addAction(menu, "Inspect");
addAction(menu, "Display");
addAction(menu, "RunToLine");
}
/**
* Creates the outline page used with this editor.
*/
protected JavaOutlinePage createOutlinePage() {
JavaOutlinePage page= new JavaOutlinePage(fOutlinerContextMenuId, this);
page.addSelectionChangedListener(this);
setOutlinePageInput(page, getEditorInput());
page.setAction("OpenImportDeclaration", new OpenImportDeclarationAction(page));
page.setAction("ShowInPackageView", new ShowInPackageViewAction(getSite(), page));
page.setAction("AddMethodEntryBreakpoint", new AddMethodEntryBreakpointAction(page));
page.setAction("AddWatchpoint", new AddWatchpointAction(page));
return page;
}
/**
* Informs the editor that its outliner has been closed.
*/
public void outlinePageClosed() {
if (fOutlinePage != null) { |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | fOutlinePage.removeSelectionChangedListener(this);
fOutlinePage= null;
resetHighlightRange();
}
}
/*
* Get the dektop's StatusLineManager
*/
protected IStatusLineManager getStatusLineManager() {
IEditorActionBarContributor contributor= getEditorSite().getActionBarContributor();
if (contributor instanceof EditorActionBarContributor) {
return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager();
}
return null;
}
/**
* @see AbstractTextEditor#getAdapter(Class)
*/
public Object getAdapter(Class required) {
if (IContentOutlinePage.class.equals(required)) {
if (fOutlinePage == null)
fOutlinePage= createOutlinePage();
return fOutlinePage;
}
return super.getAdapter(required);
} |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | protected void setSelection(ISourceReference reference, boolean moveCursor) {
if (reference != null) {
try {
ISourceRange range= reference.getSourceRange();
int offset= range.getOffset();
int length= range.getLength();
setHighlightRange(offset, length, moveCursor);
if (moveCursor && (reference instanceof IMember)) {
range= ((IMember) reference).getNameRange();
offset= range.getOffset();
length= range.getLength();
if (range != null && offset > -1 && length > 0) {
if (getSourceViewer() != null) {
getSourceViewer().revealRange(offset, length);
getSourceViewer().setSelectedRange(offset, length);
}
}
}
return;
} catch (JavaModelException x) {
} catch (IllegalArgumentException x) {
}
} |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | if (moveCursor)
resetHighlightRange();
}
public void setSelection(ISourceReference reference) {
if (reference == null)
return;
try {
ISourceRange range= reference.getSourceRange();
if (range == null) {
return;
}
reference= getJavaSourceReferenceAt(range.getOffset());
} catch (JavaModelException x) {
}
if (reference == null)
return;
setSelection(reference, true);
if (fOutlinePage != null) {
fOutlinePage.removeSelectionChangedListener(this); |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | fOutlinePage.select(reference);
fOutlinePage.addSelectionChangedListener(this);
}
}
public void selectionChanged(SelectionChangedEvent event) {
ISourceReference reference= null;
ISelection selection= event.getSelection();
Iterator iter= ((IStructuredSelection) selection).iterator();
while (iter.hasNext()) {
Object o= iter.next();
if (o instanceof ISourceReference) {
reference= (ISourceReference) o;
break;
}
}
if (!isActivePart() && JavaPlugin.getActivePage() != null)
JavaPlugin.getActivePage().bringToTop(this);
setSelection(reference, !isActivePart());
}
/**
* @see AbstractTextEditor#adjustHighlightRange(int, int)
*/
protected void adjustHighlightRange(int offset, int length) {
try { |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | ISourceReference reference= getJavaSourceReferenceAt(offset);
while (reference != null) {
ISourceRange range= reference.getSourceRange();
if (offset < range.getOffset() + range.getLength() && range.getOffset() < offset + length) {
setHighlightRange(range.getOffset(), range.getLength(), true);
if (fOutlinePage != null) {
fOutlinePage.removeSelectionChangedListener(this);
fOutlinePage.select(reference);
fOutlinePage.addSelectionChangedListener(this);
}
return;
}
IJavaElement parent= ((IJavaElement) reference).getParent();
if (parent instanceof ISourceReference)
reference= (ISourceReference) parent;
else
reference= null;
}
} catch (JavaModelException x) {
}
resetHighlightRange();
}
protected boolean isActivePart() {
IWorkbenchWindow window= getSite().getWorkbenchWindow();
IPartService service= window.getPartService();
return (this == service.getActivePart());
} |
5,128 | Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly | When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example) | resolved fixed | 5d2cbe7 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:07:33Z" | "2001-10-20T15:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java | /**
* @see AbstractTextEditor#doSetInput
*/
protected void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
setOutlinePageInput(fOutlinePage, input);
}
protected void createActions() {
super.createActions();
setAction("ShowJavaDoc", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ShowJavaDoc.", this, ISourceViewer.INFORMATION));
setAction("Display", new EditorDisplayAction(this, true));
setAction("RunToLine", new RunToLineAction(this));
setAction("Inspect", new InspectAction(this, true));
}
private boolean isTextSelectionEmpty() {
ISelection selection= getSelectionProvider().getSelection();
if (!(selection instanceof ITextSelection))
return true;
return ((ITextSelection)selection).getLength() == 0;
}
public void updatedTitleImage(Image image) {
setTitleImage(image);
}
} |
5,233 | Bug 5233 Internal Error during code assist | Start code assist after item.set (assuming SWT & CTabItem are imported): final CTabItem item= new CTabItem(folder, SWT.NONE); item.set ==> a lot of internal error dialogs are opened. The log is not helpful due to bug in SWT: Log: Thu Oct 25 11:56:08 GMT+02:00 2001 4 org.eclipse.core.runtime 0 Failed to execute runnable (String index out of range: 1) org.eclipse.swt.SWTException: Failed to execute runnable (String index out of range: 1) at org.eclipse.swt.SWT.error(SWT.java:1805) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop(Workbench.java:362) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) | resolved fixed | b0f6f4a | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:08:11Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/HTMLTextPresenter.java | package org.eclipse.jdt.internal.ui.text;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.Iterator;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
import org.eclipse.jdt.internal.ui.JavaPlugin;
public class HTMLTextPresenter implements DefaultInformationControl.IInformationPresenter {
private static final String LINE_DELIM= System.getProperty("line.separator", "\n");
private int fCounter;
private boolean fEnforceUpperLineLimit; |
5,233 | Bug 5233 Internal Error during code assist | Start code assist after item.set (assuming SWT & CTabItem are imported): final CTabItem item= new CTabItem(folder, SWT.NONE); item.set ==> a lot of internal error dialogs are opened. The log is not helpful due to bug in SWT: Log: Thu Oct 25 11:56:08 GMT+02:00 2001 4 org.eclipse.core.runtime 0 Failed to execute runnable (String index out of range: 1) org.eclipse.swt.SWTException: Failed to execute runnable (String index out of range: 1) at org.eclipse.swt.SWT.error(SWT.java:1805) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop(Workbench.java:362) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) | resolved fixed | b0f6f4a | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:08:11Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/HTMLTextPresenter.java | public HTMLTextPresenter(boolean enforceUpperLineLimit) {
super();
fEnforceUpperLineLimit= enforceUpperLineLimit;
}
public HTMLTextPresenter() {
this(true);
}
protected Reader createReader(String hoverInfo, TextPresentation presentation) {
return new HTML2TextReader(new StringReader(hoverInfo), presentation);
}
protected void adaptTextPresentation(TextPresentation presentation, int offset, int insertLength) {
int yoursStart= offset;
int yoursEnd= offset + insertLength -1;
yoursEnd= Math.max(yoursStart, yoursEnd);
Iterator e= presentation.getAllStyleRangeIterator();
while (e.hasNext()) {
StyleRange range= (StyleRange) e.next();
int myStart= range.start;
int myEnd= range.start + range.length -1;
myEnd= Math.max(myStart, myEnd);
if (myEnd < yoursStart)
continue; |
5,233 | Bug 5233 Internal Error during code assist | Start code assist after item.set (assuming SWT & CTabItem are imported): final CTabItem item= new CTabItem(folder, SWT.NONE); item.set ==> a lot of internal error dialogs are opened. The log is not helpful due to bug in SWT: Log: Thu Oct 25 11:56:08 GMT+02:00 2001 4 org.eclipse.core.runtime 0 Failed to execute runnable (String index out of range: 1) org.eclipse.swt.SWTException: Failed to execute runnable (String index out of range: 1) at org.eclipse.swt.SWT.error(SWT.java:1805) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop(Workbench.java:362) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) | resolved fixed | b0f6f4a | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:08:11Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/HTMLTextPresenter.java | if (myStart < yoursStart)
range.length += insertLength;
else
range.start += insertLength;
}
}
private void append(StringBuffer buffer, String string, TextPresentation presentation) {
int length= string.length();
buffer.append(string);
if (presentation != null)
adaptTextPresentation(presentation, fCounter, length);
fCounter += length;
}
private String getIndent(String line) {
int i= 0;
while (Character.isWhitespace(line.charAt(i))) ++ i;
return (line.substring(0, i) + " ");
}
/*
* @see IHoverInformationPresenter#updatePresentation(Display display, String, TextPresentation, int, int)
*/
public String updatePresentation(Display display, String hoverInfo, TextPresentation presentation, int maxWidth, int maxHeight) { |
5,233 | Bug 5233 Internal Error during code assist | Start code assist after item.set (assuming SWT & CTabItem are imported): final CTabItem item= new CTabItem(folder, SWT.NONE); item.set ==> a lot of internal error dialogs are opened. The log is not helpful due to bug in SWT: Log: Thu Oct 25 11:56:08 GMT+02:00 2001 4 org.eclipse.core.runtime 0 Failed to execute runnable (String index out of range: 1) org.eclipse.swt.SWTException: Failed to execute runnable (String index out of range: 1) at org.eclipse.swt.SWT.error(SWT.java:1805) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop(Workbench.java:362) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) | resolved fixed | b0f6f4a | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:08:11Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/HTMLTextPresenter.java | if (hoverInfo == null)
return null;
GC gc= new GC(display);
try {
StringBuffer buffer= new StringBuffer();
int maxNumberOfLines= Math.round(maxHeight / gc.getFontMetrics().getHeight());
fCounter= 0;
LineBreakingReader reader= new LineBreakingReader(createReader(hoverInfo, presentation), gc, maxWidth);
boolean lastLineFormatted= false;
String lastLineIndent= null;
String line=reader.readLine();
boolean lineFormatted= reader.isFormattedLine();
while (line != null) {
if (fEnforceUpperLineLimit && maxNumberOfLines <= 0)
break;
if (buffer.length() > 0) {
if (!lastLineFormatted)
append(buffer, LINE_DELIM, null);
else {
append(buffer, LINE_DELIM, presentation);
if (lastLineIndent != null)
append(buffer, lastLineIndent, presentation); |
5,233 | Bug 5233 Internal Error during code assist | Start code assist after item.set (assuming SWT & CTabItem are imported): final CTabItem item= new CTabItem(folder, SWT.NONE); item.set ==> a lot of internal error dialogs are opened. The log is not helpful due to bug in SWT: Log: Thu Oct 25 11:56:08 GMT+02:00 2001 4 org.eclipse.core.runtime 0 Failed to execute runnable (String index out of range: 1) org.eclipse.swt.SWTException: Failed to execute runnable (String index out of range: 1) at org.eclipse.swt.SWT.error(SWT.java:1805) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop(Workbench.java:362) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) | resolved fixed | b0f6f4a | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:08:11Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/HTMLTextPresenter.java | }
}
append(buffer, line, null);
lastLineFormatted= lineFormatted;
if (!lineFormatted)
lastLineIndent= null;
else if (lastLineIndent == null)
lastLineIndent= getIndent(line);
line= reader.readLine();
lineFormatted= reader.isFormattedLine();
maxNumberOfLines--;
}
if (line != null) {
append(buffer, LINE_DELIM, lineFormatted ? presentation : null);
append(buffer, "...", presentation);
}
return trim(buffer, presentation);
} catch (IOException e) {
JavaPlugin.log(e);
return null;
} finally { |
5,233 | Bug 5233 Internal Error during code assist | Start code assist after item.set (assuming SWT & CTabItem are imported): final CTabItem item= new CTabItem(folder, SWT.NONE); item.set ==> a lot of internal error dialogs are opened. The log is not helpful due to bug in SWT: Log: Thu Oct 25 11:56:08 GMT+02:00 2001 4 org.eclipse.core.runtime 0 Failed to execute runnable (String index out of range: 1) org.eclipse.swt.SWTException: Failed to execute runnable (String index out of range: 1) at org.eclipse.swt.SWT.error(SWT.java:1805) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop(Workbench.java:362) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:433) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) | resolved fixed | b0f6f4a | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-25T15:08:11Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/HTMLTextPresenter.java | gc.dispose();
}
}
private String trim(StringBuffer buffer, TextPresentation presentation) {
int length= buffer.length();
int end= length -1;
while (end >= 0 && Character.isWhitespace(buffer.charAt(end)))
-- end;
if (end == -1)
return "";
if (end < length -1)
buffer.delete(end + 1, length);
else
end= length;
int start= 0;
while (start < end && Character.isWhitespace(buffer.charAt(start)))
++ start;
buffer.delete(0, start);
presentation.setResultWindow(new Region(start, buffer.length()));
return buffer.toString();
}
} |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchGroup.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GroupContext;
import org.eclipse.jdt.ui.IContextMenuConstants;
/**
* Contribute Java search specific menu elements.
*/
public class JavaSearchGroup extends ContextMenuGroup {
private ElementSearchAction[] fActions;
public static final String GROUP_NAME= IContextMenuConstants.GROUP_SEARCH;
public JavaSearchGroup() {
fActions= new ElementSearchAction[] {
new FindReferencesAction(),
new FindDeclarationsAction(),
new FindHierarchyReferencesAction(),
new FindHierarchyDeclarationsAction(), |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchGroup.java | new FindImplementorsAction()
};
}
public void fill(IMenuManager manager, GroupContext context) {
MenuManager javaSearchMM= new MenuManager(SearchMessages.getString(GROUP_NAME), GROUP_NAME);
for (int i= 0; i < fActions.length; i++) {
ElementSearchAction action= fActions[i];
if (action.canOperateOn(context.getSelection()))
javaSearchMM.add(action);
}
if (!javaSearchMM.isEmpty())
manager.appendToGroup(GROUP_NAME, javaSearchMM);
}
public String getGroupName() {
return GROUP_NAME;
}
public MenuManager getMenuManagerForGroup(boolean isTextSelectionEmpty) {
MenuManager javaSearchMM= new MenuManager(SearchMessages.getString(GROUP_NAME), GROUP_NAME);
if (!isTextSelectionEmpty) {
javaSearchMM.add(new GroupMarker(GROUP_NAME));
for (int i= 0; i < fActions.length; i++)
javaSearchMM.appendToGroup(GROUP_NAME, fActions[i]);
}
return javaSearchMM;
}
} |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchOperation.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
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.ui.JavaPluginImages;
public class JavaSearchOperation extends WorkspaceModifyOperation { |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchOperation.java | private IWorkspace fWorkspace;
private IJavaElement fElementPattern;
private int fLimitTo;
private String fStringPattern;
private int fSearchFor;
private IJavaSearchScope fScope;
private String fScopeDescription;
private JavaSearchResultCollector fCollector;
protected JavaSearchOperation(
IWorkspace workspace,
int limitTo,
IJavaSearchScope scope,
String scopeDescription,
JavaSearchResultCollector collector) {
fWorkspace= workspace;
fLimitTo= limitTo;
fScope= scope;
fScopeDescription= scopeDescription;
fCollector= collector;
fCollector.setOperation(this);
}
public JavaSearchOperation(
IWorkspace workspace,
IJavaElement pattern,
int limitTo,
IJavaSearchScope scope,
String scopeDescription,
JavaSearchResultCollector collector) { |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchOperation.java | this(workspace, limitTo, scope, scopeDescription, collector);
fElementPattern= pattern;
}
public JavaSearchOperation(
IWorkspace workspace,
String pattern,
int searchFor,
int limitTo,
IJavaSearchScope scope,
String scopeDescription,
JavaSearchResultCollector collector) {
this(workspace, limitTo, scope, scopeDescription, collector);
fStringPattern= pattern;
fSearchFor= searchFor;
}
protected void execute(IProgressMonitor monitor) throws CoreException {
fCollector.setProgressMonitor(monitor);
SearchEngine engine= new SearchEngine();
if (fElementPattern != null)
engine.search(fWorkspace, fElementPattern, fLimitTo, fScope, fCollector);
else
engine.search(fWorkspace, fStringPattern, fSearchFor, fLimitTo, fScope, fCollector);
}
String getDescription() {
String desc= null;
if (fElementPattern != null) {
if (fLimitTo == IJavaSearchConstants.REFERENCES
&& fElementPattern.getElementType() == IJavaElement.METHOD) |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchOperation.java | desc= PrettySignature.getUnqualifiedMethodSignature((IMethod)fElementPattern);
else
desc= fElementPattern.getElementName();
if ("".equals(desc) && fElementPattern.getElementType() == IJavaElement.PACKAGE_FRAGMENT)
desc= SearchMessages.getString("JavaSearchOperation.default_package");
}
else
desc= fStringPattern;
String[] args= new String[] {desc, "{0}", fScopeDescription};
switch (fLimitTo) {
case IJavaSearchConstants.IMPLEMENTORS:
return SearchMessages.getFormattedString("JavaSearchOperation.implementorsPostfix", args);
case IJavaSearchConstants.DECLARATIONS:
return SearchMessages.getFormattedString("JavaSearchOperation.declarationsPostfix", args);
case IJavaSearchConstants.REFERENCES:
return SearchMessages.getFormattedString("JavaSearchOperation.referencesPostfix", args);
case IJavaSearchConstants.ALL_OCCURRENCES:
return SearchMessages.getFormattedString("JavaSearchOperation.occurrencesPostfix", args);
default:
return SearchMessages.getFormattedString("JavaSearchOperation.occurrencesPostfix", args);
}
}
ImageDescriptor getImageDescriptor() {
if (fLimitTo == IJavaSearchConstants.IMPLEMENTORS || fLimitTo == IJavaSearchConstants.DECLARATIONS)
return JavaPluginImages.DESC_OBJS_SEARCH_DECL;
else
return JavaPluginImages.DESC_OBJS_SEARCH_REF;
}
} |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | 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.Arrays;
import java.util.Iterator; |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | import java.util.List;
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.text.ITextSelection;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow; |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.search.internal.ui.SearchManager;
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.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICodeAssist;
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.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditorInput;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.util.RowLayouter;
public class JavaSearchPage extends DialogPage implements ISearchPage, IJavaSearchConstants { |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | public static final String EXTENSION_POINT_ID= "org.eclipse.jdt.ui.JavaSearchPage";
private static List fgPreviousSearchPatterns= new ArrayList(20);
private Combo fPattern;
private String fInitialPattern;
private boolean fFirstTime= true;
private ISearchPageContainer fContainer;
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")};
private IJavaElement fJavaElement;
private static class SearchPatternData { |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | int searchFor;
int limitTo;
String pattern;
IJavaElement javaElement;
int scope;
IWorkingSet workingSet;
public SearchPatternData(int s, int l, String p, IJavaElement element) {
this(s, l, p, element, ISearchPageContainer.WORKSPACE_SCOPE, null);
}
public SearchPatternData(int s, int l, String p, IJavaElement element, int scope, IWorkingSet workingSet) {
searchFor= s;
limitTo= l;
pattern= p; |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | javaElement= element;
this.scope= scope;
this.workingSet= workingSet;
}
}
public boolean performAction() {
SearchPatternData data= getPatternData();
IWorkspace workspace= JavaPlugin.getWorkspace();
IJavaSearchScope scope= null;
String scopeDescription= "";
switch (getContainer().getSelectedScope()) {
case ISearchPageContainer.WORKSPACE_SCOPE:
scopeDescription= SearchMessages.getString("WorkspaceScope");
scope= SearchEngine.createWorkspaceScope();
break;
case ISearchPageContainer.SELECTION_SCOPE:
scopeDescription= SearchMessages.getString("SelectionScope");
scope= getSelectedResourcesScope();
break;
case ISearchPageContainer.WORKING_SET_SCOPE:
IWorkingSet workingSet= getContainer().getSelectedWorkingSet();
scopeDescription= SearchMessages.getFormattedString("WorkingSetScope", new String[] {workingSet.getName()});
scope= SearchEngine.createJavaSearchScope(getContainer().getSelectedWorkingSet().getResources());
}
JavaSearchResultCollector collector= new JavaSearchResultCollector();
JavaSearchOperation op= null; |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | if (data.javaElement != null && getPattern().equals(fInitialPattern))
op= new JavaSearchOperation(workspace, data.javaElement, data.limitTo, scope, scopeDescription, collector);
else {
data.javaElement= null;
op= new JavaSearchOperation(workspace, data.pattern, 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;
} catch (InterruptedException ex) {
return false;
}
return true;
}
private int getLimitTo() {
for (int i= 0; i < fLimitTo.length; i++) {
if (fLimitTo[i].getSelection())
return i;
}
Assert.isTrue(false, SearchMessages.getString("SearchPage.shouldNeverHappen"));
return -1;
}
private String[] getPreviousSearchPatterns() {
int patternCount= fgPreviousSearchPatterns.size();
String [] patterns= new String[patternCount]; |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | 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, SearchMessages.getString("SearchPage.shouldNeverHappen"));
return -1;
}
private String getPattern() {
return fPattern.getText();
}
/**
* 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)) |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | match= null;
};
if (match == null) {
match= new SearchPatternData(
getSearchFor(),
getLimitTo(),
getPattern(),
fJavaElement,
getContainer().getSelectedScope(),
getContainer().getSelectedWorkingSet());
fgPreviousSearchPatterns.add(match);
}
else {
match.searchFor= getSearchFor();
match.limitTo= getLimitTo();
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()); |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | initSelections();
}
fPattern.setFocus();
getContainer().setPerformActionEnabled(fPattern.getText().length() > 0);
}
super.setVisible(visible);
}
public boolean isValid() {
return true;
}
/**
* Creates the page's content.
*/
public void createControl(Composite parent) {
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(); |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | layouter.perform(createExpression(result));
layouter.perform(createSearchFor(result), createLimitTo(result), -1);
SelectionAdapter javaElementInitializer= new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
fJavaElement= null;
}
};
fSearchFor[FIELD].addSelectionListener(javaElementInitializer);
fSearchFor[METHOD].addSelectionListener(javaElementInitializer);
fSearchFor[PACKAGE].addSelectionListener(javaElementInitializer);
fSearchFor[TYPE].addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleSearchForSelected(((Button)e.widget).getSelection());
}
});
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= 1;
result.setLayout(layout);
fPattern= new Combo(result, SWT.SINGLE | SWT.BORDER); |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | fPattern.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handlePatternSelected();
}
});
fPattern.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
getContainer().setPerformActionEnabled(getPattern().length() > 0);
}
});
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint= convertWidthInCharsToPixels(30);
fPattern.setLayoutData(gd);
Label label= new Label(result, SWT.LEFT);
label.setText(SearchMessages.getString("SearchPage.expression.pattern"));
return result;
}
private void handlePatternSelected() {
if (fPattern.getSelectionIndex() < 0)
return;
int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex();
SearchPatternData values= (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[values.searchFor].setSelection(true);
fLimitTo[values.limitTo].setSelection(true); |
5,231 | Bug 5231 Add search for field read and write references | The UI should support the following new JDT Core feature: Search for field read and field write references. Two new constants have been added on IJavaSearchConstants to be used when creating a field reference search pattern: - READ_REFERENCES: the search results contain *only* read access to a field. - WRITE_REFERENCES: the search results contain *only* write access to a field. If REFERENCES is used, then search results contain both read and write accesss to a field. | resolved fixed | 5c5661b | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-26T13:56:25Z" | "2001-10-25T08:53:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java | fLimitTo[IMPLEMENTORS].setEnabled((values.searchFor == TYPE));
fLimitTo[DECLARATIONS].setEnabled((values.searchFor != PACKAGE));
fLimitTo[ALL_OCCURRENCES].setEnabled((values.searchFor != PACKAGE));
fInitialPattern= values.pattern;
fPattern.setText(fInitialPattern);
fJavaElement= values.javaElement;
if (values.workingSet != null)
getContainer().setSelectedWorkingSet(values.workingSet);
else
getContainer().setSelectedScope(values.scope);
}
private void handleSearchForSelected(boolean state) {
boolean implState= fLimitTo[IMPLEMENTORS].getSelection();
if (!state && implState) {
fLimitTo[IMPLEMENTORS].setSelection(false);
fLimitTo[REFERENCES].setSelection(true);
}
fLimitTo[IMPLEMENTORS].setEnabled(state);
fJavaElement= null;
}
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);
fSearchFor= new Button[fSearchForText.length];
for (int i= 0; i < fSearchForText.length; i++) {
Button button= new Button(result, SWT.RADIO); |