issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
private Object[] fTypes;
private IMethod[] fMethods;
private final Object[] fEmpty= new Object[0];
/**
* Constructor for ImplementMethodContentProvider.
*/
public ImplementMethodContentProvider(IMethod[] methods, Object[] types) {
fMethods= methods;
fTypes= types;
}
/*
* @see ITreeContentProvider#getChildren(Object)
*/
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof IType) {
ArrayList result= new ArrayList(fMethods.length);
for (int i= 0; i < fMethods.length; i++) {
if (fMethods[i].getDeclaringType().equals(parentElement)) {
result.add(fMethods[i]);
}
}
return result.toArray();
}
return fEmpty;
}
/*
* @see ITreeContentProvider#getParent(Object)
*/
public Object getParent(Object element) {
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
if (element instanceof IMethod) {
return ((IMethod)element).getDeclaringType();
}
return null;
}
/*
* @see ITreeContentProvider#hasChildren(Object)
*/
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
/*
* @see IStructuredContentProvider#getElements(Object)
*/
public Object[] getElements(Object inputElement) {
return fTypes;
}
/*
* @see IContentProvider#dispose()
*/
public void dispose() {
}
/*
* @see IContentProvider#inputChanged(Viewer, Object, Object)
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
private static class ImplementMethodSorter extends ViewerSorter {
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
private IType[] fAllTypes;
public ImplementMethodSorter(ITypeHierarchy typeHierarchy) {
IType curr= typeHierarchy.getType();
IType[] superTypes= typeHierarchy.getAllSupertypes(curr);
fAllTypes= new IType[superTypes.length + 1];
fAllTypes[0]= curr;
System.arraycopy(superTypes, 0, fAllTypes, 1, superTypes.length);
}
/*
* @see ViewerSorter#compare(Viewer, Object, Object)
*/
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof IType && e2 instanceof IType) {
if (e1.equals(e2)) {
return 0;
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
for (int i= 0; i < fAllTypes.length; i++) {
IType curr= fAllTypes[i];
if (curr.equals(e1)) {
return -1;
}
if (curr.equals(e2)) {
return 1;
}
}
}
return 0;
}
}
private class ImplementMethodValidator implements ISelectionValidator {
/*
* @see ISelectionValidator#validate(Object[])
*/
public IStatus validate(Object[] selection) {
int count= 0;
for (int i= 0; i < selection.length; i++) {
if (selection[i] instanceof IMethod) {
count++;
}
}
if (count == 0 && !fEmptySelectionAllowed) {
return new StatusInfo(IStatus.ERROR, "");
}
if (count == 1) {
return new StatusInfo(IStatus.INFO, count + " method selected.");
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
} else {
return new StatusInfo(IStatus.INFO, count + " methods selected.");
}
}
}
private boolean fEmptySelectionAllowed;
private Shell fShell;
public ImplementMethodQuery(Shell shell, boolean emptySelectionAllowed) {
fShell= shell;
fEmptySelectionAllowed= emptySelectionAllowed;
}
/*
* @see IImplementMethodQuery#select(IMethod[], IMethod[], ITypeHierarchy)
*/
public IMethod[] select(IMethod[] methods, IMethod[] defaultSelected, ITypeHierarchy typeHierarchy) {
HashSet types= new HashSet(methods.length);
for (int i= 0; i < methods.length; i++) {
types.add(methods[i].getDeclaringType());
}
Object[] typesArrays= types.toArray();
ViewerSorter sorter= new ImplementMethodSorter(typeHierarchy);
sorter.sort(null, typesArrays);
HashSet expanded= new HashSet(defaultSelected.length);
for (int i= 0; i < defaultSelected.length; i++) {
expanded.add(defaultSelected[i].getDeclaringType());
}
if (expanded.isEmpty() && typesArrays.length > 0) {
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
expanded.add(typesArrays[0]);
}
ILabelProvider lprovider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
ITreeContentProvider cprovider= new ImplementMethodContentProvider(methods, typesArrays);
CheckedTreeSelectionDialog dialog= new CheckedTreeSelectionDialog(fShell, lprovider, cprovider);
dialog.setValidator(new ImplementMethodValidator());
dialog.setTitle("Implement Methods");
dialog.setMessage("&Select methods to implement:");
dialog.setInitialSelections(defaultSelected);
dialog.setExpandedElements(expanded.toArray());
dialog.setContainerMode(true);
dialog.setSize(60, 25);
dialog.setInput(this);
if (dialog.open() == dialog.OK) {
Object[] checkedElements= dialog.getResult();
ArrayList result= new ArrayList(checkedElements.length);
for (int i= 0; i < checkedElements.length; i++) {
Object curr= checkedElements[i];
if (curr instanceof IMethod) {
result.add(curr);
}
}
return (IMethod[]) result.toArray(new IMethod[result.size()]);
}
return null;
}
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
package org.eclipse.jdt.internal.ui.text.java;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.util.Assert;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.corext.textmanipulation.TextUtil;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.actions.ImplementMethodQuery;
import org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage;
import org.eclipse.jdt.internal.ui.preferences.ImportOrganizePreferencePage;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
public class AnonymousTypeCompletionProposal extends JavaCompletionProposal {
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
private IType fDeclaringType;
private ICompilationUnit fCompilationUnit;
private ImportsStructure fImportStructure;
public AnonymousTypeCompletionProposal(ICompilationUnit cu, int start, int length, String constructorCompletion, String displayName, String declaringTypeName) {
super(constructorCompletion, start, length, null, displayName);
Assert.isNotNull(cu);
Assert.isNotNull(declaringTypeName);
fCompilationUnit= cu;
fDeclaringType= getDeclaringType(cu.getJavaProject(), declaringTypeName);
setImage(getImageForType(fDeclaringType));
setCursorPosition(constructorCompletion.indexOf('(') + 1);
}
private Image getImageForType(IType type) {
String imageName= JavaPluginImages.IMG_OBJS_CLASS;
if (type != null) {
try {
if (type.isInterface()) {
imageName= JavaPluginImages.IMG_OBJS_INTERFACE;
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
return JavaPluginImages.get(imageName);
}
private IType getDeclaringType(IJavaProject project, String typeName) {
try {
return JavaModelUtil.findType(project, typeName);
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return null;
}
/*
* @see JavaCompletionProposal#applyImports(IDocument)
*/
protected void applyImports(IDocument document) {
if (fImportStructure != null) {
try {
fImportStructure.create(false, null);
} catch (CoreException e) {
JavaPlugin.log(e);
}
}
}
/*
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
* @see ICompletionProposalExtension#apply(IDocument, char)
*/
public void apply(IDocument document, char trigger) {
try {
String[] prefOrder= ImportOrganizePreferencePage.getImportOrderPreference();
int threshold= ImportOrganizePreferencePage.getImportNumberThreshold();
fImportStructure= new ImportsStructure(fCompilationUnit, prefOrder, threshold, true);
String replacementString= getReplacementString();
StringBuffer buf= new StringBuffer();
buf.append(replacementString);
if (!replacementString.endsWith(")")) {
buf.append(')');
}
buf.append(" {\n");
if (!createStubs(buf, fImportStructure)) {
return;
}
buf.append("};");
String lineDelim= StubUtility.getLineDelimiterFor(document);
int tabWidth= CodeFormatterPreferencePage.getTabSize();
IRegion region= document.getLineInformationOfOffset(getReplacementOffset());
int indent= TextUtil.getIndent(document.get(region.getOffset(), region.getLength()), tabWidth);
String replacement= StubUtility.codeFormat(buf.toString(), indent, lineDelim);
replacement= TextUtil.removeLeadingWhiteSpaces(replacement);
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
setReplacementString(replacement);
} catch (BadLocationException e) {
JavaPlugin.log(e);
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
super.apply(document, trigger);
}
private boolean createStubs(StringBuffer buf, ImportsStructure imports) throws JavaModelException {
if (fDeclaringType == null) {
return true;
}
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
ITypeHierarchy hierarchy= fDeclaringType.newSupertypeHierarchy(null);
ImplementMethodQuery selectionQuery= fDeclaringType.isClass() ? new ImplementMethodQuery(JavaPlugin.getActiveWorkbenchShell(), true) : null;
String[] unimplemented= StubUtility.evalUnimplementedMethods(fDeclaringType, hierarchy, true, settings, selectionQuery, imports);
if (unimplemented != null) {
for (int i= 0; i < unimplemented.length; i++) {
buf.append(unimplemented[i]);
buf.append('\n');
}
return true;
}
return false;
}
}
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.jarpackager;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.jar.Manifest;
import org.eclipse.core.resources.IContainer;
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.xml.sax.SAXException;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaStatusConstants;
import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext;
/**
* Operation for exporting a resource and its children to a new JAR file.
*/
public class JarFileExportOperation implements IRunnableWithProgress {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
private JarWriter fJarWriter;
private JarPackage fJarPackage;
private IFile[] fDescriptionFiles;
private Shell fParentShell;
private Map fJavaNameToClassFilesMap;
private IContainer fClassFilesMapContainer;
private MultiStatus fProblems;
/**
* Creates an instance of this class.
*
* @param jarPackage the JAR package specification
* @param parent the parent for the dialog,
* or <code>null</code> if no dialog should be presented
*/
public JarFileExportOperation(JarPackage jarPackage, Shell parent) {
this(parent);
fJarPackage= jarPackage;
}
/**
* Creates an instance of this class.
*
* @param descriptions an array with JAR package descriptions
* @param parent the parent for the dialog,
* or <code>null</code> if no dialog should be presented
*/
public JarFileExportOperation(IFile[] descriptions, Shell parent) {
this(parent);
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
fDescriptionFiles= descriptions;
}
/**
* Adds a new warning to the list with the passed information.
* Normally the export operation continues after a warning.
* @param message the message
* @param exception the throwable that caused the warning, or <code>null</code>
*/
private JarFileExportOperation(Shell parent) {
fParentShell= parent;
fProblems= new MultiStatus(JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"), null);
}
protected void addWarning(String message, Throwable error) {
if (fJarPackage == null || fJarPackage.logWarnings())
fProblems.add(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error));
}
/**
* Adds a new error to the list with the passed information.
* Normally an error terminates the export operation.
* @param message the message
* @param exception the throwable that caused the error, or <code>null</code>
*/
protected void addError(String message, Throwable error) {
if (fJarPackage == null || fJarPackage.logErrors())
fProblems.add(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error));
}
/**
* Answers the number of file resources specified by the JAR package.
*
* @return int
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
*/
protected int countSelectedElements() {
int count= 0;
Iterator iter= fJarPackage.getSelectedElements().iterator();
while (iter.hasNext()) {
Object element= iter.next();
IResource resource= null;
if (element instanceof IJavaElement) {
IJavaElement je= (IJavaElement)element;
try {
resource= je.getUnderlyingResource();
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex);
return count;
}
}
else
resource= (IResource)element;
if (resource.getType() == IResource.FILE)
count++;
else
count += getTotalChildCount((IContainer)resource);
}
return count;
}
private int getTotalChildCount(IContainer container) {
IResource[] members;
try {
members= container.members();
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
} catch (CoreException ex) {
return 0;
}
int count= 0;
for (int i= 0; i < members.length; i++) {
if (members[i].getType() == IResource.FILE)
count++;
else
count += getTotalChildCount((IContainer)members[i]);
}
return count;
}
/**
* Exports the passed resource to the JAR file
*
* @param element the resource or JavaElement to export
*/
protected void exportElement(Object element, IProgressMonitor progressMonitor) throws InterruptedException {
int leadSegmentsToRemove= 1;
IPackageFragmentRoot pkgRoot= null;
boolean isInJavaProject= false;
IResource resource= null;
IJavaProject jProject= null;
if (element instanceof IJavaElement) {
isInJavaProject= true;
IJavaElement je= (IJavaElement)element;
try {
resource= je.getUnderlyingResource();
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex);
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
return;
}
jProject= je.getJavaProject();
pkgRoot= JavaModelUtil.getPackageFragmentRoot(je);
}
else
resource= (IResource)element;
if (!resource.isAccessible()) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceNotFound", resource.getFullPath()), null);
return;
}
if (resource.getType() == IResource.FILE) {
if (!resource.isLocal(IResource.DEPTH_ZERO))
try {
resource.setLocal(true , IResource.DEPTH_ZERO, progressMonitor);
} catch (CoreException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceNotLocal", resource.getFullPath()), ex);
return;
}
if (!isInJavaProject) {
try {
isInJavaProject= resource.getProject().hasNature(JavaCore.NATURE_ID);
} catch (CoreException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.projectNatureNotDeterminable", resource.getFullPath()), ex);
return;
}
if (isInJavaProject) {
jProject= JavaCore.create(resource.getProject());
try {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
IPackageFragment pkgFragment= jProject.findPackageFragment(resource.getFullPath().removeLastSegments(1));
if (pkgFragment != null)
pkgRoot= JavaModelUtil.getPackageFragmentRoot(pkgFragment);
else
pkgRoot= jProject.findPackageFragmentRoot(resource.getFullPath().uptoSegment(2));
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.javaPackageNotDeterminable", resource.getFullPath()), ex);
return;
}
}
}
if (pkgRoot != null) {
leadSegmentsToRemove= pkgRoot.getPath().segmentCount();
if (fJarPackage.useSourceFolderHierarchy()&& !pkgRoot.getElementName().equals(pkgRoot.DEFAULT_PACKAGEROOT_PATH))
leadSegmentsToRemove--;
}
IPath destinationPath= resource.getFullPath().removeFirstSegments(leadSegmentsToRemove);
boolean isInOutputFolder= false;
if (isInJavaProject) {
try {
isInOutputFolder= jProject.getOutputLocation().isPrefixOf(resource.getFullPath());
} catch (JavaModelException ex) {
isInOutputFolder= false;
}
}
exportClassFiles(progressMonitor, pkgRoot, resource, jProject, destinationPath);
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
exportResourceFiles(progressMonitor, pkgRoot, isInJavaProject, resource, destinationPath, isInOutputFolder);
progressMonitor.worked(1);
ModalContext.checkCanceled(progressMonitor);
} else
exportContainer(progressMonitor, resource);
}
private void exportContainer(IProgressMonitor progressMonitor, IResource resource) throws java.lang.InterruptedException {
IResource[] children= null;
try {
children= ((IContainer) resource).members();
} catch (CoreException e) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", resource.getFullPath()), e);
}
for (int i= 0; i < children.length; i++)
exportElement(children[i], progressMonitor);
}
private void exportResourceFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, boolean isInJavaProject, IResource resource, IPath destinationPath, boolean isInOutputFolder) {
boolean isNonJavaResource= !isInJavaProject || (pkgRoot == null && !isInOutputFolder);
boolean isInClassFolder= false;
try {
isInClassFolder= pkgRoot != null && !pkgRoot.isArchive() && pkgRoot.getKind() == pkgRoot.K_BINARY;
} catch (JavaModelException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.cantGetRootKind", resource.getFullPath()), ex);
}
if ((fJarPackage.areClassFilesExported() &&
((isNonJavaResource || (pkgRoot != null && !isJavaFile(resource) && !isClassFile(resource)))
|| isInClassFolder && isClassFile(resource)))
|| (fJarPackage.areJavaFilesExported() && (isNonJavaResource || (pkgRoot != null && !isClassFile(resource))))) {
try {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
progressMonitor.subTask(destinationPath.toString());
fJarWriter.write((IFile) resource, destinationPath);
} catch (IOException ex) {
String message= ex.getMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath());
addWarning(message , ex);
} catch (CoreException ex) {
String message= ex.getMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath());
addWarning(message, ex);
}
}
}
private void exportClassFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, IResource resource, IJavaProject jProject, IPath destinationPath) {
if (fJarPackage.areClassFilesExported() && isJavaFile(resource) && pkgRoot != null) {
try {
Iterator iter= filesOnClasspath((IFile)resource, destinationPath, jProject, progressMonitor);
IPath baseDestinationPath= destinationPath.removeLastSegments(1);
while (iter.hasNext()) {
IFile file= (IFile)iter.next();
if (!resource.isLocal(IResource.DEPTH_ZERO))
file.setLocal(true , IResource.DEPTH_ZERO, progressMonitor);
IPath classFilePath= baseDestinationPath.append(file.getName());
progressMonitor.subTask(classFilePath.toString());
fJarWriter.write(file, classFilePath);
}
} catch (IOException ex) {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
String message= ex.getMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath());
addWarning(message , ex);
} catch (CoreException ex) {
String message= ex.getMessage();
if (message == null)
message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath());
addWarning(message, ex);
}
}
}
/**
* Exports the resources as specified by the JAR package.
*/
protected void exportSelectedElements(IProgressMonitor progressMonitor) throws InterruptedException {
Iterator iter= fJarPackage.getSelectedElements().iterator();
while (iter.hasNext())
exportElement(iter.next(), progressMonitor);
}
/**
* Returns an iterator on a list with files that correspond to the
* passed file and that are on the classpath of its project.
*
* @param file the file for which to find the corresponding classpath resources
* @param pathInJar the path that the file has in the JAR (i.e. project and source folder segments removed)
* @param javaProject the javaProject that contains the file
* @return the iterator over the corresponding classpath files for the given file
*/
protected Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IProgressMonitor progressMonitor) throws CoreException {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
IPath outputPath= javaProject.getOutputLocation();
IContainer outputContainer;
if (javaProject.getProject().getFullPath().equals(outputPath))
outputContainer= javaProject.getProject();
else {
outputContainer= createFolderHandle(outputPath);
if (outputContainer == null || !outputContainer.isAccessible()) {
String msg= JarPackagerMessages.getString("JarFileExportOperation.outputContainerNotAccessible");
throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
}
}
if (isJavaFile(file)) {
boolean hasErrors= fJarPackage.hasCompileErrors(file);
boolean hasWarnings= fJarPackage.hasCompileWarnings(file);
boolean canBeExported= canBeExported(hasErrors, hasWarnings);
reportPossibleCompileProblems(file, hasErrors, hasWarnings, canBeExported);
if (!canBeExported)
return Collections.EMPTY_LIST.iterator();
IContainer classContainer= outputContainer;
if (pathInJar.segmentCount() > 1)
classContainer= outputContainer.getFolder(pathInJar.removeLastSegments(1));
if (fClassFilesMapContainer == null || !fClassFilesMapContainer.equals(classContainer)) {
fJavaNameToClassFilesMap= buildJavaToClassMap(classContainer);
fClassFilesMapContainer= classContainer;
}
ArrayList classFiles= (ArrayList)fJavaNameToClassFilesMap.get(file.getName());
if (classFiles == null || classFiles.isEmpty()) {
String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileOnClasspathNotAccessible", file.getFullPath());
throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
}
return classFiles.iterator();
}
else {
List binaryFiles= new ArrayList(1);
IFile cpFile= outputContainer.getFile(pathInJar);
if (cpFile.isAccessible()) {
if (!cpFile.isLocal(IResource.DEPTH_ZERO))
cpFile.setLocal(true , IResource.DEPTH_ZERO, progressMonitor);
binaryFiles.add(cpFile);
}
else {
String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceOnCasspathNotAccessible", cpFile.getFullPath());
throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
}
return binaryFiles.iterator();
}
}
/**
* Answers whether the given resource is a Java file.
* The resource must be a file whose file name ends with ".java".
*
* @return a <code>true<code> if the given resource is a Java file
*/
boolean isJavaFile(IResource file) {
return file != null
&& file.getType() == IFile.FILE
&& file.getFileExtension() != null
&& file.getFileExtension().equalsIgnoreCase("java");
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
}
/**
* Answers whether the given resource is a class file.
* The resource must be a file whose file name ends with ".class".
*
* @return a <code>true<code> if the given resource is a class file
*/
boolean isClassFile(IResource file) {
return file != null
&& file.getType() == IFile.FILE
&& file.getFileExtension() != null
&& file.getFileExtension().equalsIgnoreCase("class");
}
/*
* Builds and returns a map that has the class files
* for each java file in a given directory
*/
private Map buildJavaToClassMap(IContainer container) throws CoreException {
if (container == null || !container.isAccessible())
return new HashMap(0);
/*
* XXX: Bug 6584: Need a way to get class files for a java file (or CU)
*/
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader cfReader;
IResource[] members= container.members();
Map map= new HashMap(members.length);
for (int i= 0; i < members.length; i++) {
if (isClassFile(members[i])) {
IFile classFile= (IFile)members[i];
try {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
cfReader= org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(classFile.getLocation().toFile());
} catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.invalidClassFileFormat", classFile.getLocation().toFile()), ex);
continue;
} catch (IOException ex) {
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringClassFileLookup", classFile.getLocation().toFile()), ex);
continue;
}
if (cfReader != null) {
String javaName= new String(cfReader.sourceFileName());
Object classFiles= map.get(javaName);
if (classFiles == null) {
classFiles= new ArrayList(3);
map.put(javaName, classFiles);
}
((ArrayList)classFiles).add(classFile);
}
}
}
return map;
}
/**
* Creates a file resource handle for the file with the given workspace path.
* This method does not create the file resource; this is the responsibility
* of <code>createFile</code>.
*
* @param filePath the path of the file resource to create a handle for
* @return the new file resource handle
* @see #createFile
*/
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
protected IFile createFileHandle(IPath filePath) {
if (filePath.isValidPath(filePath.toString()) && filePath.segmentCount() >= 2)
return JavaPlugin.getWorkspace().getRoot().getFile(filePath);
else
return null;
}
/**
* Creates a folder resource handle for the folder with the given workspace path.
*
* @param folderPath the path of the folder to create a handle for
* @return the new folder resource handle
*/
protected IFolder createFolderHandle(IPath folderPath) {
if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2)
return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath);
else
return null;
}
/**
* Returns the status of this operation.
* If there were any errors, the result is a status object containing
* individual status objects for each error.
* If there were no errors, the result is a status object with error code <code>OK</code>.
*
* @return the status of this operation
*/
public IStatus getStatus() {
if (fProblems.getSeverity() == IStatus.ERROR) {
String message= null;
if (fDescriptionFiles != null && fDescriptionFiles.length > 1)
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
message= JarPackagerMessages.getString("JarFileExportOperation.creationOfSomeJARsFailed");
else
message= JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailed");
return new MultiStatus(JavaPlugin.getPluginId(), 0, fProblems.getChildren(), message, null);
}
return fProblems;
}
/**
* Answer a boolean indicating whether the passed child is a descendant
* of one or more members of the passed resources collection
*
* @param resources a List contain potential parents
* @param child the resource to test
* @return a <code>boolean</code> indicating if the child is a descendant
*/
protected boolean isDescendant(List resources, IResource child) {
if (child.getType() == IResource.PROJECT)
return false;
IResource parent= child.getParent();
if (resources.contains(parent))
return true;
return isDescendant(resources, parent);
}
protected boolean canBeExported(boolean hasErrors, boolean hasWarnings) throws CoreException {
return (!hasErrors && !hasWarnings)
|| (hasErrors && fJarPackage.exportErrors())
|| (hasWarnings && fJarPackage.exportWarnings());
}
protected void reportPossibleCompileProblems(IFile file, boolean hasErrors, boolean hasWarnings, boolean canBeExported) {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (hasErrors) {
if (canBeExported)
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.exportedWithCompileErrors", file.getFullPath()), null);
else
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.notExportedDueToCompileErrors", file.getFullPath()), null);
}
if (hasWarnings) {
if (canBeExported)
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.exportedWithCompileWarnings", file.getFullPath()), null);
else
addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.notExportedDueToCompileWarnings", file.getFullPath()), null);
}
}
/**
* Exports the resources as specified by the JAR package.
*
* @param progressMonitor the progress monitor that displays the progress
* @see #getStatus()
*/
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
if (fJarPackage != null)
singleRun(progressMonitor);
else {
int jarCount= fDescriptionFiles.length;
for (int i= 0; i < jarCount; i++) {
fJarPackage= readJarPackage(fDescriptionFiles[i]);
if (fJarPackage != null)
singleRun(progressMonitor);
}
}
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
}
public void singleRun(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
int totalWork= countSelectedElements();
progressMonitor.beginTask(JarPackagerMessages.getString("JarFileExportOperation.exporting"), totalWork);
try {
if (!preconditionsOK())
throw new InvocationTargetException(null, JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailedSeeDetails"));
fJarWriter= new JarWriter(fJarPackage, fParentShell);
exportSelectedElements(progressMonitor);
if (getStatus().getSeverity() != IStatus.ERROR) {
progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles"));
saveFiles();
}
} catch (IOException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFle", ex.getMessage());
addError(message, ex);
throw new InvocationTargetException(ex, message);
} catch (CoreException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFileDueToInvalidManifest", ex.getMessage());
addError(message, ex);
throw new InvocationTargetException(ex, message);
} finally {
try {
if (fJarWriter != null)
fJarWriter.close();
} catch (IOException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCloseJarFile", ex.getMessage());
addError(message, ex);
throw new InvocationTargetException(ex, message);
}
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
progressMonitor.done();
}
}
protected boolean preconditionsOK() {
if (!fJarPackage.areClassFilesExported() && !fJarPackage.areJavaFilesExported()) {
addError(JarPackagerMessages.getString("JarFileExportOperation.noExportTypeChosen"), null);
return false;
}
if (fJarPackage.getSelectedElements() == null || fJarPackage.getSelectedElements().size() == 0) {
addError(JarPackagerMessages.getString("JarFileExportOperation.noResourcesSelected"), null);
return false;
}
if (fJarPackage.getJarLocation() == null) {
addError(JarPackagerMessages.getString("JarFileExportOperation.invalidJarLocation"), null);
return false;
}
if (!fJarPackage.doesManifestExist()) {
addError(JarPackagerMessages.getString("JarFileExportOperation.manifestDoesNotExist"), null);
return false;
}
if (!fJarPackage.isMainClassValid(new BusyIndicatorRunnableContext())) {
addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null);
return false;
}
IEditorPart[] dirtyEditors= JavaPlugin.getDirtyEditors();
if (dirtyEditors.length > 0) {
List unsavedFiles= new ArrayList(dirtyEditors.length);
List selection= fJarPackage.getSelectedResources();
for (int i= 0; i < dirtyEditors.length; i++) {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
if (dirtyEditors[i].getEditorInput() instanceof IFileEditorInput) {
IFile dirtyFile= ((IFileEditorInput)dirtyEditors[i].getEditorInput()).getFile();
if (selection.contains(dirtyFile)) {
unsavedFiles.add(dirtyFile);
addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.fileUnsaved", dirtyFile.getFullPath()), null);
}
}
}
if (!unsavedFiles.isEmpty())
return false;
}
return true;
}
protected void saveFiles() {
if (fJarPackage.isManifestSaved()) {
try {
saveManifest();
} catch (CoreException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex);
} catch (IOException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex);
}
}
if (fJarPackage.isDescriptionSaved()) {
try {
saveDescription();
} catch (CoreException ex) {
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex);
} catch (IOException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex);
}
}
}
protected void saveDescription() throws CoreException, IOException {
if (fJarPackage.isManifestReused())
fJarPackage.setGenerateManifest(false);
ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream();
JarPackageWriter objectStream= new JarPackageWriter(objectStreamOutput);
ByteArrayInputStream fileInput= null;
try {
objectStream.writeXML(fJarPackage);
fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray());
if (fJarPackage.getDescriptionFile().isAccessible()) {
if (fJarPackage.canOverwriteDescription(fParentShell))
fJarPackage.getDescriptionFile().setContents(fileInput, true, true, null);
}
else {
fJarPackage.getDescriptionFile().create(fileInput, true, null);
}
} finally {
if (fileInput != null)
fileInput.close();
if (objectStream != null)
objectStream.close();
}
}
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
protected void saveManifest() throws CoreException, IOException {
ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream();
ByteArrayInputStream fileInput= null;
try {
Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage);
manifest.write(manifestOutput);
fileInput= new ByteArrayInputStream(manifestOutput.toByteArray());
if (fJarPackage.getManifestFile().isAccessible()) {
if (fJarPackage.canOverwriteManifest(fParentShell))
fJarPackage.getManifestFile().setContents(fileInput, true, true, null);
}
else {
fJarPackage.getManifestFile().create(fileInput, true, null);
}
} finally {
if (manifestOutput != null)
manifestOutput.close();
if (fileInput != null)
fileInput.close();
}
}
/**
* Reads the JAR package spec from file.
*/
protected JarPackage readJarPackage(IFile description) {
Assert.isLegal(description.isAccessible());
Assert.isNotNull(description.getFileExtension());
Assert.isLegal(description.getFileExtension().equals(JarPackage.DESCRIPTION_EXTENSION));
JarPackage jarPackage= null;
JarPackageReader reader= null;
|
6,903 |
Bug 6903 1GOMQ6H:- NullPointerException when exporting to a jar
| null |
resolved fixed
|
1324d10
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:36:44Z | 2001-12-13T19:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
try {
reader= new JarPackageReader(description.getContents());
jarPackage= reader.readXML();
jarPackage.setSaveManifest(false);
jarPackage.setSaveDescription(false);
} catch (CoreException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorReadingJarPackageFromDescription"), ex);
} catch (IOException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorReadingFile", description.getFullPath(), ex.getMessage());
addError(message, null);
} catch (SAXException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.badXmlFormat", description.getFullPath(), ex.getMessage());
addError(message, null);
} finally {
if ((jarPackage == null || jarPackage.logWarnings()) && reader != null)
fProblems.addAll(reader.getWarnings());
try {
if (reader != null)
reader.close();
}
catch (IOException ex) {
addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorClosingJarPackageDescriptionReader", description.getFullPath()), ex);
}
}
return jarPackage;
}
}
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
package org.eclipse.jdt.internal.ui.typehierarchy;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
/**
* Base class for content providers for type hierarchy viewers.
* Implementors must override 'getTypesInHierarchy'.
* Java delta processing is also performed by the content provider
*/
public abstract class TypeHierarchyContentProvider implements ITreeContentProvider {
protected static final Object[] NO_ELEMENTS= new Object[0];
protected TypeHierarchyLifeCycle fTypeHierarchy;
protected IMember[] fMemberFilter;
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
protected boolean fShowAllTypes;
protected TreeViewer fViewer;
public TypeHierarchyContentProvider(TypeHierarchyLifeCycle lifecycle) {
fTypeHierarchy= lifecycle;
fMemberFilter= null;
fShowAllTypes= false;
}
/**
* Sets members to filter the hierarchy for. Set to <code>null</code> to disable member filtering.
* When member filtering is enabled, the hierarchy contains only types that contain
* an implementation of one of the filter members and the members themself.
* The hierarchy can be empty as well.
*/
public void setMemberFilter(IMember[] memberFilter) {
fMemberFilter= memberFilter;
}
/**
* The members to filter or <code>null</code> if member filtering is disabled.
*/
public IMember[] getMemberFilter() {
return fMemberFilter;
}
/**
* In member filtering mode, show all types even if they do not contain one
* of the filtered members
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
*/
public void showAllTypes(boolean show) {
fShowAllTypes= show;
}
protected final ITypeHierarchy getHierarchy() {
return fTypeHierarchy.getHierarchy();
}
/*
* Called for the root element
* @see IStructuredContentProvider#getElements
*/
public Object[] getElements(Object parent) {
ITypeHierarchy hierarchy= getHierarchy();
if (hierarchy != null) {
IType input= hierarchy.getType();
if (input != null) {
return new IType[] { input };
}
}
return NO_ELEMENTS;
}
/**
* Hook to overwrite. Filter will be applied on the returned types
*/
protected abstract IType[] getTypesInHierarchy(IType type);
/*
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
* Called for the tree children.
* @see ITreeContentProvider#getChildren
*/
public Object[] getChildren(Object element) {
if (element instanceof IType) {
IType type= (IType)element;
IType[] childrenTypes= getTypesInHierarchy(type);
if (fMemberFilter != null) {
List children= new ArrayList();
addFilteredMembers(type, children);
addFilteredTypes(childrenTypes, children);
return children.toArray();
} else {
return childrenTypes;
}
}
return NO_ELEMENTS;
}
/*
* @see ITreeContentProvider#hasChildren
*/
public boolean hasChildren(Object element) {
if (element instanceof IType) {
IType type= (IType)element;
IType[] childrenTypes= getTypesInHierarchy(type);
if (fMemberFilter != null) {
List children= new ArrayList();
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
addFilteredMembers(type, children);
addFilteredTypes(childrenTypes, children);
return children.size() > 0;
} else {
return childrenTypes.length > 0;
}
}
return false;
}
private void addFilteredMembers(IType parent, List children) {
try {
IMethod[] methods= parent.getMethods();
for (int i= 0; i < fMemberFilter.length; i++) {
IMember member= fMemberFilter[i];
if (parent.equals(member.getDeclaringType())) {
children.add(member);
} else if (member instanceof IMethod) {
IMethod curr= (IMethod)member;
IMethod meth= JavaModelUtil.findMethod(curr.getElementName(), curr.getParameterTypes(), curr.isConstructor(), methods);
if (meth != null) {
children.add(meth);
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
private void addFilteredTypes(IType[] types, List children) {
try {
for (int i= 0; i < types.length; i++) {
if (hasFilteredChildren(types[i])) {
children.add(types[i]);
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
private boolean hasFilteredChildren(IType type) throws JavaModelException {
if (fShowAllTypes) {
return true;
}
IMethod[] methods= type.getMethods();
for (int i= 0; i < fMemberFilter.length; i++) {
IMember member= fMemberFilter[i];
if (type.equals(member.getDeclaringType())) {
return true;
} else if (member instanceof IMethod) {
IMethod curr= (IMethod)member;
IMethod meth= JavaModelUtil.findMethod(curr.getElementName(), curr.getParameterTypes(), curr.isConstructor(), methods);
if (meth != null) {
return true;
}
}
}
|
6,691 |
Bug 6691 Hierarchy View: Show inherited members + Show members
|
20011206 (Win2K) - Open a deep hierarchy in a Hierarchy view (I opened the SWT Widget hierarchy) - Select a class that is low in the hierarchy and overrides at least one method from a superclass (I selected Table) - Click on the "Show inherited members" tool, so that you see all implementors of overridden methods (for example, in Table, you can see 3 implementors of callWindowProc(int, int, int) ) - Select more than one method with the same signature (for example, I had all 3 implementors of callWindowProc(int, int, int) selected). - Now selet the "Lock View and Show Members in Hierarchy" tool. You will have multiple versions of the method under each class that implements the method. There should only be one.
|
verified fixed
|
93e12ef
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T16:51:56Z | 2001-12-07T21:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyContentProvider.java
|
IType[] childrenTypes= getTypesInHierarchy(type);
for (int i= 0; i < childrenTypes.length; i++) {
if (hasFilteredChildren(childrenTypes[i])) {
return true;
}
}
return false;
}
/*
* @see IContentProvider#inputChanged
*/
public void inputChanged(Viewer part, Object oldInput, Object newInput) {
Assert.isTrue(part instanceof TreeViewer);
fViewer= (TreeViewer)part;
}
/*
* @see IContentProvider#dispose
*/
public void dispose() {
}
/*
* @see ITreeContentProvider#getParent
*/
public Object getParent(Object element) {
return null;
}
}
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Hashtable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
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;
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
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.core.JavaCore;
import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.formatter.CodeFormatter;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.TabFolderLayout;
/*
* The page for setting code formatter options
*/
public class CodeFormatterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
private static final String PREF_NEWLINE_OPENING_BRACES= "org.eclipse.jdt.core.formatter.newline.openingBrace";
private static final String PREF_NEWLINE_CONTROL_STATEMENT= "org.eclipse.jdt.core.formatter.newline.controlStatement";
private static final String PREF_NEWLINE_CLEAR_ALL= "org.eclipse.jdt.core.formatter.newline.clearAll";
private static final String PREF_NEWLINE_ELSE_IF= "org.eclipse.jdt.core.formatter.newline.elseIf";
private static final String PREF_NEWLINE_EMPTY_BLOCK= "org.eclipse.jdt.core.formatter.newline.emptyBlock";
private static final String PREF_LINE_SPLIT= "org.eclipse.jdt.core.formatter.lineSplit";
private static final String PREF_STYLE_COMPACT_ASSIGNEMENT= "org.eclipse.jdt.core.formatter.style.assignment";
private static final String PREF_TAB_CHAR= "org.eclipse.jdt.core.formatter.tabulation.char";
private static final String PREF_TAB_SIZE= "org.eclipse.jdt.core.formatter.tabulation.size";
private static final String INSERT= "insert";
private static final String DO_NOT_INSERT= "do not insert";
private static final String COMPACT= "compact";
private static final String NORMAL= "normal";
private static final String TAB= "tab";
private static final String SPACE= "space";
private static final String CLEAR_ALL= "clear all";
private static final String PRESERVE_ONE= "preserve one";
private static String[] getAllKeys() {
return new String[] {
PREF_NEWLINE_OPENING_BRACES, PREF_NEWLINE_CONTROL_STATEMENT, PREF_NEWLINE_CLEAR_ALL,
PREF_NEWLINE_ELSE_IF, PREF_NEWLINE_EMPTY_BLOCK, PREF_LINE_SPLIT,
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
PREF_STYLE_COMPACT_ASSIGNEMENT, PREF_TAB_CHAR, PREF_TAB_SIZE
};
}
/**
* Gets the currently configured tab size
*/
public static int getTabSize() {
String string= (String) JavaCore.getOptions().get(PREF_TAB_SIZE);
return getIntValue(string, 4);
}
/**
* Gets the current compating assignement configuration
*/
public static boolean isCompactingAssignment() {
return COMPACT.equals(JavaCore.getOptions().get(PREF_STYLE_COMPACT_ASSIGNEMENT));
}
/**
* Gets the current compating assignement configuration
*/
public static boolean useSpaces() {
return SPACE.equals(JavaCore.getOptions().get(PREF_TAB_CHAR));
}
private static int getIntValue(String string, int dflt) {
try {
return Integer.parseInt(string);
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
} catch (NumberFormatException e) {
}
return dflt;
}
/**
* Initializes the current options (read from preference store)
*/
public static void initDefaults(IPreferenceStore store) {
Hashtable hashtable= JavaCore.getDefaultOptions();
Hashtable currOptions= JavaCore.getOptions();
String[] allKeys= getAllKeys();
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String defValue= (String) hashtable.get(key);
if (defValue != null) {
store.setDefault(key, defValue);
} else {
JavaPlugin.logErrorMessage("CodeFormatterPreferencePage: value is null: " + key);
}
String val= store.getString(key);
if (val != null) {
currOptions.put(key, val);
}
}
JavaCore.setOptions(currOptions);
}
private static class ControlData {
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
private String fKey;
private String[] fValues;
public ControlData(String key, String[] values) {
fKey= key;
fValues= values;
}
public String getKey() {
return fKey;
}
public String getValue(boolean selection) {
int index= selection ? 0 : 1;
return fValues[index];
}
public String getValue(int index) {
return fValues[index];
}
public int getSelection(String value) {
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
for (int i= 0; i < fValues.length; i++) {
if (value.equals(fValues[i])) {
return i;
}
}
throw new IllegalArgumentException();
}
}
private Hashtable fWorkingValues;
private ArrayList fCheckBoxes;
private ArrayList fTextBoxes;
private SelectionListener fButtonSelectionListener;
private ModifyListener fTextModifyListener;
private String fPreviewText;
private IDocument fPreviewDocument;
private Text fTabSizeTextBox;
private SourceViewer fSourceViewer;
public CodeFormatterPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("CodeFormatterPreferencePage.description"));
fWorkingValues= JavaCore.getOptions();
fCheckBoxes= new ArrayList();
fTextBoxes= new ArrayList();
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
fButtonSelectionListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
if (!e.widget.isDisposed()) {
controlChanged((Button) e.widget);
}
}
};
fTextModifyListener= new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (!e.widget.isDisposed()) {
textChanged((Text) e.widget);
}
}
};
fPreviewDocument= new Document();
fPreviewText= loadPreviewFile("CodeFormatterPreviewCode.txt");
}
/*
* @see IWorkbenchPreferencePage#init()
*/
public void init(IWorkbench workbench) {
}
/*
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
WorkbenchHelp.setHelp(getControl(), new DialogPageContextComputer(this, IJavaHelpContextIds.CODEFORMATTER_PREFERENCE_PAGE));
}
/*
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
Composite composite= new Composite(parent, SWT.NONE);
composite.setLayout(layout);
TabFolder folder= new TabFolder(composite, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
String[] insertNotInsert= new String[] { INSERT, DO_NOT_INSERT };
layout= new GridLayout();
layout.numColumns= 2;
Composite newlineComposite= new Composite(folder, SWT.NULL);
newlineComposite.setLayout(layout);
String label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_opening_braces.label");
addCheckBox(newlineComposite, label, PREF_NEWLINE_OPENING_BRACES, insertNotInsert);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_control_statement.label");
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
addCheckBox(newlineComposite, label, PREF_NEWLINE_CONTROL_STATEMENT, insertNotInsert);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_clear_lines");
addCheckBox(newlineComposite, label, PREF_NEWLINE_CLEAR_ALL, new String[] { CLEAR_ALL, PRESERVE_ONE } );
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_else_if.label");
addCheckBox(newlineComposite, label, PREF_NEWLINE_ELSE_IF, insertNotInsert);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_empty_block.label");
addCheckBox(newlineComposite, label, PREF_NEWLINE_EMPTY_BLOCK, insertNotInsert);
layout= new GridLayout();
layout.numColumns= 2;
Composite lineSplittingComposite= new Composite(folder, SWT.NULL);
lineSplittingComposite.setLayout(layout);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.split_line.label");
addTextField(lineSplittingComposite, label, PREF_LINE_SPLIT);
layout= new GridLayout();
layout.numColumns= 2;
Composite styleComposite= new Composite(folder, SWT.NULL);
styleComposite.setLayout(layout);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.style_compact_assignement.label");
addCheckBox(styleComposite, label, PREF_STYLE_COMPACT_ASSIGNEMENT, new String[] { COMPACT, NORMAL } );
label= JavaUIMessages.getString("CodeFormatterPreferencePage.tab_char.label");
addCheckBox(styleComposite, label, PREF_TAB_CHAR, new String[] { TAB, SPACE } );
label= JavaUIMessages.getString("CodeFormatterPreferencePage.tab_size.label");
fTabSizeTextBox= addTextField(styleComposite, label, PREF_TAB_SIZE);
TabItem item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.newline.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL));
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
item.setControl(newlineComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.linesplit.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE));
item.setControl(lineSplittingComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.style.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SEARCH_REF));
item.setControl(styleComposite);
fSourceViewer= createPreview(parent);
updatePreview();
return composite;
}
private SourceViewer createPreview(Composite parent) {
SourceViewer previewViewer= new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL);
JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
previewViewer.configure(new JavaSourceViewerConfiguration(tools, null));
previewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
previewViewer.getTextWidget().setTabs(Integer.parseInt((String) fWorkingValues.get(PREF_TAB_SIZE)));
previewViewer.setEditable(false);
previewViewer.setDocument(fPreviewDocument);
Control control= previewViewer.getControl();
GridData gdata= new GridData(GridData.FILL_BOTH);
gdata.widthHint= convertWidthInCharsToPixels(80);
gdata.heightHint= convertHeightInCharsToPixels(15);
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
control.setLayoutData(gdata);
return previewViewer;
}
private Button addCheckBox(Composite parent, String label, String key, String[] values) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan= 2;
Button checkBox= new Button(parent, SWT.CHECK);
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
String currValue= (String)fWorkingValues.get(key);
checkBox.setSelection(data.getSelection(currValue) == 0);
checkBox.addSelectionListener(fButtonSelectionListener);
fCheckBoxes.add(checkBox);
return checkBox;
}
private Text addTextField(Composite parent, String label, String key) {
Label labelControl= new Label(parent, SWT.NONE);
labelControl.setText(label);
labelControl.setLayoutData(new GridData());
Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE);
textBox.setData(key);
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
textBox.setLayoutData(new GridData());
String currValue= (String)fWorkingValues.get(key);
textBox.setText(String.valueOf(getIntValue(currValue, 1)));
textBox.setTextLimit(3);
textBox.addModifyListener(fTextModifyListener);
GridData gd= new GridData();
gd.widthHint= convertWidthInCharsToPixels(5);
textBox.setLayoutData(gd);
fTextBoxes.add(textBox);
return textBox;
}
private void controlChanged(Button button) {
ControlData data= (ControlData) button.getData();
boolean selection= button.getSelection();
String newValue= data.getValue(selection);
fWorkingValues.put(data.getKey(), newValue);
updatePreview();
if (PREF_TAB_CHAR.equals(data.getKey())) {
updateStatus(new StatusInfo());
if (selection) {
fTabSizeTextBox.setText((String)fWorkingValues.get(PREF_TAB_SIZE));
}
}
}
private void textChanged(Text textControl) {
String key= (String) textControl.getData();
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
String number= textControl.getText();
IStatus status= validatePositiveNumber(number);
if (!status.matches(IStatus.ERROR)) {
fWorkingValues.put(key, number);
}
if (PREF_TAB_SIZE.equals(key)) {
fSourceViewer.getTextWidget().setTabs(Integer.parseInt(number));
}
updateStatus(status);
updatePreview();
}
/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
String[] allKeys= getAllKeys();
Hashtable actualOptions= JavaCore.getOptions();
IPreferenceStore store= getPreferenceStore();
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String val= (String) fWorkingValues.get(key);
actualOptions.put(key, val);
store.setValue(key, val);
}
JavaCore.setOptions(actualOptions);
return super.performOk();
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
}
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fWorkingValues= JavaCore.getDefaultOptions();
updateControls();
super.performDefaults();
}
private String loadPreviewFile(String filename) {
String separator= System.getProperty("line.separator");
StringBuffer btxt= new StringBuffer(512);
BufferedReader rin= null;
try {
rin= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));
String line;
while ((line= rin.readLine()) != null) {
btxt.append(line);
btxt.append(separator);
}
} catch (IOException io) {
JavaPlugin.log(io);
} finally {
if (rin != null) {
try { rin.close(); } catch (IOException e) {}
}
}
return btxt.toString();
}
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
private void updatePreview() {
fPreviewDocument.set(new CodeFormatter(fWorkingValues).format(fPreviewText));
}
private void updateControls() {
for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
Button curr= (Button) fCheckBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.setSelection(data.getSelection(currValue) == 0);
}
for (int i= fTextBoxes.size() - 1; i >= 0; i--) {
Text curr= (Text) fTextBoxes.get(i);
String key= (String) curr.getData();
String currValue= (String) fWorkingValues.get(key);
curr.setText(currValue);
}
}
private IStatus validatePositiveNumber(String number) {
StatusInfo status= new StatusInfo();
if (number.length() == 0) {
status.setError(JavaUIMessages.getString("CodeFormatterPreferencePage.empty_input"));
} else {
try {
int value= Integer.parseInt(number);
if (value < 0) {
status.setError(JavaUIMessages.getFormattedString("CodeFormatterPreferencePage.invalid_input", number));
|
6,969 |
Bug 6969 NPE in code formatter preference page
|
20011206 Open the code formatter preference page Go to the style tab Go to the number of spaces... field Backspace until the field is empty NPE
|
resolved fixed
|
b340474
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T10:23:25Z | 2001-12-14T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
}
} catch (NumberFormatException e) {
status.setError(JavaUIMessages.getFormattedString("CodeFormatterPreferencePage.invalid_input", number));
}
}
return status;
}
private void updateStatus(IStatus status) {
if (!status.matches(IStatus.ERROR)) {
for (int i= 0; i < fTextBoxes.size(); i++) {
Text curr= (Text) fTextBoxes.get(i);
if (!(curr == fTabSizeTextBox && usesTabs())) {
IStatus currStatus= validatePositiveNumber(curr.getText());
status= StatusUtil.getMoreSevere(currStatus, status);
}
}
}
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
private boolean usesTabs() {
return TAB.equals(fWorkingValues.get(PREF_TAB_CHAR));
}
}
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
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;
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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.IOpenable;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.IWorkingCopy;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
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.ResourceTransferDragAdapter;
import org.eclipse.jdt.internal.ui.dnd.TransferDragSourceListener;
import org.eclipse.jdt.internal.ui.dnd.TransferDropTargetListener;
import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
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;
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
import org.eclipse.jdt.internal.ui.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.corext.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;
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.action.Separator;
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;
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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.search.ui.IWorkingSet;
import org.eclipse.search.ui.SearchUI;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
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;
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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.NewWizardMenu;
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.ResourceTransfer;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.internal.framelist.BackAction;
import org.eclipse.ui.views.internal.framelist.ForwardAction;
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 {
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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";
static final String TAG_WORKINGSET = "workingset";
private JavaElementPatternFilter fPatternFilter= new JavaElementPatternFilter();
private LibraryFilter fLibraryFilter= new LibraryFilter();
private BinaryProjectFilter fBinaryFilter= new BinaryProjectFilter();
private WorkingSetFilter fWorkingSetFilter= new WorkingSetFilter();
private ProblemTreeViewer fViewer;
private PackagesFrameSource fFrameSource;
private FrameList fFrameList;
private ContextMenuGroup[] fStandardGroups;
private Menu fContextMenu;
private OpenResourceAction fOpenCUAction;
private Action fOpenToAction;
private Action fShowTypeHierarchyAction;
private Action fShowNavigatorAction;
private Action fPropertyDialogAction;
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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 FilterWorkingSetAction fFilterWorkingSetAction;
private RemoveWorkingSetFilterAction fRemoveWorkingSetAction;
private IMemento fMemento;
private ISelectionChangedListener fSelectionListener;
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) {
}
public void partDeactivated(IWorkbenchPart part) {
}
public void partOpened(IWorkbenchPart part) {
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
}
};
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
*/
public static void initDefaults(IPreferenceStore store) {
store.setDefault(TAG_SHOWLIBRARIES, true);
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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)
JavaPlugin.getDefault().getProblemMarkerManager().removeListener(fViewer);
if (fContextMenu != null && !fContextMenu.isDisposed())
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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, false));
JavaPlugin.getDefault().getProblemMarkerManager().addListener(fViewer);
JavaPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
JavaElementLabelProvider labelProvider= new JavaElementLabelProvider(getLabelProviderFlags());
labelProvider.setErrorTickManager(new MarkerErrorTickProvider());
fViewer.setLabelProvider(new DecoratingLabelProvider(labelProvider, null));
fViewer.setSorter(new JavaElementSorter());
fViewer.addFilter(new EmptyInnerPackageFilter());
fViewer.setUseHashlookup(true);
fViewer.addFilter(fPatternFilter);
fViewer.addFilter(fLibraryFilter);
fViewer.addFilter(fWorkingSetFilter);
if(fMemento != null)
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
restoreFilters();
else
initFilterFromPreferences();
fViewer.setInput(findInputElement());
initDragAndDrop();
initFrameList();
initKeyListener();
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();
fSelectionListener= new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
handleSelectionChanged(event);
}
};
fViewer.addSelectionChangedListener(fSelectionListener);
fViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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);
actionBars.updateActionBars();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
IMenuManager menu= actionBars.getMenuManager();
menu.add(fFilterAction);
menu.add(fShowLibrariesAction);
menu.add(fFilterWorkingSetAction);
menu.add(fRemoveWorkingSetAction);
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
}
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))
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
return fViewer;
return super.getAdapter(key);
}
/**
* Returns the tool tip text for the given element.
*/
String getToolTipText(Object element) {
String result;
if (!(element instanceof IResource)) {
result= ((ILabelProvider) getViewer().getLabelProvider()).getText(element);
} else {
IPath path= ((IResource) element).getFullPath();
if (path.isRoot()) {
result= PackagesMessages.getString("PackageExplorer.title");
} else {
result= path.makeRelative().toString();
}
}
IWorkingSet ws= fWorkingSetFilter.getWorkingSet();
if (ws == null)
return result;
String wsstr= "Working Set: "+ws.getName();
if (result.length() == 0)
return wsstr;
return result + " - " + wsstr;
}
public String getTitleToolTip() {
if (fViewer == null)
return super.getTitleToolTip();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
return getToolTipText(fViewer.getInput());
}
/**
* @see IWorkbenchPart#setFocus()
*/
public void setFocus() {
fViewer.getTree().setFocus();
}
/**
* Sets the working set to be used for filtering this part
*/
public void setWorkingSet(IWorkingSet ws) {
fWorkingSetFilter.setWorkingSet(ws);
firePropertyChange(IWorkbenchPart.PROP_TITLE);
fFilterWorkingSetAction.setChecked(ws != null);
fRemoveWorkingSetAction.setEnabled(ws != null);
}
/**
* 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.
*/
private ISelectionProvider getSelectionProvider() {
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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();
MenuManager newMenu= new MenuManager(PackagesMessages.getString("PackageExplorer.new"));
menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
new NewWizardMenu(newMenu, getSite().getWorkbenchWindow(), false);
if (selection.size() == 1 && fViewer.isExpandable(element))
menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fZoomInAction);
addGotoMenu(menu);
fOpenCUAction.update();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
if (fOpenCUAction.isEnabled())
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpenCUAction);
addOpenWithMenu(menu, selection);
addOpenToMenu(menu, selection);
addRefactoring(menu);
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);
}
private void makeActions() {
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
ISelectionProvider provider= getSelectionProvider();
fOpenCUAction= new OpenResourceAction(provider);
fPropertyDialogAction= new PropertyDialogAction(getShell(), provider);
fShowNavigatorAction= new ShowInNavigatorAction(provider);
fAddBookmarkAction= new AddBookmarkAction(provider);
fStandardGroups= new ContextMenuGroup[] {
new BuildGroup(),
new ReorgGroup(),
new JavaSearchGroup()
};
fDeleteAction= new DeleteAction(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"));
fFilterWorkingSetAction = new FilterWorkingSetAction(getShell(), this, "Filter Working Set...");
fRemoveWorkingSetAction = new RemoveWorkingSetFilterAction(getShell(), this, "Remove Working Set Filter");
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,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
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,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
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,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
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,
ResourceTransfer.getInstance(),
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 ResourceTransferDragAdapter(fViewer),
new FileTransferDragAdapter(fViewer)
};
DragSource source= new DragSource(control, ops);
source.addDragListener(new DelegatingDragAdapter(dragListeners));
}
/**
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
* Handles key events in viewer.
*/
void handleKeyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0){
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 (fOpenCUAction.isEnabled()) {
fOpenCUAction.run();
return;
}
if (fViewer.isExpandable(element)) {
if (JavaBasePreferencePage.doubleClockGoesInto()) {
if (element instanceof IOpenable &&
!(element instanceof ICompilationUnit) &&
!(element instanceof IClassFile)) {
fZoomInAction.run();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
}
} else {
fViewer.setExpandedState(element, !fViewer.getExpandedState(element));
}
}
}
/**
* 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);
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
else if (e instanceof IResource) {
IJavaElement element= JavaCore.create((IResource)e);
if (element != null)
converted.add(element);
else
converted.add(e);
}
}
}
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();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
Object element= null;
if (selection.size() == 1) {
if (obj instanceof IJavaElement) {
IJavaElement cu= JavaModelUtil.findElementOfKind((IJavaElement)obj, IJavaElement.COMPILATION_UNIT);
if (cu != null)
element= getResourceFor(cu);
if (element == null)
element= JavaModelUtil.findElementOfKind((IJavaElement)obj, IJavaElement.CLASS_FILE);
}
else if (obj instanceof IFile)
element= obj;
if (element == null)
return;
IWorkbenchPage page= getSite().getPage();
IEditorPart editorArray[]= page.getEditors();
for (int i= 0; i < editorArray.length; ++i) {
IEditorPart editor= editorArray[i];
Object input= getElementOfInput(editor.getEditorInput());
if (input != null && input.equals(element)) {
page.bringToTop(editor);
if (obj instanceof IJavaElement)
EditorUtility.revealInEditor(editor, (IJavaElement) obj);
return;
}
}
}
}
private IResource getResourceFor(Object element) {
if (element instanceof IJavaElement) {
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
if (element instanceof IWorkingCopy) {
IWorkingCopy wc= (IWorkingCopy)element;
IJavaElement original= wc.getOriginalElement();
if (original != null)
element= original;
}
try {
element= ((IJavaElement)element).getUnderlyingResource();
} catch (JavaModelException e) {
return null;
}
}
if (!(element instanceof IResource) || ((IResource)element).isPhantom()) {
return null;
}
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);
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
saveWorkingSetState(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);
}
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));
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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());
}
}
}
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());
}
}
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
}
protected void saveWorkingSetState(IMemento memento) {
IWorkingSet ws= getWorkingSetFilter().getWorkingSet();
if (ws != null) {
memento.putString(TAG_WORKINGSET, ws.getName());
}
}
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) {
}
}
bar= tree.getHorizontalBar();
if (bar != null) {
try {
String posStr= memento.getString(TAG_HORIZONTAL_POSITION);
int position;
position= new Integer(posStr).intValue();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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);
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());
}
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
}
/**
* Create the KeyListener for doing the refresh on the viewer.
*/
private void initKeyListener() {
fViewer.getControl().addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent event) {
doKeyPressed(event);
}
});
}
private void doKeyPressed(KeyEvent event) {
if (event.stateMask != 0)
return;
int key= event.keyCode;
if (key == SWT.F5) {
fRefreshAction.selectionChanged(
(IStructuredSelection) fViewer.getSelection());
if (fRefreshAction.isEnabled())
fRefreshAction.run();
} else if (key == SWT.F4) {
OpenTypeHierarchyUtil.open(getSelection(), getSite().getWorkbenchWindow());
} else if (key == SWT.F3) {
fOpenCUAction.update();
if (fOpenCUAction.isEnabled())
fOpenCUAction.run();
}
}
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
void initFrameList() {
fFrameSource= new PackagesFrameSource(this);
fFrameList= new FrameList(fFrameSource);
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;
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
if (element.equals(m.getCompilationUnit()))
return;
if (element.equals(m.getClassFile()))
return;
}
}
ISelection newSelection= new StructuredSelection(element);
if (!fViewer.getSelection().equals(newSelection)) {
try {
fViewer.removeSelectionChangedListener(fSelectionListener);
fViewer.setSelection(newSelection);
} finally {
fViewer.addSelectionChangedListener(fSelectionListener);
}
}
}
}
/**
* 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];
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
}
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()) {
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 IClassFileEditorInput)
return ((IClassFileEditorInput)input).getClassFile();
else if (input instanceof IFileEditorInput)
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
return ((IFileEditorInput)input).getFile();
else if (input instanceof JarEntryEditorInput)
return ((JarEntryEditorInput)input).getStorage();
return null;
}
/**
* Returns the Viewer.
*/
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 working set filter for this view.
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
* @return the working set filter
*/
WorkingSetFilter getWorkingSetFilter() {
return fWorkingSetFilter;
}
/**
* 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);
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();
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
String showbin= fMemento.getString(TAG_SHOWBINARIES);
if (showbin != null)
getBinaryFilter().setShowBinaries(showbin.equals("true"));
else
initBinaryFilterFromPreferences();
String workingSetName= fMemento.getString(TAG_WORKINGSET);
if (workingSetName != null) {
IWorkingSet ws= SearchUI.findWorkingSet(workingSetName);
if (ws != null) {
getWorkingSetFilter().setWorkingSet(ws);
}
}
}
void initFilterFromPreferences() {
initBinaryFilterFromPreferences();
initLibraryFilterFromPreferences();
}
void initLibraryFilterFromPreferences() {
JavaPlugin plugin= JavaPlugin.getDefault();
boolean show= plugin.getPreferenceStore().getBoolean(TAG_SHOWLIBRARIES);
getLibraryFilter().setShowLibraries(show);
}
void initBinaryFilterFromPreferences() {
JavaPlugin plugin= JavaPlugin.getDefault();
boolean showbin= plugin.getPreferenceStore().getBoolean(TAG_SHOWBINARIES);
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
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.
*
* @param decorator a label decorator or <code>null</code> for no decorations.
*/
public void setLabelDecorator(ILabelDecorator decorator) {
JavaElementLabelProvider javaProvider= new JavaElementLabelProvider(getLabelProviderFlags());
javaProvider.setErrorTickManager(new MarkerErrorTickProvider());
|
5,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
|
if (decorator == null) {
fViewer.setLabelProvider(javaProvider);
} else {
fViewer.setLabelProvider(new DecoratingLabelProvider(javaProvider, decorator));
}
}
/**
* Gets the standard label flags
*/
private int getLabelProviderFlags() {
return JavaElementLabelProvider.SHOW_BASICS | JavaElementLabelProvider.SHOW_OVERLAY_ICONS |
JavaElementLabelProvider.SHOW_SMALL_ICONS | JavaElementLabelProvider.SHOW_VARIABLE | JavaElementLabelProvider.SHOW_PARAMETERS;
}
/*
* @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,264 |
Bug 5264 Class detail filtering options in packages view.
|
Build 20011018. The new build allows the user to expand classes in the packages view and look at their contents. (methods and fields) It would be nice to be able to filter out this view so it didn't show you the field if you didn't want it to. (e.g. have the same options as you do in the Outline view for a Java file)
|
resolved fixed
|
425b5aa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-17T11:01:14Z | 2001-10-25T22:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewerFilter.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.typehierarchy;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.JavaModelException;
/**
* Filter for the methods viewer.
* Changing a filter property does not trigger a refiltering of the viewer
*/
public class MethodsViewerFilter extends ViewerFilter {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.