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,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.text.template;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.Serializer;
import org.apache.xml.serialize.SerializerFactory;
import org.eclipse.core.runtime.IPath; |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.internal.core.Assert;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
* A user defined template set.
*/
public class TemplateSet {
private static class TemplateComparator implements Comparator {
public int compare(Object arg0, Object arg1) {
if (arg0 == arg1)
return 0;
if (arg0 == null)
return -1;
Template template0= (Template) arg0;
Template template1= (Template) arg1;
return template0.getName().compareTo(template1.getName());
} |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | }
private static final String DEFAULT_FILE= "default-templates.xml";
private static final String TEMPLATE_FILE= "templates.xml";
private static final String TEMPLATE_TAG= "template";
private static final String NAME_ATTRIBUTE= "name";
private static final String DESCRIPTION_ATTRIBUTE= "description";
private static final String CONTEXT_ATTRIBUTE= "context";
private static final String ENABLED_ATTRIBUTE= "enabled";
private List fTemplates= new ArrayList();
private Comparator fTemplateComparator= new TemplateComparator();
private Template[] fSortedTemplates= new Template[0];
private static TemplateSet fgTemplateSet;
public static TemplateSet getInstance() {
if (fgTemplateSet == null)
fgTemplateSet= create();
return fgTemplateSet;
}
private static InputStream getDefaultsAsStream() {
return TemplateSet.class.getResourceAsStream(DEFAULT_FILE);
}
private static File getTemplateFile() {
IPath path= JavaPlugin.getDefault().getStateLocation();
path= path.append(TEMPLATE_FILE);
return path.toFile();
}
public TemplateSet() { |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | }
private static TemplateSet create() {
try {
File templateFile= getTemplateFile();
if (!templateFile.exists()) {
InputStream inputStream= getDefaultsAsStream();
if (inputStream == null)
return new TemplateSet();
if (!templateFile.createNewFile())
return new TemplateSet();
OutputStream outputStream= new FileOutputStream(templateFile);
byte buffer[]= new byte[65536];
while (true) {
int bytes= inputStream.read(buffer);
if (bytes == -1)
break;
outputStream.write(buffer, 0, bytes);
}
inputStream.close();
outputStream.close();
}
Assert.isTrue(templateFile.exists());
TemplateSet templateSet= new TemplateSet();
templateSet.addFromStream(new FileInputStream(templateFile));
return templateSet; |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | } catch (IOException e) {
JavaPlugin.log(e);
return null;
}
}
/**
* Resets the template set with the default templates.
*/
public void restoreDefaults() {
clear();
addFromStream(getDefaultsAsStream());
}
/**
* Resets (reloads) the template set.
*/
public void reset() {
clear();
try {
addFromStream(new FileInputStream(getTemplateFile()));
} catch (FileNotFoundException e) {
JavaPlugin.log(e);
}
}
public boolean addFromStream(InputStream stream) {
try {
TemplateSet templateSet= new TemplateSet();
DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
DocumentBuilder parser= factory.newDocumentBuilder(); |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | Document document= parser.parse(new InputSource(stream));
NodeList elements= document.getElementsByTagName(TEMPLATE_TAG);
int count= elements.getLength();
for (int i= 0; i != count; i++) {
Node node= elements.item(i);
NamedNodeMap attributes= node.getAttributes();
if (attributes == null)
continue;
String name= attributes.getNamedItem(NAME_ATTRIBUTE).getNodeValue();
String description= attributes.getNamedItem(DESCRIPTION_ATTRIBUTE).getNodeValue();
String context= attributes.getNamedItem(CONTEXT_ATTRIBUTE).getNodeValue();
Node enabledNode= attributes.getNamedItem(ENABLED_ATTRIBUTE);
boolean enabled= (enabledNode == null) || (enabledNode.getNodeValue().equals("true"));
StringBuffer buffer= new StringBuffer();
NodeList children= node.getChildNodes();
for (int j= 0; j != children.getLength(); j++) {
String value= children.item(j).getNodeValue();
if (value != null)
buffer.append(value);
}
String pattern= buffer.toString().trim();
Template template= new Template(name, description, context, pattern);
template.setEnabled(enabled);
add(template);
}
return true;
} catch (ParserConfigurationException e) {
JavaPlugin.log(e); |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | } catch (IOException e) {
JavaPlugin.log(e);
} catch (SAXException e) {
JavaPlugin.log(e);
}
sort();
return false;
}
/**
* Saves the template set.
*/
public boolean save() {
try {
fgTemplateSet.saveToStream(new FileOutputStream(getTemplateFile()));
return true;
} catch (IOException e) {
JavaPlugin.log(e);
return false;
}
}
/**
* Saves the template set as XML.
*/
public void saveToStream(OutputStream stream) throws IOException {
try {
DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
DocumentBuilder builder= factory.newDocumentBuilder();
Document document= builder.newDocument(); |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | Node root= document.createElement("templates");
document.appendChild(root);
for (int i= 0; i != fTemplates.size(); i++) {
Template template= (Template) fTemplates.get(i);
Node node= document.createElement("template");
root.appendChild(node);
NamedNodeMap attributes= node.getAttributes();
Attr name= document.createAttribute(NAME_ATTRIBUTE);
name.setValue(template.getName());
attributes.setNamedItem(name);
Attr description= document.createAttribute(DESCRIPTION_ATTRIBUTE);
description.setValue(template.getDescription());
attributes.setNamedItem(description);
Attr context= document.createAttribute(CONTEXT_ATTRIBUTE);
context.setValue(template.getContext());
attributes.setNamedItem(context);
Attr enabled= document.createAttribute(ENABLED_ATTRIBUTE);
enabled.setValue(template.isEnabled() ? "true" : "false");
attributes.setNamedItem(enabled);
Text pattern= document.createTextNode(template.getPattern());
node.appendChild(pattern);
} |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | OutputFormat format = new OutputFormat();
format.setPreserveSpace(true);
Serializer serializer = SerializerFactory.getSerializerFactory("xml").makeSerializer(stream, format);
serializer.asDOMSerializer().serialize(document);
} catch (ParserConfigurationException e) {
JavaPlugin.log(e);
}
}
/**
* Adds a template to the set.
*/
public void add(Template template) {
fTemplates.add(template);
sort();
}
/**
* Removes a template to the set.
*/
public void remove(Template template) {
fTemplates.remove(template);
sort();
}
/**
* Empties the set.
*/
public void clear() {
fTemplates.clear();
sort(); |
5,095 | Bug 5095 template: toarray incorrect | its defintion should be: (${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]); rather than (${type}[]) ${collection}.toArray(new ${type}[${collection}]); | resolved fixed | 9a943d1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T12:16:52Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java | }
/**
* Returns all templates.
*/
public Template[] getTemplates() {
return (Template[]) fTemplates.toArray(new Template[fTemplates.size()]);
}
/**
* Returns templates matching a prefix.
*/
public Template[] getMatchingTemplates(String prefix, String partitionType) {
Assert.isNotNull(prefix);
Assert.isNotNull(partitionType);
List results= new ArrayList(fSortedTemplates.length);
for (int i= 0; i != fSortedTemplates.length; i++) {
Template template= fSortedTemplates[i];
if (template.matches(prefix, partitionType))
results.add(template);
}
return (Template[]) results.toArray(new Template[results.size()]);
}
private void sort() {
fSortedTemplates= (Template[]) fTemplates.toArray(new Template[fTemplates.size()]);
Arrays.sort(fSortedTemplates, fTemplateComparator);
}
} |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeCache.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.dialogs;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.core.search.JavaWorkspaceScope;
import org.eclipse.jdt.internal.ui.util.AllTypesSearchEngine;
import org.eclipse.jface.operation.IRunnableContext;
public class TypeCache{ |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeCache.java | private static int fgLastStyle= -1;
private static List fgTypeList;
private static boolean fgIsRegistered= false;
private TypeCache(){
}
public static List findTypes(AllTypesSearchEngine engine, int style, IRunnableContext runnableContext, IJavaSearchScope scope) {
checkIfOkToReuse(style, scope);
if (fgTypeList == null) {
fgTypeList= engine.searchTypes(runnableContext, scope, style);
if (!fgIsRegistered){
JavaCore.addElementChangedListener(new DeltaListener());
fgIsRegistered= true;
}
}
if (fgTypeList == null)
return new ArrayList(0);
else
return fgTypeList;
}
private static void checkIfOkToReuse(int style, IJavaSearchScope scope) { |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeCache.java | if (style != fgLastStyle)
flushCache();
if (! (scope instanceof JavaWorkspaceScope))
flushCache();
fgLastStyle= style;
}
private static void flushCache(){
fgTypeList= null;
}
private static class DeltaListener implements IElementChangedListener {
public void elementChanged(ElementChangedEvent event) {
if (fgTypeList == null)
return;
IJavaElementDelta delta= event.getDelta();
IJavaElement element= delta.getElement();
int type= element.getElementType();
if (type == IJavaElement.CLASS_FILE)
return;
processDelta(delta);
}
private boolean mustFlush(IJavaElementDelta delta) {
if (delta.getKind() != IJavaElementDelta.CHANGED)
return true; |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeCache.java | if (delta.getElement().getElementType() == IJavaElement.COMPILATION_UNIT)
return false;
if (delta.getFlags() != IJavaElementDelta.F_CHILDREN)
return true;
if (delta.getElement().getElementType() == IJavaElement.TYPE)
return false;
if ((delta.getAddedChildren() != null)
&& (delta.getAddedChildren().length != 0))
return true;
return false;
}
/*
* returns false iff list is flushed and we can stop processing
*/
private boolean processDelta(IJavaElementDelta delta) {
if (shouldStopProcessing(delta))
return true;
if (mustFlush(delta)) {
flushCache();
return false; |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeCache.java | }
IJavaElementDelta[] affectedChildren= delta.getAffectedChildren();
if (affectedChildren == null)
return true;
for (int i= 0; i < affectedChildren.length; i++) {
if (!processDelta(affectedChildren[i]))
return false;
}
return true;
}
private static boolean shouldStopProcessing(IJavaElementDelta delta) {
switch (delta.getElement().getElementType()) {
case IJavaElement.CLASS_FILE:
case IJavaElement.FIELD:
case IJavaElement.METHOD:
case IJavaElement.INITIALIZER:
case IJavaElement.PACKAGE_DECLARATION:
case IJavaElement.IMPORT_CONTAINER:
case IJavaElement.IMPORT_DECLARATION:
return true;
default:
return false;
}
}
}
} |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.dialogs;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.util.Assert;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.util.AllTypesSearchEngine;
import org.eclipse.jdt.internal.ui.util.TypeInfo;
import org.eclipse.jdt.internal.ui.util.TypeInfoLabelProvider;
/**
* A dialog to select a type from a list of types.
*/
public class TypeSelectionDialog extends TwoPaneElementSelector { |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog.java | private IRunnableContext fRunnableContext;
private IJavaSearchScope fScope;
private int fStyle;
/**
* Constructs a type selection dialog.
* @param parent the parent shell.
* @param context the runnable context.
* @param scope the java search scope.
* @param style the widget style.
*/
public TypeSelectionDialog(Shell parent, IRunnableContext context,
IJavaSearchScope scope, int style)
{
super(parent, new TypeInfoLabelProvider(0),
new TypeInfoLabelProvider(TypeInfoLabelProvider.SHOW_PACKAGE_ONLY + TypeInfoLabelProvider.SHOW_ROOT_POSTFIX));
Assert.isNotNull(context);
Assert.isNotNull(scope);
fRunnableContext= context;
fScope= scope;
fStyle= style; |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog.java | setUpperListLabel(JavaUIMessages.getString("TypeSelectionDialog.upperLabel"));
setLowerListLabel(JavaUIMessages.getString("TypeSelectionDialog.lowerLabel"));
}
public void create() {
if (getFilter() == null)
setFilter("A");
super.create();
}
/**
* @see Window#open()
*/
public int open() {
AllTypesSearchEngine engine= new AllTypesSearchEngine(JavaPlugin.getWorkspace());
List typeList= TypeCache.findTypes(engine, fStyle, fRunnableContext, fScope);
if (typeList.isEmpty()) {
String title= JavaUIMessages.getString("TypeSelectionDialog.notypes.title");
String message= JavaUIMessages.getString("TypeSelectionDialog.notypes.message");
MessageDialog.openInformation(getShell(), title, message);
return CANCEL;
}
TypeInfo[] typeRefs= (TypeInfo[])typeList.toArray(new TypeInfo[typeList.size()]);
setElements(typeRefs);
return super.open();
} |
5,099 | Bug 5099 TypeCache duplicated | TypeCache exists in two packages. Both used! | resolved fixed | 144f383 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:04:23Z" | "2001-10-19T14:00:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/TypeSelectionDialog.java | /**
* @see SelectionStatusDialog#computeResult()
*/
protected void computeResult() {
TypeInfo ref= (TypeInfo) getLowerSelectedElement();
if (ref == null)
return;
try {
IType type= ref.resolveType(fScope);
if (type == null) {
String title= JavaUIMessages.getString("TypeSelectionDialog.errorTitle");
String message= JavaUIMessages.getString("TypeSelectionDialog.errorMessage");
MessageDialog.openError(getShell(), title, message);
setResult(null);
} else {
List result= new ArrayList(1);
result.add(type);
setResult(result);
}
} catch (JavaModelException e) {
String title= JavaUIMessages.getString("TypeSelectionDialog.errorTitle");
String message= JavaUIMessages.getString("TypeSelectionDialog.errorMessage");
MessageDialog.openError(getShell(), title, message);
setResult(null);
}
}
} |
5,092 | Bug 5092 Open type list - no longer works if ever cancelled during indexing | Build 205 Attempting to patch a binary project. I manually expanded its sources in a source folder, and then force a refresh from local. Then immediatly, I tried to open the type I wanted to patch, I got a dialog indicating that indexing was still in progress. I then cancelled my action (open type), and got a "No types available". Tried again later. The dialog came up again with "No types available", even though indexing was finished by then. It seems to have cached the empty list, and I remember this bug around 0.9. | resolved fixed | 0fc6001 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:52:20Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeCache.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.util;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.core.search.JavaWorkspaceScope;
import org.eclipse.jdt.internal.ui.util.AllTypesSearchEngine;
import org.eclipse.jface.operation.IRunnableContext;
/**
* Cache used by AllTypesSeachEngine
*/
class TypeCache{ |
5,092 | Bug 5092 Open type list - no longer works if ever cancelled during indexing | Build 205 Attempting to patch a binary project. I manually expanded its sources in a source folder, and then force a refresh from local. Then immediatly, I tried to open the type I wanted to patch, I got a dialog indicating that indexing was still in progress. I then cancelled my action (open type), and got a "No types available". Tried again later. The dialog came up again with "No types available", even though indexing was finished by then. It seems to have cached the empty list, and I remember this bug around 0.9. | resolved fixed | 0fc6001 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:52:20Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeCache.java | private static int fgLastStyle= -1;
private static List fgTypeList;
private static boolean fgIsRegistered= false;
private TypeCache(){
}
static List getCachedTypes() {
if (fgTypeList == null)
return new ArrayList(0);
else
return fgTypeList;
} |
5,092 | Bug 5092 Open type list - no longer works if ever cancelled during indexing | Build 205 Attempting to patch a binary project. I manually expanded its sources in a source folder, and then force a refresh from local. Then immediatly, I tried to open the type I wanted to patch, I got a dialog indicating that indexing was still in progress. I then cancelled my action (open type), and got a "No types available". Tried again later. The dialog came up again with "No types available", even though indexing was finished by then. It seems to have cached the empty list, and I remember this bug around 0.9. | resolved fixed | 0fc6001 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:52:20Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeCache.java | static boolean canReuse(int style, IJavaSearchScope scope){
if (style != fgLastStyle)
return false;
if (! (scope instanceof JavaWorkspaceScope))
return false;
if (fgTypeList == null)
return false;
return true;
}
static void flush(){
fgTypeList= null;
}
static void setConfiguration(int style){
fgLastStyle= style;
}
static void setCachedTypes(List types){
fgTypeList= types;
}
static void registerIfNecessary(){
if (fgIsRegistered)
return;
JavaCore.addElementChangedListener(new DeltaListener());
fgIsRegistered= true;
}
private static class DeltaListener implements IElementChangedListener { |
5,092 | Bug 5092 Open type list - no longer works if ever cancelled during indexing | Build 205 Attempting to patch a binary project. I manually expanded its sources in a source folder, and then force a refresh from local. Then immediatly, I tried to open the type I wanted to patch, I got a dialog indicating that indexing was still in progress. I then cancelled my action (open type), and got a "No types available". Tried again later. The dialog came up again with "No types available", even though indexing was finished by then. It seems to have cached the empty list, and I remember this bug around 0.9. | resolved fixed | 0fc6001 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:52:20Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeCache.java | public void elementChanged(ElementChangedEvent event) {
if (fgTypeList == null)
return;
IJavaElementDelta delta= event.getDelta();
IJavaElement element= delta.getElement();
int type= element.getElementType();
if (type == IJavaElement.CLASS_FILE)
return;
processDelta(delta);
}
private boolean mustFlush(IJavaElementDelta delta) {
if (delta.getKind() != IJavaElementDelta.CHANGED)
return true; |
5,092 | Bug 5092 Open type list - no longer works if ever cancelled during indexing | Build 205 Attempting to patch a binary project. I manually expanded its sources in a source folder, and then force a refresh from local. Then immediatly, I tried to open the type I wanted to patch, I got a dialog indicating that indexing was still in progress. I then cancelled my action (open type), and got a "No types available". Tried again later. The dialog came up again with "No types available", even though indexing was finished by then. It seems to have cached the empty list, and I remember this bug around 0.9. | resolved fixed | 0fc6001 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:52:20Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeCache.java | if (delta.getElement().getElementType() == IJavaElement.COMPILATION_UNIT)
return false;
if (delta.getFlags() != IJavaElementDelta.F_CHILDREN)
return true;
if (delta.getElement().getElementType() == IJavaElement.TYPE)
return false;
if ((delta.getAddedChildren() != null)
&& (delta.getAddedChildren().length != 0))
return true;
return false;
}
/*
* returns false iff list is flushed and we can stop processing
*/
private boolean processDelta(IJavaElementDelta delta) {
if (mustStopProcessing(delta))
return true;
if (mustFlush(delta)) {
flush();
return false;
}
IJavaElementDelta[] affectedChildren= delta.getAffectedChildren(); |
5,092 | Bug 5092 Open type list - no longer works if ever cancelled during indexing | Build 205 Attempting to patch a binary project. I manually expanded its sources in a source folder, and then force a refresh from local. Then immediatly, I tried to open the type I wanted to patch, I got a dialog indicating that indexing was still in progress. I then cancelled my action (open type), and got a "No types available". Tried again later. The dialog came up again with "No types available", even though indexing was finished by then. It seems to have cached the empty list, and I remember this bug around 0.9. | resolved fixed | 0fc6001 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:52:20Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeCache.java | if (affectedChildren == null)
return true;
for (int i= 0; i < affectedChildren.length; i++) {
if (!processDelta(affectedChildren[i]))
return false;
}
return true;
}
private static boolean mustStopProcessing(IJavaElementDelta delta) {
int type= delta.getElement().getElementType();
if (type == IJavaElement.CLASS_FILE)
return true;
if (type == IJavaElement.FIELD)
return true;
if (type == IJavaElement.METHOD)
return true;
if (type == IJavaElement.INITIALIZER)
return true;
if (type == IJavaElement.PACKAGE_DECLARATION)
return true;
if (type == IJavaElement.IMPORT_CONTAINER)
return true;
if (type == IJavaElement.IMPORT_DECLARATION)
return true;
return false;
}
}
} |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaElementInfoPage.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
/**
* This is a dummy PropertyPage for JavaElements.
* Copied from the ResourceInfoPage
*/
public class JavaElementInfoPage extends PropertyPage {
protected Control createContents(Composite parent) { |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaElementInfoPage.java | noDefaultAndApplyButton();
IJavaElement element= (IJavaElement)getElement();
IResource resource= null;
try {
resource= element.getUnderlyingResource();
} catch (JavaModelException e) {
JavaPlugin.getDefault().logErrorStatus("Creating ElementInfoPage", e.getStatus());
}
Composite composite= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
layout.numColumns= 2;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
Label nameLabel= new Label(composite, SWT.NONE);
nameLabel.setText(JavaUIMessages.getString("JavaElementInfoPage.nameLabel"));
Label nameValueLabel= new Label(composite, SWT.NONE);
nameValueLabel.setText(element.getElementName());
if (resource != null) {
Label pathLabel= new Label(composite, SWT.NONE);
pathLabel.setText(JavaUIMessages.getString("JavaElementInfoPage.resource_path"));
Label pathValueLabel= new Label(composite, SWT.NONE);
pathValueLabel.setText(resource.getFullPath().toString());
}
if (element instanceof ICompilationUnit) {
ICompilationUnit unit= (ICompilationUnit)element; |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaElementInfoPage.java | Label packageLabel= new Label(composite, SWT.NONE);
packageLabel.setText(JavaUIMessages.getString("JavaElementInfoPage.package"));
Label packageName= new Label(composite, SWT.NONE);
packageName.setText(unit.getParent().getElementName());
}
if (element instanceof IPackageFragment) {
IPackageFragment packageFragment= (IPackageFragment)element;
Label packageContents= new Label(composite, SWT.NONE);
packageContents.setText(JavaUIMessages.getString("JavaElementInfoPage.package_contents"));
Label packageContentsType= new Label(composite, SWT.NONE);
try {
if (packageFragment.getKind() == IPackageFragmentRoot.K_SOURCE)
packageContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.source"));
else
packageContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.binary"));
} catch (JavaModelException e) {
packageContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.not_present"));
}
}
if (element instanceof IPackageFragmentRoot) {
Label rootContents= new Label(composite, SWT.NONE);
rootContents.setText(JavaUIMessages.getString("JavaElementInfoPage.classpath_entry_kind"));
Label rootContentsType= new Label(composite, SWT.NONE);
try {
IClasspathEntry entry= JavaModelUtil.getRawClasspathEntry((IPackageFragmentRoot)element);
if (entry != null) {
switch (entry.getEntryKind()) {
case IClasspathEntry.CPE_SOURCE:
rootContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.source")); break; |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaElementInfoPage.java | case IClasspathEntry.CPE_PROJECT:
rootContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.project")); break;
case IClasspathEntry.CPE_LIBRARY:
rootContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.library")); break;
case IClasspathEntry.CPE_VARIABLE:
rootContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.variable"));
Label varPath= new Label(composite, SWT.NONE);
varPath.setText(JavaUIMessages.getString("JavaElementInfoPage.variable_path"));
Label varPathVar= new Label(composite, SWT.NONE);
varPathVar.setText(entry.getPath().makeRelative().toString());
break;
}
} else {
rootContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.not_present"));
}
} catch (JavaModelException e) {
rootContentsType.setText(JavaUIMessages.getString("JavaElementInfoPage.not_present"));
}
}
return composite;
}
/**
*/
protected boolean doOk() {
return true;
}
} |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementSorter.java | package org.eclipse.jdt.internal.ui.viewsupport;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IStorage;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IInitializer;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
/**
* Sorts Java elements:
* Package fragment roots are sorted as ordered in the classpath.
*/
public class JavaElementSorter extends ViewerSorter {
private static final int CU_MEMBERS= 0; |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementSorter.java | private static final int INNER_TYPES= 1;
private static final int CONSTRUCTORS= 2;
private static final int STATIC_INIT= 3;
private static final int STATIC_METHODS= 4;
private static final int INIT= 5;
private static final int METHODS= 6;
private static final int STATIC_FIELDS= 7;
private static final int FIELDS= 8;
private static final int JAVAELEMENTS= 9;
private static final int PACKAGEFRAGMENTROOT= 10;
private static final int RESOURCEPACKAGES= 11;
private static final int RESOURCEFOLDERS= 12;
private static final int RESOURCES= 13;
private static final int STORAGE= 14;
private static final int OTHERS= 20;
private IClasspathEntry[] fClassPath;
/*
* @see ViewerSorter#sort
*/
public void sort(Viewer v, Object[] property) {
fClassPath= null;
try {
super.sort(v, property);
} finally {
fClassPath= null;
}
}
/* |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementSorter.java | * @see ViewerSorter#isSorterProperty
*/
public boolean isSorterProperty(Object element, Object property) {
return true;
}
/*
* @see ViewerSorter#category
*/
public int category(Object element) {
if (element instanceof IJavaElement) {
try {
IJavaElement je= (IJavaElement) element;
switch (je.getElementType()) {
case IJavaElement.METHOD: {
IMethod method= (IMethod) je;
if (method.isConstructor())
return CONSTRUCTORS;
int flags= method.getFlags();
return Flags.isStatic(flags) ? STATIC_METHODS : METHODS;
}
case IJavaElement.FIELD: {
int flags= ((IField) je).getFlags();
return Flags.isStatic(flags) ? STATIC_FIELDS : FIELDS;
}
case IJavaElement.INITIALIZER: {
int flags= ((IInitializer) je).getFlags(); |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementSorter.java | return Flags.isStatic(flags) ? STATIC_INIT : INIT;
}
case IJavaElement.TYPE: {
if (((IType)element).getDeclaringType() != null) {
return INNER_TYPES;
} else {
return CU_MEMBERS;
}
}
case IJavaElement.PACKAGE_DECLARATION:
return CU_MEMBERS;
case IJavaElement.IMPORT_CONTAINER:
return CU_MEMBERS;
case IJavaElement.PACKAGE_FRAGMENT:
IPackageFragment pack= (IPackageFragment) je;
if (!pack.hasChildren() && pack.getNonJavaResources().length > 0) {
return RESOURCEPACKAGES;
}
if (pack.getParent().getUnderlyingResource() instanceof IProject) {
return PACKAGEFRAGMENTROOT;
}
break;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
return PACKAGEFRAGMENTROOT;
}
} catch (JavaModelException x) {
JavaPlugin.log(x); |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementSorter.java | }
return JAVAELEMENTS;
} else if (element instanceof IFile) {
return RESOURCES;
} else if (element instanceof IContainer) {
return RESOURCEFOLDERS;
} else if (element instanceof IStorage) {
return STORAGE;
}
return OTHERS;
}
/*
* @see ViewerSorter#compare
*/
public int compare(Viewer viewer, Object e1, Object e2) {
int cat1= category(e1);
int cat2= category(e2);
if (cat1 != cat2)
return cat1 - cat2;
switch (cat1) {
case OTHERS:
return 0;
case CU_MEMBERS:
return 0;
case PACKAGEFRAGMENTROOT:
int p1= getClassPathIndex(JavaModelUtil.getPackageFragmentRoot((IJavaElement)e1)); |
5,093 | Bug 5093 Lost exported classpath entries | Build 205 1. Create new java project 2. Open build path properties 3. Check JRE_LIB so it is exported 4. Press OK 5. Open build path properties again Observe: JRE_LIB is not exported (but it is according to the .classpath) If you press OK without paying attention, you will loose the fact that JRE_LIB was exported. | resolved fixed | 007faab | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T13:58:58Z" | "2001-10-19T08:26:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementSorter.java | int p2= getClassPathIndex(JavaModelUtil.getPackageFragmentRoot((IJavaElement)e2));
return p2 - p1;
case STORAGE:
return ((IStorage)e1).getName().compareToIgnoreCase(((IStorage)e2).getName());
case RESOURCES:
case RESOURCEFOLDERS:
return ((IResource)e1).getName().compareToIgnoreCase(((IResource)e2).getName());
case RESOURCEPACKAGES:
return ((IJavaElement)e1).getElementName().compareToIgnoreCase(((IJavaElement)e2).getElementName());
default:
return ((IJavaElement)e1).getElementName().compareTo(((IJavaElement)e2).getElementName());
}
}
private int getClassPathIndex(IPackageFragmentRoot root) {
try {
if (fClassPath == null)
fClassPath= root.getJavaProject().getResolvedClasspath(true);
} catch (JavaModelException e) {
return 0;
}
for (int i= 0; i < fClassPath.length; i++) {
if (fClassPath[i].getPath().equals(root.getPath()))
return i;
}
return 0;
}
}; |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | package org.eclipse.jdt.internal.ui.preferences;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document; |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.template.Template;
import org.eclipse.jdt.internal.ui.text.template.TemplateContentProvider;
import org.eclipse.jdt.internal.ui.text.template.TemplateContext;
import org.eclipse.jdt.internal.ui.text.template.TemplateLabelProvider;
import org.eclipse.jdt.internal.ui.text.template.TemplateMessages;
import org.eclipse.jdt.internal.ui.text.template.TemplateSet;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
public class TemplatePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | private static final String PREF_FORMAT_TEMPLATES= JavaUI.ID_PLUGIN + ".template.format";
private CheckboxTableViewer fTableViewer;
private Button fAddButton;
private Button fEditButton;
private Button fImportButton;
private Button fExportButton;
private Button fExportAllButton;
private Button fRemoveButton;
private Button fEnableAllButton;
private Button fDisableAllButton;
private SourceViewer fPatternViewer;
private Button fFormatButton;
public TemplatePreferencePage() {
super();
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(TemplateMessages.getString("TemplatePreferencePage.message"));
}
/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite ancestor) {
Composite parent= new Composite(ancestor, SWT.NULL);
GridLayout layout= new GridLayout();
layout.numColumns= 2;
layout.marginHeight= 0;
layout.marginWidth= 0;
parent.setLayout(layout);
fTableViewer= new CheckboxTableViewer(parent, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | Table table= fTableViewer.getTable();
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= convertWidthInCharsToPixels(80);
data.heightHint= convertHeightInCharsToPixels(10);
fTableViewer.getTable().setLayoutData(data);
table.setHeaderVisible(true);
table.setLinesVisible(true);
TableLayout tableLayout= new TableLayout();
table.setLayout(tableLayout);
TableColumn column1= table.getColumn(0);
column1.setText(TemplateMessages.getString("TemplatePreferencePage.column.name"));
TableColumn column2= new TableColumn(table, SWT.NULL);
column2.setText(TemplateMessages.getString("TemplatePreferencePage.column.context"));
TableColumn column3= new TableColumn(table, SWT.NULL);
column3.setText(TemplateMessages.getString("TemplatePreferencePage.column.description"));
tableLayout.addColumnData(new ColumnWeightData(30));
tableLayout.addColumnData(new ColumnWeightData(20));
tableLayout.addColumnData(new ColumnWeightData(70));
fTableViewer.setLabelProvider(new TemplateLabelProvider());
fTableViewer.setContentProvider(new TemplateContentProvider(fTableViewer, TemplateSet.getInstance()));
fTableViewer.setSorter(new ViewerSorter() {
public int compare(Viewer viewer, Object object1, Object object2) {
if ((object1 instanceof Template) && (object2 instanceof Template)) { |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | Template left= (Template) object1;
Template right= (Template) object2;
int result= left.getName().compareToIgnoreCase(right.getName());
if (result != 0)
return result;
return left.getDescription().compareToIgnoreCase(right.getDescription());
}
return super.compare(viewer, object1, object2);
}
public boolean isSorterProperty(Object element, String property) {
return true;
}
});
fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent e) {
selectionChanged1();
}
});
fTableViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
Template template= (Template) event.getElement();
template.setEnabled(event.getChecked());
}
});
Composite buttons= new Composite(parent, SWT.NULL);
buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
layout= new GridLayout();
layout.marginHeight= 0; |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | layout.marginWidth= 0;
buttons.setLayout(layout);
fAddButton= new Button(buttons, SWT.PUSH);
fAddButton.setLayoutData(getButtonGridData(fAddButton));
fAddButton.setText(TemplateMessages.getString("TemplatePreferencePage.new"));
fAddButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
add();
}
});
fEditButton= new Button(buttons, SWT.PUSH);
fEditButton.setLayoutData(getButtonGridData(fEditButton));
fEditButton.setText(TemplateMessages.getString("TemplatePreferencePage.edit"));
fEditButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
edit();
}
});
fImportButton= new Button(buttons, SWT.PUSH);
fImportButton.setLayoutData(getButtonGridData(fImportButton));
fImportButton.setText(TemplateMessages.getString("TemplatePreferencePage.import"));
fImportButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
import_();
}
});
fExportButton= new Button(buttons, SWT.PUSH);
fExportButton.setLayoutData(getButtonGridData(fExportButton));
fExportButton.setText(TemplateMessages.getString("TemplatePreferencePage.export")); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | fExportButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
export();
}
});
fExportAllButton= new Button(buttons, SWT.PUSH);
fExportAllButton.setLayoutData(getButtonGridData(fExportButton));
fExportAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.export.all"));
fExportAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
exportAll();
}
});
fRemoveButton= new Button(buttons, SWT.PUSH);
fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton));
fRemoveButton.setText(TemplateMessages.getString("TemplatePreferencePage.remove"));
fRemoveButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
remove();
}
});
fEnableAllButton= new Button(buttons, SWT.PUSH);
fEnableAllButton.setLayoutData(getButtonGridData(fEnableAllButton));
fEnableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.enable.all"));
fEnableAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
enableAll(true);
}
}); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | fDisableAllButton= new Button(buttons, SWT.PUSH);
fDisableAllButton.setLayoutData(getButtonGridData(fDisableAllButton));
fDisableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.disable.all"));
fDisableAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
enableAll(false);
}
});
fPatternViewer= createViewer(parent);
fFormatButton= new Button(parent, SWT.CHECK);
fFormatButton.setText(TemplateMessages.getString("TemplatePreferencePage.use.code.formatter"));
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
fFormatButton.setSelection(prefs.getBoolean(PREF_FORMAT_TEMPLATES));
fTableViewer.setInput(TemplateSet.getInstance());
fTableViewer.setAllChecked(false);
fTableViewer.setCheckedElements(getEnabledTemplates());
updateButtons();
WorkbenchHelp.setHelp(parent, new DialogPageContextComputer(this, IJavaHelpContextIds.JRE_PREFERENCE_PAGE));
return parent;
}
private Template[] getEnabledTemplates() {
Template[] templates= TemplateSet.getInstance().getTemplates();
List list= new ArrayList(templates.length);
for (int i= 0; i != templates.length; i++) |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | if (templates[i].isEnabled())
list.add(templates[i]);
return (Template[]) list.toArray(new Template[list.size()]);
}
private SourceViewer createViewer(Composite parent) {
SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER );
JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
viewer.configure(new JavaSourceViewerConfiguration(tools, null));
viewer.setEditable(false);
viewer.setDocument(new Document());
Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
viewer.getTextWidget().setFont(font);
Control control= viewer.getControl();
GridData data= new GridData(GridData.FILL_BOTH);
data.heightHint= convertHeightInCharsToPixels(5);
control.setLayoutData(data);
return viewer;
}
private static GridData getButtonGridData(Button button) {
GridData data= new GridData(GridData.FILL_HORIZONTAL);
data.widthHint= SWTUtil.getButtonWidthHint(button);
data.heightHint= SWTUtil.getButtonHeigthHint(button);
return data; |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | }
private void selectionChanged1() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
if (selection.size() == 1) {
Template template= (Template) selection.getFirstElement();
fPatternViewer.getTextWidget().setText(template.getPattern());
} else {
fPatternViewer.getTextWidget().setText("");
}
updateButtons();
}
private void updateButtons() {
int selectionCount= ((IStructuredSelection) fTableViewer.getSelection()).size();
int itemCount= fTableViewer.getTable().getItemCount();
fEditButton.setEnabled(selectionCount == 1);
fExportButton.setEnabled(selectionCount > 0);
fRemoveButton.setEnabled(selectionCount > 0 && selectionCount <= itemCount);
fEnableAllButton.setEnabled(itemCount > 0);
fDisableAllButton.setEnabled(itemCount > 0);
}
private void add() {
Template template= new Template();
template.setContext(TemplateContext.JAVA);
EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false);
if (dialog.open() == dialog.OK) { |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | TemplateSet.getInstance().add(template);
fTableViewer.refresh();
fTableViewer.setChecked(template, template.isEnabled());
fTableViewer.setSelection(new StructuredSelection(template));
}
}
private void edit() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
Template template= (Template) selection.getFirstElement();
EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, true);
if (dialog.open() == dialog.OK) {
fTableViewer.refresh(template);
fTableViewer.setChecked(template, template.isEnabled());
fTableViewer.setSelection(new StructuredSelection(template));
}
}
private void import_() {
FileDialog dialog= new FileDialog(getShell());
dialog.setText(TemplateMessages.getString("TemplatePreferencePage.import.title"));
dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.import.extension")});
String path= dialog.open();
if (path == null)
return;
try {
FileInputStream stream= new FileInputStream(path);
TemplateSet.getInstance().addFromStream(stream); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | fTableViewer.refresh();
fTableViewer.setAllChecked(false);
fTableViewer.setCheckedElements(getEnabledTemplates());
} catch (IOException e) {
JavaPlugin.log(e);
MessageDialog.openError(getShell(), TemplateMessages.getString("TemplatePreferencePage.error.import"), e.getMessage());
}
}
private void exportAll() {
export(TemplateSet.getInstance());
}
private void export() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
Object[] templates= selection.toArray();
TemplateSet templateSet= new TemplateSet();
for (int i= 0; i != templates.length; i++)
templateSet.add((Template) templates[i]);
export(templateSet);
}
private void export(TemplateSet templateSet) {
FileDialog dialog= new FileDialog(getShell(), SWT.SAVE);
dialog.setText(TemplateMessages.getFormattedString("TemplatePreferencePage.export.title", new Integer(templateSet.getTemplates().length)));
dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.export.extension")});
dialog.setFileName(TemplateMessages.getString("TemplatePreferencePage.export.filename"));
String path= dialog.open(); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | if (path == null)
return;
try {
FileOutputStream stream= new FileOutputStream(path);
templateSet.saveToStream(stream);
} catch (IOException e) {
JavaPlugin.log(e);
MessageDialog.openError(getShell(), TemplateMessages.getString("TemplatePreferencePage.error.export"), e.getMessage());
}
}
private void remove() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
Iterator elements= selection.iterator();
while (elements.hasNext()) {
Template template= (Template) elements.next();
TemplateSet.getInstance().remove(template);
}
fTableViewer.refresh();
}
private void enableAll(boolean enable) {
Template[] templates= TemplateSet.getInstance().getTemplates();
for (int i= 0; i != templates.length; i++)
templates[i].setEnabled(enable);
fTableViewer.setAllChecked(enable);
} |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | /*
* @see IWorkbenchPreferencePage#init(IWorkbench)
*/
public void init(IWorkbench workbench) {}
/*
* @see Control#setVisible(boolean)
*/
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible)
setTitle(TemplateMessages.getString("TemplatePreferencePage.title"));
}
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
fFormatButton.setSelection(prefs.getDefaultBoolean(PREF_FORMAT_TEMPLATES));
TemplateSet.getInstance().restoreDefaults();
fTableViewer.refresh();
fTableViewer.setAllChecked(false);
fTableViewer.setCheckedElements(getEnabledTemplates());
}
/*
* @see PreferencePage#performOk()
*/ |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java | public boolean performOk() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
prefs.setValue(PREF_FORMAT_TEMPLATES, fFormatButton.getSelection());
TemplateSet.getInstance().save();
return super.performOk();
}
/*
* @see PreferencePage#performCancel()
*/
public boolean performCancel() {
TemplateSet.getInstance().reset();
return super.performCancel();
}
/**
* Initializes the default values of this page in the preference bundle.
* Will be called on startup of the JavaPlugin
*/
public static void initDefaults(IPreferenceStore prefs) {
prefs.setDefault(PREF_FORMAT_TEMPLATES, true);
}
public static boolean useCodeFormatter() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
return prefs.getBoolean(PREF_FORMAT_TEMPLATES);
}
} |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProcessor.java | package org.eclipse.jdt.internal.ui.text.java;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.template.TemplateEngine;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
/**
* Java completion processor.
*/
public class JavaCompletionProcessor implements IContentAssistProcessor { |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProcessor.java | private IEditorPart fEditor;
private ResultCollector fCollector;
private IWorkingCopyManager fManager;
private IContextInformationValidator fValidator;
private TemplateEngine fTemplateEngine;
public JavaCompletionProcessor(IEditorPart editor) {
fEditor= editor;
fCollector= new ResultCollector();
fManager= JavaPlugin.getDefault().getWorkingCopyManager();
fTemplateEngine= new TemplateEngine(TemplateEngine.JAVA);
}
/**
* @see IContentAssistProcessor#getErrorMessage()
*/
public String getErrorMessage() {
return fCollector.getErrorMessage();
}
/**
* @see IContentAssistProcessor#getContextInformationValidator()
*/
public IContextInformationValidator getContextInformationValidator() {
if (fValidator == null)
fValidator= new JavaParameterListValidator();
return fValidator;
}
/** |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProcessor.java | * @see IContentAssistProcessor#getContextInformationAutoActivationCharacters()
*/
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
/**
* @see IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
*/
public char[] getCompletionProposalAutoActivationCharacters() {
return new char[] { '.', '(' };
}
/**
* @see IContentAssistProcessor#computeContextInformation(ITextViewer, int)
*/
public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
return null;
}
/**
* @see IContentAssistProcessor#computeCompletionProposals(ITextViewer, int)
*/
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
ICompilationUnit unit= fManager.getWorkingCopy(fEditor.getEditorInput());
IDocument document= viewer.getDocument();
try {
if (unit != null) {
fCollector.reset(unit.getJavaProject(), unit);
Point selection= viewer.getSelectedRange();
if (selection.y > 0) |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProcessor.java | fCollector.setRegionToReplace(selection.x, selection.y);
unit.codeComplete(offset, fCollector);
}
} catch (JavaModelException x) {
Shell shell= viewer.getTextWidget().getShell();
ErrorDialog.openError(shell, JavaTextMessages.getString("CompletionProcessor.error.accessing.title"), JavaTextMessages.getString("CompletionProcessor.error.accessing.message"), x.getStatus());
}
ICompletionProposal[] results= fCollector.getResults();
try {
if (unit != null) {
fTemplateEngine.reset(viewer);
fTemplateEngine.complete(unit, offset);
}
} catch (JavaModelException x) {
Shell shell= viewer.getTextWidget().getShell();
ErrorDialog.openError(shell, JavaTextMessages.getString("CompletionProcessor.error.accessing.title"), JavaTextMessages.getString("CompletionProcessor.error.accessing.message"), x.getStatus());
}
ICompletionProposal[] exactTemplateResults= fTemplateEngine.getExactResults();
ICompletionProposal[] notExactTemplateResults= fTemplateEngine.getNotExactResults();
ICompletionProposal[] total= new ICompletionProposal[results.length + exactTemplateResults.length + notExactTemplateResults.length];
System.arraycopy(exactTemplateResults, 0, total, 0, exactTemplateResults.length);
System.arraycopy(results, 0, total, exactTemplateResults.length, results.length);
System.arraycopy(notExactTemplateResults, 0, total, exactTemplateResults.length + results.length, notExactTemplateResults.length);
return total;
}
} |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionProcessor.java | package org.eclipse.jdt.internal.ui.text.javadoc;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.template.TemplateEngine;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
/**
* Simple Java doc completion processor.
*/
public class JavaDocCompletionProcessor implements IContentAssistProcessor { |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionProcessor.java | private IEditorPart fEditor;
private IWorkingCopyManager fManager;
private TemplateEngine fTemplateEngine;
public JavaDocCompletionProcessor(IEditorPart editor) {
fEditor= editor;
fManager= JavaPlugin.getDefault().getWorkingCopyManager();
fTemplateEngine= new TemplateEngine(TemplateEngine.JAVADOC);
}
/**
* @see IContentAssistProcessor#getErrorMessage()
*/
public String getErrorMessage() {
return null;
}
/**
* @see IContentAssistProcessor#getContextInformationValidator()
*/
public IContextInformationValidator getContextInformationValidator() {
return null;
} |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionProcessor.java | /**
* @see IContentAssistProcessor#getContextInformationAutoActivationCharacters()
*/
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
/**
* @see IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
*/
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
/**
* @see IContentAssistProcessor#computeContextInformation(ITextViewer, int)
*/
public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
return null;
}
/**
* @see IContentAssistProcessor#computeCompletionProposals(ITextViewer, int)
*/
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
ICompilationUnit unit= fManager.getWorkingCopy(fEditor.getEditorInput());
IDocument document= viewer.getDocument();
ICompletionProposal[] results= new ICompletionProposal[0];
try {
if (unit != null) {
int offset= documentOffset;
int length= 0; |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionProcessor.java | Point selection= viewer.getSelectedRange();
if (selection.y > 0) {
offset= selection.x;
length= selection.y;
}
CompletionEvaluator evaluator= new CompletionEvaluator(unit, document, offset, length);
results= evaluator.computeProposals();
}
} catch (JavaModelException x) {
}
try {
if (unit != null) {
fTemplateEngine.reset(viewer);
fTemplateEngine.complete(unit, documentOffset);
}
} catch (JavaModelException x) {
}
ICompletionProposal[] exactTemplateResults= fTemplateEngine.getExactResults();
ICompletionProposal[] notExactTemplateResults= fTemplateEngine.getNotExactResults();
ICompletionProposal[] total= new ICompletionProposal[results.length + exactTemplateResults.length + notExactTemplateResults.length];
System.arraycopy(exactTemplateResults, 0, total, 0, exactTemplateResults.length);
System.arraycopy(results, 0, total, exactTemplateResults.length, results.length);
System.arraycopy(notExactTemplateResults, 0, total, exactTemplateResults.length + results.length, notExactTemplateResults.length);
return total;
}
} |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEngine.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.text.template;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.core.Assert;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.ITextViewer;
public class TemplateEngine {
private static final char ARGUMENTS_BEGIN= '(';
private static final char ARGUMENTS_END= ')';
private static final char HTML_TAG_BEGIN= '<';
private static final char HTML_TAG_END= '>';
private static final char JAVADOC_TAG_BEGIN= '@';
/**
* Partition types.
*/
public static String JAVA= "java";
public static String JAVADOC= "javadoc"; |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEngine.java | private String fPartitionType;
private ITextViewer fViewer;
private ArrayList fExactProposals= new ArrayList();
private ArrayList fNotExactProposals= new ArrayList();
public TemplateEngine(String partitionType) {
Assert.isNotNull(partitionType);
fPartitionType= new String(partitionType);
}
/**
* Empties the collector.
*/
public void reset(ITextViewer viewer) {
fViewer= viewer;
fExactProposals.clear();
fNotExactProposals.clear();
}
/**
* Returns an array of templates matching exactly.
*/
public ICompletionProposal[] getExactResults() {
return (ICompletionProposal[]) fExactProposals.toArray(new ICompletionProposal[fExactProposals.size()]);
}
/**
* Returns an array of templates matching not exactly.
*/
public ICompletionProposal[] getNotExactResults() {
return (ICompletionProposal[]) fNotExactProposals.toArray(new ICompletionProposal[fNotExactProposals.size()]); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEngine.java | }
/**
* Inspects the context of the compilation unit around <code>completionPosition</code>
* and feeds the collector with proposals.
* @param collector the collector for template proposals.
* @param sourceUnit the compilation unit.
* @param completionPosition the context position in the compilation unit.
*/
public void complete(ICompilationUnit sourceUnit, int completionPosition)
throws JavaModelException
{
String source= sourceUnit.getSource();
int end = completionPosition;
int start= guessStart(source, end, fPartitionType);
String request= source.substring(start, end);
int index= request.indexOf(ARGUMENTS_BEGIN);
String key;
String[] arguments;
if (index == -1) {
key= request;
arguments= null;
} else {
key= request.substring(0, index);
String allArguments= request.substring(index + 1, request.length() - 1);
List list= new ArrayList();
StringTokenizer tokenizer= new StringTokenizer(allArguments, ","); |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEngine.java | while (tokenizer.hasMoreTokens()) {
String token= tokenizer.nextToken().trim();
list.add(token);
}
arguments= (String[]) list.toArray(new String[list.size()]);
}
Template[] templates= TemplateSet.getInstance().getMatchingTemplates(key, fPartitionType);
TemplateContext context= new TemplateContext(sourceUnit, start, end, fViewer);
for (int i= 0; i != templates.length; i++) {
TemplateProposal proposal= new TemplateProposal(templates[i], arguments, context);
if (templates[i].getName().equals(key)) {
fExactProposals.add(proposal);
} else {
fNotExactProposals.add(proposal);
}
}
}
private static final int guessStart(String source, int end, String partitionType) {
int start= end;
if (partitionType.equals(JAVA)) {
if ((start != 0) && (source.charAt(start - 1) == ARGUMENTS_END)) {
start--;
while ((start != 0) && (source.charAt(start - 1) != ARGUMENTS_BEGIN))
start--;
start--;
if ((start != 0) && Character.isWhitespace(source.charAt(start - 1))) |
4,978 | Bug 4978 Completion list not ordered as expected | Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list | resolved fixed | e607857 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T14:41:16Z" | "2001-10-15T12:46:40Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEngine.java | start--;
}
while ((start != 0) && Character.isUnicodeIdentifierPart(source.charAt(start - 1)))
start--;
if ((start != 0) && Character.isUnicodeIdentifierStart(source.charAt(start - 1)))
start--;
} else if (partitionType.equals(JAVADOC)) {
if ((start != 0) && (source.charAt(start - 1) == HTML_TAG_END))
start--;
while ((start != 0) && Character.isUnicodeIdentifierPart(source.charAt(start - 1)))
start--;
if ((start != 0) && Character.isUnicodeIdentifierStart(source.charAt(start - 1)))
start--;
if ((start != 0) &&
(source.charAt(start - 1) == HTML_TAG_BEGIN) ||
(source.charAt(start - 1) == JAVADOC_TAG_BEGIN))
{
start--;
}
}
return start;
}
} |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.packageview;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.compare.JavaAddElementFromHistory;
import org.eclipse.jdt.internal.ui.compare.JavaReplaceWithEditionAction;
import org.eclipse.jdt.internal.ui.dnd.DelegatingDragAdapter;
import org.eclipse.jdt.internal.ui.dnd.DelegatingDropAdapter;
import org.eclipse.jdt.internal.ui.dnd.LocalSelectionTransfer;
import org.eclipse.jdt.internal.ui.dnd.TransferDragSourceListener;
import org.eclipse.jdt.internal.ui.dnd.TransferDropTargetListener;
import org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditorInput;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput;
import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage;
import org.eclipse.jdt.internal.ui.IPreferencesConstants;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringAction;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringGroup;
import org.eclipse.jdt.internal.ui.refactoring.actions.StructuredSelectionProvider;
import org.eclipse.jdt.internal.ui.reorg.DeleteAction;
import org.eclipse.jdt.internal.ui.reorg.ReorgGroup;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementSorter;
import org.eclipse.jdt.internal.ui.viewsupport.MarkerErrorTickProvider;
import org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer;
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater;
import org.eclipse.jdt.internal.ui.wizards.NewGroup;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.IPackagesViewPart;
import org.eclipse.jdt.ui.JavaElementContentProvider; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeViewerListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.OpenPerspectiveMenu;
import org.eclipse.ui.actions.OpenWithMenu;
import org.eclipse.ui.actions.RefreshAction;
import org.eclipse.ui.dialogs.PropertyDialogAction;
import org.eclipse.ui.help.ViewContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.part.ISetSelectionTarget;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.internal.framelist.BackAction;
import org.eclipse.ui.views.internal.framelist.ForwardAction; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | import org.eclipse.ui.views.internal.framelist.FrameList;
import org.eclipse.ui.views.internal.framelist.GoIntoAction;
import org.eclipse.ui.views.internal.framelist.UpAction;
/**
* The ViewPart for the ProjectExplorer. It listens to part activation events.
* When selection linking with the editor is enabled the view selection tracks
* the active editor page. Similarly when a resource is selected in the packages
* view the corresponding editor is activated.
*/
public class PackageExplorerPart extends ViewPart implements ISetSelectionTarget, IMenuListener, IPackagesViewPart, IPropertyChangeListener {
public final static String VIEW_ID= JavaUI.ID_PACKAGES;
static final String TAG_SELECTION= "selection";
static final String TAG_EXPANDED= "expanded";
static final String TAG_ELEMENT= "element";
static final String TAG_PATH= "path";
static final String TAG_VERTICAL_POSITION= "verticalPosition";
static final String TAG_HORIZONTAL_POSITION= "horizontalPosition";
static final String TAG_FILTERS = "filters";
static final String TAG_FILTER = "filter";
static final String TAG_SHOWLIBRARIES = "showLibraries";
static final String TAG_SHOWBINARIES = "showBinaries";
private JavaElementPatternFilter fPatternFilter= new JavaElementPatternFilter();
private LibraryFilter fLibraryFilter= new LibraryFilter();
private BinaryProjectFilter fBinaryFilter= new BinaryProjectFilter();
private ProblemTreeViewer fViewer;
private PackagesFrameSource fFrameSource;
private FrameList fFrameList; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | private ContextMenuGroup[] fStandardGroups;
private Menu fContextMenu;
private OpenResourceAction fOpenCUAction;
private Action fOpenToAction;
private Action fShowTypeHierarchyAction;
private Action fShowNavigatorAction;
private Action fPropertyDialogAction;
private RefactoringAction fDeleteAction;
private RefreshAction fRefreshAction;
private BackAction fBackAction;
private ForwardAction fForwardAction;
private GoIntoAction fZoomInAction;
private UpAction fUpAction;
private GotoTypeAction fGotoTypeAction;
private GotoPackageAction fGotoPackageAction;
private AddBookmarkAction fAddBookmarkAction;
private FilterSelectionAction fFilterAction;
private ShowLibrariesAction fShowLibrariesAction;
private ShowBinariesAction fShowBinariesAction;
private IMemento fMemento;
private IPartListener fPartListener= new IPartListener() {
public void partActivated(IWorkbenchPart part) {
if (part instanceof IEditorPart)
editorActivated((IEditorPart) part);
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partClosed(IWorkbenchPart part) {
} |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | public void partDeactivated(IWorkbenchPart part) {
}
public void partOpened(IWorkbenchPart part) {
}
};
private ITreeViewerListener fExpansionListener= new ITreeViewerListener() {
public void treeCollapsed(TreeExpansionEvent event) {
}
public void treeExpanded(TreeExpansionEvent event) {
Object element= event.getElement();
if (element instanceof ICompilationUnit ||
element instanceof IClassFile)
expandMainType(element);
}
};
public PackageExplorerPart() {
}
/* (non-Javadoc)
* Method declared on IViewPart.
*/
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
fMemento= memento;
}
/**
* Initializes the default preferences
*/ |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | public static void initDefaults(IPreferenceStore store) {
store.setDefault(TAG_SHOWLIBRARIES, true);
store.setDefault(TAG_SHOWBINARIES, true);
}
/**
* Returns the package explorer part of the active perspective. If
* there isn't any package explorer part <code>null</code> is returned.
*/
public static PackageExplorerPart getFromActivePerspective() {
IViewPart view= JavaPlugin.getActivePage().findView(VIEW_ID);
if (view instanceof PackageExplorerPart)
return (PackageExplorerPart)view;
return null;
}
/**
* Makes the package explorer part visible in the active perspective. If there
* isn't a package explorer part registered <code>null</code> is returned.
* Otherwise the opened view part is returned.
*/
public static PackageExplorerPart openInActivePerspective() {
try {
return (PackageExplorerPart)JavaPlugin.getActivePage().showView(VIEW_ID);
} catch(PartInitException pe) {
return null;
}
}
public void dispose() {
if (fViewer != null) |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | JavaPlugin.getDefault().getProblemMarkerManager().removeListener(fViewer);
if (fContextMenu != null && !fContextMenu.isDisposed())
fContextMenu.dispose();
getSite().getPage().removePartListener(fPartListener);
JavaPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
if (fViewer != null)
fViewer.removeTreeListener(fExpansionListener);
super.dispose();
}
/**
* Implementation of IWorkbenchPart.createPartControl(Composite)
*/
public void createPartControl(Composite parent) {
fViewer= new ProblemTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
boolean showCUChildren= JavaBasePreferencePage.showCompilationUnitChildren();
fViewer.setContentProvider(new JavaElementContentProvider(showCUChildren));
JavaPlugin.getDefault().getProblemMarkerManager().addListener(fViewer);
JavaPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
int labelFlags= JavaElementLabelProvider.SHOW_BASICS | JavaElementLabelProvider.SHOW_OVERLAY_ICONS |
JavaElementLabelProvider.SHOW_SMALL_ICONS | JavaElementLabelProvider.SHOW_VARIABLE | JavaElementLabelProvider.SHOW_PARAMETERS;
JavaElementLabelProvider labelProvider = new JavaElementLabelProvider(labelFlags);
labelProvider.setErrorTickManager(new MarkerErrorTickProvider());
fViewer.setLabelProvider(new DecoratingLabelProvider(labelProvider, null));
fViewer.setSorter(new JavaElementSorter());
fViewer.addFilter(new EmptyInnerPackageFilter());
fViewer.setUseHashlookup(true);
fViewer.addFilter(fPatternFilter); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | fViewer.addFilter(fLibraryFilter);
fViewer.addFilter(fBinaryFilter);
if(fMemento != null)
restoreFilters();
else
initFilterFromPreferences();
fViewer.setInput(findInputElement());
initDragAndDrop();
initFrameList();
initRefreshKey();
updateTitle();
MenuManager menuMgr= new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(this);
fContextMenu= menuMgr.createContextMenu(fViewer.getTree());
fViewer.getTree().setMenu(fContextMenu);
getSite().registerContextMenu(menuMgr, fViewer);
makeActions();
fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
handleSelectionChanged(event);
}
});
fViewer.addDoubleClickListener(new IDoubleClickListener() { |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | public void doubleClick(DoubleClickEvent event) {
handleDoubleClick(event);
}
});
fViewer.getControl().addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
handleKeyPressed(e);
}
});
getSite().setSelectionProvider(fViewer);
getSite().getPage().addPartListener(fPartListener);
IStatusLineManager slManager= getViewSite().getActionBars().getStatusLineManager();
fViewer.addSelectionChangedListener(new StatusBarUpdater(slManager));
fViewer.addTreeListener(fExpansionListener);
if (fMemento != null)
restoreState(fMemento);
fMemento= null;
WorkbenchHelp.setHelp(fViewer.getControl(), new ViewContextComputer(this, IJavaHelpContextIds.PACKAGE_VIEW));
fillActionBars();
}
private void fillActionBars() {
IActionBars actionBars= getViewSite().getActionBars();
IToolBarManager toolBar= actionBars.getToolBarManager();
toolBar.add(fBackAction);
toolBar.add(fForwardAction);
toolBar.add(fUpAction); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | actionBars.updateActionBars();
IMenuManager menu = actionBars.getMenuManager();
menu.add(fFilterAction);
menu.add(fShowLibrariesAction);
menu.add(fShowBinariesAction);
}
private Object findInputElement() {
Object input= getSite().getPage().getInput();
if (input instanceof IWorkspace) {
return JavaCore.create(((IWorkspace)input).getRoot());
} else if (input instanceof IContainer) {
return JavaCore.create((IContainer)input);
}
return JavaCore.create(JavaPlugin.getWorkspace().getRoot());
}
/**
* Answer the property defined by key.
*/
public Object getAdapter(Class key) {
if (key.equals(ISelectionProvider.class))
return fViewer;
return super.getAdapter(key);
}
/** |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | * Returns the tool tip text for the given element.
*/
String getToolTipText(Object element) {
if (!(element instanceof IResource))
return ((ILabelProvider) getViewer().getLabelProvider()).getText(element);
IPath path= ((IResource) element).getFullPath();
if (path.isRoot()) {
return PackagesMessages.getString("PackageExplorer.title");
}
else {
return path.makeRelative().toString();
}
}
/**
* @see IWorkbenchPart#setFocus()
*/
public void setFocus() {
fViewer.getTree().setFocus();
}
/**
* Returns the shell to use for opening dialogs.
* Used in this class, and in the actions.
*/
private Shell getShell() {
return fViewer.getTree().getShell();
}
/**
* Returns the selection provider. |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | */
private ISelectionProvider getSelectionProvider() {
return fViewer;
}
/**
* Returns the current selection.
*/
private ISelection getSelection() {
return fViewer.getSelection();
}
/**
* Called when the context menu is about to open.
* Override to add your own context dependent menu contributions.
*/
public void menuAboutToShow(IMenuManager menu) {
JavaPlugin.createStandardGroups(menu);
IStructuredSelection selection= (IStructuredSelection) fViewer.getSelection();
boolean selectionHasElements= !selection.isEmpty();
Object element= selection.getFirstElement();
if (selection.size() == 1 && fViewer.isExpandable(element))
menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fZoomInAction);
addGotoMenu(menu);
fOpenCUAction.update();
if (fOpenCUAction.isEnabled())
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpenCUAction); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | addOpenWithMenu(menu, selection);
addOpenToMenu(menu, selection);
addRefactoring(menu);
if (selection.size() == 1) {
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new JavaReplaceWithEditionAction(fViewer));
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new JavaAddElementFromHistory(null, fViewer));
}
ContextMenuGroup.add(menu, fStandardGroups, fViewer);
if (fAddBookmarkAction.canOperateOnSelection())
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, fAddBookmarkAction);
menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, fRefreshAction);
fRefreshAction.selectionChanged(selection);
if (selectionHasElements) {
menu.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, fPropertyDialogAction);
}
}
void addGotoMenu(IMenuManager menu) {
MenuManager gotoMenu= new MenuManager(PackagesMessages.getString("PackageExplorer.gotoTitle"));
menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, gotoMenu);
gotoMenu.add(fBackAction);
gotoMenu.add(fForwardAction);
gotoMenu.add(fUpAction);
gotoMenu.add(fGotoTypeAction);
gotoMenu.add(fGotoPackageAction); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
private void makeActions() {
ISelectionProvider provider= getSelectionProvider();
fOpenCUAction= new OpenResourceAction(provider);
fPropertyDialogAction= new PropertyDialogAction(getShell(), provider);
fShowNavigatorAction= new ShowInNavigatorAction(provider);
fAddBookmarkAction= new AddBookmarkAction(provider);
fStandardGroups= new ContextMenuGroup[] {
new NewGroup(),
new BuildGroup(),
new ReorgGroup(),
new JavaSearchGroup()
};
fDeleteAction= new DeleteAction(StructuredSelectionProvider.createFrom(provider));
fRefreshAction= new RefreshAction(getShell());
fFilterAction = new FilterSelectionAction(getShell(), this, PackagesMessages.getString("PackageExplorer.filters"));
fShowLibrariesAction = new ShowLibrariesAction(this, PackagesMessages.getString("PackageExplorer.referencedLibs"));
fShowBinariesAction = new ShowBinariesAction(getShell(), this, PackagesMessages.getString("PackageExplorer.binaryProjects"));
fBackAction= new BackAction(fFrameList);
fForwardAction= new ForwardAction(fFrameList);
fZoomInAction= new GoIntoAction(fFrameList);
fUpAction= new UpAction(fFrameList);
fGotoTypeAction= new GotoTypeAction(this);
fGotoPackageAction= new GotoPackageAction(this);
IActionBars actionService= getViewSite().getActionBars();
actionService.setGlobalActionHandler(IWorkbenchActionConstants.DELETE, fDeleteAction); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
private void addRefactoring(IMenuManager menu){
MenuManager refactoring= new MenuManager(PackagesMessages.getString("PackageExplorer.refactoringTitle"));
ContextMenuGroup.add(refactoring, new ContextMenuGroup[] { new RefactoringGroup() }, fViewer);
if (!refactoring.isEmpty())
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, refactoring);
}
private void addOpenToMenu(IMenuManager menu, IStructuredSelection selection) {
if (selection.size() != 1)
return;
IAdaptable element= (IAdaptable) selection.getFirstElement();
IResource resource= (IResource)element.getAdapter(IResource.class);
if ((resource instanceof IContainer)) {
MenuManager submenu = new MenuManager(PackagesMessages.getString("PackageExplorer.openPerspective"));
submenu.add(new OpenPerspectiveMenu(getSite().getWorkbenchWindow(), resource));
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
}
OpenTypeHierarchyUtil.addToMenu(getSite().getWorkbenchWindow(), menu, element);
}
private void addOpenWithMenu(IMenuManager menu, IStructuredSelection selection) {
if (selection.size() != 1)
return;
IAdaptable element= (IAdaptable)selection.getFirstElement();
Object resource= element.getAdapter(IResource.class); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | if (!(resource instanceof IFile))
return;
MenuManager submenu= new MenuManager(PackagesMessages.getString("PackageExplorer.openWith"));
submenu.add(new OpenWithMenu(getSite().getPage(), (IFile) resource));
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
}
private boolean isSelectionOfType(ISelection s, Class clazz, boolean considerUnderlyingResource) {
if (! (s instanceof IStructuredSelection) || s.isEmpty())
return false;
IStructuredSelection selection= (IStructuredSelection)s;
Iterator iter= selection.iterator();
while (iter.hasNext()) {
Object o= iter.next();
if (clazz.isInstance(o))
return true;
if (considerUnderlyingResource) {
if (! (o instanceof IJavaElement))
return false;
IJavaElement element= (IJavaElement)o;
Object resource= element.getAdapter(IResource.class);
if (! clazz.isInstance(resource))
return false;
}
}
return true;
} |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | private void initDragAndDrop() {
int ops= DND.DROP_COPY | DND.DROP_MOVE;
final LocalSelectionTransfer lt= LocalSelectionTransfer.getInstance();
Transfer[] transfers= new Transfer[] {lt, FileTransfer.getInstance()};
TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] {
new SelectionTransferDropAdapter(fViewer),
new FileTransferDropAdapter(fViewer)
};
fViewer.addDropSupport(ops, transfers, new DelegatingDropAdapter(dropListeners));
Control control= fViewer.getControl();
TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] {
new SelectionTransferDragAdapter(fViewer),
new FileTransferDragAdapter(fViewer)
};
DragSource source= new DragSource(control, ops);
source.addDragListener(new DelegatingDragAdapter(dragListeners));
}
/**
* Handles key events in viewer.
*/
void handleKeyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0){ |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | fDeleteAction.update();
if (fDeleteAction.isEnabled())
fDeleteAction.run();
}
}
/**
* Handles double clicks in viewer.
* Opens editor if file double-clicked.
*/
private void handleDoubleClick(DoubleClickEvent event) {
IStructuredSelection s= (IStructuredSelection) event.getSelection();
Object element= s.getFirstElement();
if (EditorUtility.isOpenInEditor(element) == null) {
if (fOpenCUAction.isEnabled()) {
fOpenCUAction.run();
return;
}
}
if (fViewer.isExpandable(element)) {
if (JavaBasePreferencePage.doubleClockGoesInto())
fZoomInAction.run();
else {
fViewer.setExpandedState(element, !fViewer.getExpandedState(element));
expandMainType(element);
}
}
} |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | /**
* Handles selection changed in viewer.
* Updates global actions.
* Links to editor (if option enabled)
*/
private void handleSelectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel= (IStructuredSelection) event.getSelection();
fZoomInAction.update();
linkToEditor(sel);
}
public void selectReveal(ISelection selection) {
ISelection javaSelection= convertSelection(selection);
fViewer.setSelection(javaSelection, true);
}
private ISelection convertSelection(ISelection s) {
List converted= new ArrayList();
if (s instanceof StructuredSelection) {
Object[] elements= ((StructuredSelection)s).toArray();
for (int i= 0; i < elements.length; i++) {
Object e= elements[i];
if (e instanceof IJavaElement)
converted.add(e);
else if (e instanceof IResource) {
IJavaElement element= JavaCore.create((IResource)e);
if (element != null)
converted.add(element);
else
converted.add(e);
} |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
}
return new StructuredSelection(converted.toArray());
}
public void selectAndReveal(Object element) {
selectReveal(new StructuredSelection(element));
}
/**
* Returns whether the preference to link selection to active editor is enabled.
*/
boolean isLinkingEnabled() {
return JavaBasePreferencePage.linkPackageSelectionToEditor();
}
/**
* Links to editor (if option enabled)
*/
private void linkToEditor(IStructuredSelection selection) {
Object obj= selection.getFirstElement();
Object element= null;
if (selection.size() == 1) {
if (obj instanceof IJavaElement) {
IJavaElement cu= JavaModelUtil.findElementOfKind((IJavaElement)obj, IJavaElement.COMPILATION_UNIT);
if (cu != null)
element= getResourceFor(cu);
if (element == null)
element= JavaModelUtil.findElementOfKind((IJavaElement)obj, IJavaElement.CLASS_FILE); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
else if (obj instanceof IFile)
element= obj;
if (element == null)
return;
IWorkbenchPage page= getSite().getPage();
IEditorPart editorArray[]= page.getEditors();
for (int i= 0; i < editorArray.length; ++i) {
IEditorPart editor= editorArray[i];
Object input= getElementOfInput(editor.getEditorInput());
if (input != null && input.equals(element)) {
page.bringToTop(editor);
if (obj instanceof ISourceReference)
EditorUtility.revealInEditor(editor, (ISourceReference)obj);
return;
}
}
}
}
private IResource getResourceFor(Object element) {
if (element instanceof IJavaElement) {
try {
element= ((IJavaElement)element).getUnderlyingResource();
} catch (JavaModelException e) {
return null;
}
}
if (!(element instanceof IResource) || ((IResource)element).isPhantom()) {
return null; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
return (IResource)element;
}
public void saveState(IMemento memento) {
if (fViewer == null) {
if (fMemento != null)
memento.putMemento(fMemento);
return;
}
saveExpansionState(memento);
saveSelectionState(memento);
saveScrollState(memento, fViewer.getTree());
savePatternFilterState(memento);
saveFilterState(memento);
}
protected void saveFilterState(IMemento memento) {
boolean showLibraries= getLibraryFilter().getShowLibraries();
String show= "true";
if (!showLibraries)
show= "false";
memento.putString(TAG_SHOWLIBRARIES, show);
boolean showBinaries= getBinaryFilter().getShowBinaries();
String showBinString= "true";
if (!showBinaries)
showBinString= "false";
memento.putString(TAG_SHOWBINARIES, showBinString); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
protected void savePatternFilterState(IMemento memento) {
String filters[] = getPatternFilter().getPatterns();
if(filters.length > 0) {
IMemento filtersMem = memento.createChild(TAG_FILTERS);
for (int i = 0; i < filters.length; i++){
IMemento child = filtersMem.createChild(TAG_FILTER);
child.putString(TAG_ELEMENT,filters[i]);
}
}
}
protected void saveScrollState(IMemento memento, Tree tree) {
ScrollBar bar= tree.getVerticalBar();
int position= bar != null ? bar.getSelection() : 0;
memento.putString(TAG_VERTICAL_POSITION, String.valueOf(position));
bar= tree.getHorizontalBar();
position= bar != null ? bar.getSelection() : 0;
memento.putString(TAG_HORIZONTAL_POSITION, String.valueOf(position));
}
protected void saveSelectionState(IMemento memento) {
Object elements[]= ((IStructuredSelection) fViewer.getSelection()).toArray();
if (elements.length > 0) {
IMemento selectionMem= memento.createChild(TAG_SELECTION);
for (int i= 0; i < elements.length; i++) {
IMemento elementMem= selectionMem.createChild(TAG_ELEMENT);
Object o= elements[i];
if (o instanceof IJavaElement)
elementMem.putString(TAG_PATH, ((IJavaElement) elements[i]).getHandleIdentifier()); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
}
}
protected void saveExpansionState(IMemento memento) {
Object expandedElements[]= fViewer.getExpandedElements();
if (expandedElements.length > 0) {
IMemento expandedMem= memento.createChild(TAG_EXPANDED);
for (int i= 0; i < expandedElements.length; i++) {
IMemento elementMem= expandedMem.createChild(TAG_ELEMENT);
Object o= expandedElements[i];
if (o instanceof IJavaElement)
elementMem.putString(TAG_PATH, ((IJavaElement) expandedElements[i]).getHandleIdentifier());
}
}
}
void restoreState(IMemento memento) {
restoreExpansionState(memento);
restoreSelectionState(memento);
restoreScrollState(memento, fViewer.getTree());
}
protected void restoreScrollState(IMemento memento, Tree tree) {
ScrollBar bar= tree.getVerticalBar();
if (bar != null) {
try {
String posStr= memento.getString(TAG_VERTICAL_POSITION);
int position;
position= new Integer(posStr).intValue();
bar.setSelection(position);
} catch (NumberFormatException e) { |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
}
bar= tree.getHorizontalBar();
if (bar != null) {
try {
String posStr= memento.getString(TAG_HORIZONTAL_POSITION);
int position;
position= new Integer(posStr).intValue();
bar.setSelection(position);
} catch (NumberFormatException e) {
}
}
}
protected void restoreSelectionState(IMemento memento) {
IMemento childMem;
childMem= memento.getChild(TAG_SELECTION);
if (childMem != null) {
ArrayList list= new ArrayList();
IMemento[] elementMem= childMem.getChildren(TAG_ELEMENT);
for (int i= 0; i < elementMem.length; i++) {
Object element= JavaCore.create(elementMem[i].getString(TAG_PATH));
list.add(element);
}
fViewer.setSelection(new StructuredSelection(list));
}
}
protected void restoreExpansionState(IMemento memento) {
IMemento childMem= memento.getChild(TAG_EXPANDED); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | if (childMem != null) {
ArrayList elements= new ArrayList();
IMemento[] elementMem= childMem.getChildren(TAG_ELEMENT);
for (int i= 0; i < elementMem.length; i++) {
Object element= JavaCore.create(elementMem[i].getString(TAG_PATH));
elements.add(element);
}
fViewer.setExpandedElements(elements.toArray());
}
}
/**
* Create the KeyListener for doing the refresh on the viewer.
*/
private void initRefreshKey() {
fViewer.getControl().addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent event) {
if (event.keyCode == SWT.F5) {
fRefreshAction.selectionChanged(
(IStructuredSelection) fViewer.getSelection());
if (fRefreshAction.isEnabled())
fRefreshAction.run();
}
}
});
}
void initFrameList() {
fFrameSource= new PackagesFrameSource(this);
fFrameList= new FrameList(fFrameSource); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | fFrameSource.connectTo(fFrameList);
}
/**
* An editor has been activated. Set the selection in this Packages Viewer
* to be the editor's input, if linking is enabled.
*/
void editorActivated(IEditorPart editor) {
if (!isLinkingEnabled())
return;
Object input= getElementOfInput(editor.getEditorInput());
Object element= null;
if (input instanceof IFile)
element= JavaCore.create((IFile)input);
if (element == null)
element= input;
if (element != null) {
IStructuredSelection oldSelection= (IStructuredSelection)getSelection();
if (oldSelection.size() == 1) {
Object o= oldSelection.getFirstElement();
if (o instanceof IMember) {
IMember m= (IMember)o;
if (element.equals(m.getCompilationUnit()))
return;
if (element.equals(m.getClassFile()))
return; |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | }
}
ISelection newSelection= new StructuredSelection(element);
if (!fViewer.getSelection().equals(newSelection)) {
fViewer.setSelection(newSelection);
}
}
}
/**
* A compilation unit or class was expanded, expand
* the main type.
*/
void expandMainType(Object element) {
try {
IType type= null;
if (element instanceof ICompilationUnit) {
ICompilationUnit cu= (ICompilationUnit)element;
IType[] types= cu.getTypes();
if (types.length > 0)
type= types[0];
}
else if (element instanceof IClassFile) {
IClassFile cf= (IClassFile)element;
type= cf.getType();
}
if (type != null) {
final IType type2= type;
Control ctrl= fViewer.getControl();
if (ctrl != null && !ctrl.isDisposed()) { |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | ctrl.getDisplay().asyncExec(new Runnable() {
public void run() {
Control ctrl= fViewer.getControl();
if (ctrl != null && !ctrl.isDisposed())
fViewer.expandToLevel(type2, 1);
}
});
}
}
} catch(JavaModelException e) {
}
}
/**
* Returns the element contained in the EditorInput
*/
Object getElementOfInput(IEditorInput input) {
if (input instanceof IFileEditorInput)
return ((IFileEditorInput)input).getFile();
else if (input instanceof ClassFileEditorInput)
return ((ClassFileEditorInput)input).getClassFile();
else if (input instanceof JarEntryEditorInput)
return ((JarEntryEditorInput)input).getStorage();
return null;
}
/**
* Returns the Viewer.
*/ |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | TreeViewer getViewer() {
return fViewer;
}
/**
* Returns the pattern filter for this view.
* @return the pattern filter
*/
JavaElementPatternFilter getPatternFilter() {
return fPatternFilter;
}
/**
* Returns the library filter for this view.
* @return the library filter
*/
LibraryFilter getLibraryFilter() {
return fLibraryFilter;
}
/**
* Returns the Binary filter for this view.
* @return the binary filter
*/
BinaryProjectFilter getBinaryFilter() {
return fBinaryFilter;
}
void restoreFilters() {
IMemento filtersMem= fMemento.getChild(TAG_FILTERS);
if(filtersMem != null) {
IMemento children[]= filtersMem.getChildren(TAG_FILTER); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | String filters[]= new String[children.length];
for (int i = 0; i < children.length; i++) {
filters[i]= children[i].getString(TAG_ELEMENT);
}
getPatternFilter().setPatterns(filters);
} else {
getPatternFilter().setPatterns(new String[0]);
}
String show= fMemento.getString(TAG_SHOWLIBRARIES);
if (show != null)
getLibraryFilter().setShowLibraries(show.equals("true"));
else
initLibraryFilterFromPreferences();
String showbin= fMemento.getString(TAG_SHOWBINARIES);
if (showbin != null)
getBinaryFilter().setShowBinaries(show.equals("true"));
else
initBinaryFilterFromPreferences();
}
void initFilterFromPreferences() {
initBinaryFilterFromPreferences();
initLibraryFilterFromPreferences();
}
void initLibraryFilterFromPreferences() {
JavaPlugin plugin= JavaPlugin.getDefault();
boolean show= plugin.getPreferenceStore().getBoolean(TAG_SHOWLIBRARIES); |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | getLibraryFilter().setShowLibraries(show);
}
void initBinaryFilterFromPreferences() {
JavaPlugin plugin= JavaPlugin.getDefault();
boolean showbin= plugin.getPreferenceStore().getBoolean(TAG_SHOWBINARIES);
getBinaryFilter().setShowBinaries(showbin);
}
/**
* Updates the title text and title tool tip.
* Called whenever the input of the viewer changes.
*/
void updateTitle() {
Object input= getViewer().getInput();
String viewName= getConfigurationElement().getAttribute("name");
if (input == null
|| (input instanceof IJavaModel)) {
setTitle(viewName);
setTitleToolTip("");
} else {
ILabelProvider labelProvider = (ILabelProvider) getViewer().getLabelProvider();
String inputText= labelProvider.getText(input);
String title= PackagesMessages.getFormattedString("PackageExplorer.argTitle", new String[] { viewName, inputText });
setTitle(title);
setTitleToolTip(getToolTipText(input));
}
}
/**
* Sets the decorator for the package explorer.
* |
5,052 | Bug 5052 Scrolling to the top of page when synching packages view | Eclipse 200011011 0) Turn on the preference "Link packages view selection to the active editor". 1) Perform a java search on something that will have at least one result. 2) Look at the search and pick a class in the list of results. 3) Go to the packages view and make sure that a) the packages view is open, visible and not stacked with the search view and b) the class selected in the packages view is not the class you picked in step 2. 4) In the search view, click on the entry for the class you selected in step 2. Notice: The editor for that class is opened. The editor is scrolled to the line matching the search result. 5) Click on the editor. Notice: The editor scrolls up to the top of the file and you can no longer see the place where the search pointed. Note: you will only see the problem if the search result points you to somewhere below the first page of the class definition. What I believe is going on is that when you click on the editor in step 5 that editor becomes the active editor and the packages view tries to synch up. As part of synching up with the packages view, the editor is scrolled to the top of the file. I do not think that synching up bewteen the active editor and the packages view should cause the editor to scroll to the top. Why can't the file stay at its current scroll position. I have seen this scrolling in other scenarios as well and it causes me to have to re-locate the place I wanted to edit. In the end I just am forced to turn off "Link packages view selection to the active editor" but then I am frustrated when I want to do something such as compare with another version and I have to go hunt for the class in the packages view. | resolved fixed | 0690660 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-19T19:04:10Z" | "2001-10-17T20:20:00Z" | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java | * @param decorator a label decorator or <code>null</code> for no decorations.
*/
public void setLabelDecorator(ILabelDecorator decorator) {
int labelFlags= JavaElementLabelProvider.SHOW_BASICS | JavaElementLabelProvider.SHOW_OVERLAY_ICONS |
JavaElementLabelProvider.SHOW_SMALL_ICONS | JavaElementLabelProvider.SHOW_VARIABLE;
JavaElementLabelProvider javaProvider= new JavaElementLabelProvider(labelFlags);
javaProvider.setErrorTickManager(new MarkerErrorTickProvider());
if (decorator == null) {
fViewer.setLabelProvider(javaProvider);
} else {
fViewer.setLabelProvider(new DecoratingLabelProvider(javaProvider, decorator));
}
}
/*
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty() != IPreferencesConstants.SHOW_CU_CHILDREN)
return;
if (fViewer != null) {
IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
boolean b= store.getBoolean(IPreferencesConstants.SHOW_CU_CHILDREN);
((JavaElementContentProvider)fViewer.getContentProvider()).setProvideMembers(b);
fViewer.refresh();
}
}
} |
5,097 | Bug 5097 Version Info in Package View marks all members of a type as changed | Version Info in Navigator marks all members of a type as changed, even if only one member actually was modified. | resolved fixed | af8bd61 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-20T03:14:41Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/JavaVCMLabelDecorator.java | /*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.ui.vcm;
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.vcm.internal.ui.VCMLabelDecorator;
/**
* This label decorator adds Version information to resources.
*/
public class JavaVCMLabelDecorator extends VCMLabelDecorator { |
5,097 | Bug 5097 Version Info in Package View marks all members of a type as changed | Version Info in Navigator marks all members of a type as changed, even if only one member actually was modified. | resolved fixed | af8bd61 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | "2001-10-20T03:14:41Z" | "2001-10-19T11:13:20Z" | org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/JavaVCMLabelDecorator.java | /**
* Creates a new decorator with the given shell. The shell is
* needed for determining the UI display for updates.
*/
public JavaVCMLabelDecorator(Shell shell) {
super(shell);
}
/**
* Returns the change event to be fired for updates to the given resource.
*/
protected LabelProviderChangedEvent createLabelEvent(IResource resource) {
IJavaElement element= JavaCore.create(resource);
if (element != null)
return new LabelProviderChangedEvent(this, element);
return new LabelProviderChangedEvent(this, resource);
}
} |