Whitespace removal in jdt.jeview
Change-Id: I83603b401a80e01954ae4208ae2791125e952fc7
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/EditorUtility.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/EditorUtility.java
index 37c4cb6..fd32b1d 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/EditorUtility.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/EditorUtility.java
@@ -1,13 +1,13 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
*
- * This program and the accompanying materials
+ * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -47,8 +47,8 @@
}
return null;
}
-
-
+
+
public static IOpenable getJavaInput(IEditorPart part) {
IEditorInput editorInput= part.getEditorInput();
if (editorInput != null) {
@@ -57,28 +57,28 @@
return (IOpenable) input;
}
}
- return null;
+ return null;
}
/**
* Note: This is an inlined version of {@link JavaUI#getEditorInputJavaElement(IEditorInput)},
* which is not available in 3.1.
- *
+ *
* @param editorInput the editor input
* @return the Java element wrapped by <code>editorInput</code> or <code>null</code> if none
*/
private static IJavaElement javaUIgetEditorInputJavaElement(IEditorInput editorInput) {
Assert.isNotNull(editorInput);
- IJavaElement je= JavaUI.getWorkingCopyManager().getWorkingCopy(editorInput);
+ IJavaElement je= JavaUI.getWorkingCopyManager().getWorkingCopy(editorInput);
if (je != null)
return je;
-
+
/*
* This needs works, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=120340
*/
return editorInput.getAdapter(IJavaElement.class);
}
-
+
public static void selectInEditor(ITextEditor editor, int offset, int length) {
IEditorPart active = getActiveEditor();
if (active != editor) {
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/JEViewPlugin.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/JEViewPlugin.java
index 70ae965..b21e383 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/JEViewPlugin.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/JEViewPlugin.java
@@ -36,7 +36,7 @@
public static String getPluginId() {
return "org.eclipse.jdt.jeview"; //$NON-NLS-1$
}
-
+
@Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
@@ -56,19 +56,19 @@
public static IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}
-
+
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
-
+
public static void logErrorMessage(String message) {
log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, message, null));
}
-
+
public static void logMessage(String message) {
log(new Status(IStatus.INFO, getPluginId(), IStatus.INFO, message, null));
}
-
+
public static void logErrorStatus(String message, IStatus status) {
if (status == null) {
logErrorMessage(message);
@@ -78,12 +78,12 @@
multi.add(status);
log(multi);
}
-
+
public static void log(String message, Throwable e) {
- log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, message, e));
+ log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, message, e));
}
-
+
public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, e.getLocalizedMessage(), e));
+ log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, e.getLocalizedMessage(), e));
}
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ClasspathEntryProperties.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ClasspathEntryProperties.java
index 4935ce8..2d17529 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ClasspathEntryProperties.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ClasspathEntryProperties.java
@@ -30,16 +30,16 @@
import org.eclipse.jdt.jeview.JEViewPlugin;
public class ClasspathEntryProperties implements IPropertySource {
-
+
private static abstract class Property extends GenericProperty<IClasspathEntry> {
public Property(String name) {
super(IClasspathEntry.class, name);
}
}
-
+
private static HashMap<String, Property> fgIdToProperty= new HashMap<>();
private static LinkedHashMap<Class<?>, List<Property>> fgTypeToProperty= new LinkedHashMap<>();
-
+
static {
addProperty(new Property("combineAccessRules") {
@Override public Object compute(IClasspathEntry entry) {
@@ -82,7 +82,7 @@
}
});
}
-
+
private static void addProperty(Property property) {
fgIdToProperty.put(property.getId(), property);
List<Property> properties= fgTypeToProperty.get(property.getType());
@@ -92,7 +92,7 @@
}
properties.add(property);
}
-
+
static String getContentKindString(int kind) {
String name;
switch (kind) {
@@ -108,7 +108,7 @@
}
return kind + " (" + name + ")";
}
-
+
static String getEntryKindString(int kind) {
String name;
switch (kind) {
@@ -133,14 +133,14 @@
}
return kind + " (" + name + ")";
}
-
-
+
+
protected IClasspathEntry fEntry;
public ClasspathEntryProperties(IClasspathEntry entry) {
fEntry= entry;
}
-
+
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
List<IPropertyDescriptor> result= new ArrayList<>();
@@ -153,7 +153,7 @@
}
return result.toArray(new IPropertyDescriptor[result.size()]);
}
-
+
@Override
public Object getPropertyValue(Object id) {
Property property= fgIdToProperty.get(id);
@@ -172,22 +172,22 @@
}
}
}
-
+
@Override
public void setPropertyValue(Object name, Object value) {
// do nothing
}
-
+
@Override
public Object getEditableValue() {
return this;
}
-
+
@Override
public boolean isPropertySet(Object property) {
return false;
}
-
+
@Override
public void resetPropertyValue(Object property) {
// do nothing
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/GenericProperty.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/GenericProperty.java
index 1af4f59..84f5e75 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/GenericProperty.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/GenericProperty.java
@@ -18,12 +18,12 @@
import org.eclipse.jdt.core.JavaModelException;
public abstract class GenericProperty<T> {
-
+
private final Class<T> fType;
private final String fName;
private final String fId;
private final PropertyDescriptor fDescriptor;
-
+
public GenericProperty(Class<T> type, String name) {
fType= type;
fName= name;
@@ -35,22 +35,22 @@
public abstract Object compute(T element) throws JavaModelException;
-
+
public Class<T> getType() {
return fType;
}
-
-
+
+
public String getName() {
return fName;
}
-
+
public String getId() {
return fId;
}
-
+
public PropertyDescriptor getDescriptor() {
return fDescriptor;
}
-
+
}
\ No newline at end of file
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JarEntryResourceProperties.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JarEntryResourceProperties.java
index af73c80..9631464 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JarEntryResourceProperties.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JarEntryResourceProperties.java
@@ -23,16 +23,16 @@
import org.eclipse.jdt.core.IJarEntryResource;
public class JarEntryResourceProperties implements IPropertySource {
-
+
private static final String C_JAR_ENTRY_RESOURCE= "IJarEntryResource";
-
+
private static final String P_NAME= "org.eclipse.jdt.jeview.IJarEntryResource.name";
private static final String P_FULL_PATH= "org.eclipse.jdt.jeview.IJarEntryResource.fullPath";
private static final String P_IS_FILE= "org.eclipse.jdt.jeview.IJarEntryResource.isFile";
private static final String P_IS_READ_ONLY= "org.eclipse.jdt.jeview.IJarEntryResource.isReadOnly";
-
+
protected IJarEntryResource fJarEntryResource;
-
+
private static final ArrayList<IPropertyDescriptor> JAR_ENTRY_RESOURCE_PROPERTY_DESCRIPTORS= new ArrayList<>();
static {
addResourceDescriptor(new PropertyDescriptor(P_NAME, "name"));
@@ -46,18 +46,18 @@
descriptor.setCategory(C_JAR_ENTRY_RESOURCE);
JAR_ENTRY_RESOURCE_PROPERTY_DESCRIPTORS.add(descriptor);
}
-
+
public JarEntryResourceProperties(IJarEntryResource jarEntryResource) {
fJarEntryResource= jarEntryResource;
}
-
+
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
ArrayList<IPropertyDescriptor> result= new ArrayList<>(JAR_ENTRY_RESOURCE_PROPERTY_DESCRIPTORS);
return result.toArray(new IPropertyDescriptor[result.size()]);
}
-
+
@Override
public Object getPropertyValue(Object name) {
if (name.equals(P_NAME)) {
@@ -69,25 +69,25 @@
} else if (name.equals(P_IS_READ_ONLY)) {
return fJarEntryResource.isReadOnly();
}
-
+
return null;
}
-
+
@Override
public void setPropertyValue(Object name, Object value) {
// do nothing
}
-
+
@Override
public Object getEditableValue() {
return this;
}
-
+
@Override
public boolean isPropertySet(Object property) {
return false;
}
-
+
@Override
public void resetPropertyValue(Object property) {
// do nothing
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JavaElementProperties.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JavaElementProperties.java
index d201e7e..2d572de 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JavaElementProperties.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/JavaElementProperties.java
@@ -50,17 +50,17 @@
import org.eclipse.jdt.jeview.JEViewPlugin;
public class JavaElementProperties implements IPropertySource {
-
+
private static HashMap<String, Property> fgIdToProperty= new HashMap<>();
private static LinkedHashMap<Class<?>, List<Property>> fgTypeToProperty= new LinkedHashMap<>();
-
-
+
+
private static abstract class Property {
private final Class<?> fType;
private final String fName;
private final String fId;
private final PropertyDescriptor fDescriptor;
-
+
public Property(Class<?> type, String name) {
fType= type;
fName= name;
@@ -72,26 +72,26 @@
public abstract Object compute(IJavaElement javaElement) throws JavaModelException;
-
+
public Class<?> getType() {
return fType;
}
-
-
+
+
public String getName() {
return fName;
}
-
+
public String getId() {
return fId;
}
-
+
public PropertyDescriptor getDescriptor() {
return fDescriptor;
}
-
+
}
-
+
static {
addJavaElementProperties();
addClassFileProperties();
@@ -242,7 +242,7 @@
}
});
}
-
+
private static void addMemberProperties() {
addProperty(new Property(IMember.class, "javadocRange") {
@Override public Object compute(IJavaElement element) throws JavaModelException {
@@ -530,13 +530,13 @@
}
properties.add(property);
}
-
+
protected IJavaElement fJavaElement;
public JavaElementProperties(IJavaElement javaElement) {
fJavaElement= javaElement;
}
-
+
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
List<IPropertyDescriptor> result= new ArrayList<>();
@@ -549,7 +549,7 @@
}
return result.toArray(new IPropertyDescriptor[result.size()]);
}
-
+
@Override
public Object getPropertyValue(Object id) {
Property property= fgIdToProperty.get(id);
@@ -626,7 +626,7 @@
}
return elementType + " (" + name + ")";
}
-
+
static String getSourceRangeString(ISourceRange range) {
return range == null ? "null" : range.getOffset() + " + " + range.getLength();
}
@@ -635,7 +635,7 @@
StringBuffer sb = new StringBuffer().append("0x").append(Integer.toHexString(flags)).append(" (");
int prologLen= sb.length();
int rest= flags;
-
+
rest&= ~ appendFlag(sb, flags, Flags.AccPublic, "public ");
rest&= ~ appendFlag(sb, flags, Flags.AccPrivate, "private ");
rest&= ~ appendFlag(sb, flags, Flags.AccProtected, "protected ");
@@ -663,7 +663,7 @@
if (isMethod) {
rest&= ~ appendFlag(sb, flags, Flags.AccAnnotationDefault, "default(annotation) ");
}
-
+
if (rest != 0)
sb.append("unknown:0x").append(Integer.toHexString(rest)).append(" ");
int len = sb.length();
@@ -672,7 +672,7 @@
sb.append(")");
return sb.toString();
}
-
+
private static int appendFlag(StringBuffer sb, int flags, int flag, String name) {
if ((flags & flag) != 0) {
sb.append(name);
@@ -686,10 +686,10 @@
StringBuffer sb = new StringBuffer().append("0x").append(Integer.toHexString(kind)).append(" (");
int prologLen= sb.length();
int rest= kind;
-
+
rest&= ~ appendFlag(sb, kind, IPackageFragmentRoot.K_BINARY, "binary ");
rest&= ~ appendFlag(sb, kind, IPackageFragmentRoot.K_SOURCE, "source ");
-
+
if (rest != 0)
sb.append("unknown:0x").append(Integer.toHexString(rest));
int len = sb.length();
@@ -698,29 +698,29 @@
sb.append(")");
return sb.toString();
}
-
+
static String getSchedulingRuleString(ISchedulingRule schedulingRule) {
if (schedulingRule == null)
return null;
else
return schedulingRule.getClass().getSimpleName() + ": " + schedulingRule.toString();
}
-
+
@Override
public void setPropertyValue(Object name, Object value) {
// do nothing
}
-
+
@Override
public Object getEditableValue() {
return this;
}
-
+
@Override
public boolean isPropertySet(Object property) {
return false;
}
-
+
@Override
public void resetPropertyValue(Object property) {
// do nothing
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MarkerProperties.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MarkerProperties.java
index 0f11a9c..5297920 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MarkerProperties.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MarkerProperties.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -32,7 +32,7 @@
public class MarkerProperties implements IPropertySource {
private static final AttributeDescriptor[] NO_DESCRIPTORS= new AttributeDescriptor[0];
-
+
private final IMarker fMarker;
private AttributeDescriptor[] fPropertyDescriptors;
@@ -45,7 +45,7 @@
public AttributeDescriptor[] getPropertyDescriptors() {
if (fPropertyDescriptors != null)
return fPropertyDescriptors;
-
+
Map<String, Object> attributes= null;
boolean isJavaMarker= false;
try {
@@ -73,11 +73,11 @@
propertyDescriptor.setCategory("Attributes");
fPropertyDescriptors[i++]= propertyDescriptor;
}
-
+
MarkerPropertyDescriptor propertyDescriptor= new MarkerPropertyDescriptor("exists", fMarker.exists());
propertyDescriptor.setAlwaysIncompatible(true);
fPropertyDescriptors[i++]= propertyDescriptor;
-
+
String type;
try {
type= fMarker.getType();
@@ -87,7 +87,7 @@
propertyDescriptor= new MarkerPropertyDescriptor("type", type);
propertyDescriptor.setAlwaysIncompatible(true);
fPropertyDescriptors[i++]= propertyDescriptor;
-
+
String time;
try {
time= DateFormat.getDateTimeInstance().format(new Date(fMarker.getCreationTime()));
@@ -97,11 +97,11 @@
propertyDescriptor= new MarkerPropertyDescriptor("creationTime", time);
propertyDescriptor.setAlwaysIncompatible(true);
fPropertyDescriptors[i++]= propertyDescriptor;
-
+
propertyDescriptor= new MarkerPropertyDescriptor("markerId", fMarker.getId());
propertyDescriptor.setAlwaysIncompatible(true);
fPropertyDescriptors[i++]= propertyDescriptor;
-
+
}
return fPropertyDescriptors;
}
@@ -116,59 +116,59 @@
return null;
}
-
+
@Override
public void setPropertyValue(Object name, Object value) {
// do nothing
}
-
+
@Override
public Object getEditableValue() {
return this;
}
-
+
@Override
public boolean isPropertySet(Object property) {
return false;
}
-
+
@Override
public void resetPropertyValue(Object property) {
// do nothing
}
-
-
+
+
private static class AttributeDescriptor extends PropertyDescriptor {
private final Object fValue;
public AttributeDescriptor(String name, Object value) {
this("org.eclipse.jdt.jeview.IMarker." + name, name, value);
}
-
+
protected AttributeDescriptor(String key, String name, Object value) {
super(key, name);
fValue= value;
}
-
+
public Object getValue() {
return fValue;
}
}
-
+
private static class ProblemIdAttributeDescriptor extends AttributeDescriptor {
public ProblemIdAttributeDescriptor(String key, Object value) {
super(key, value);
}
-
+
@Override
public Object getValue() {
return getErrorLabel();
}
-
+
private String getErrorLabel() {
int id= (Integer) super.getValue();
StringBuffer buf= new StringBuffer(getConstantName(id)).append(" = ");
-
+
if ((id & IProblem.TypeRelated) != 0) {
buf.append("TypeRelated + ");
}
@@ -194,12 +194,12 @@
buf.append("Javadoc + ");
}
buf.append(id & IProblem.IgnoreCategoriesMask);
-
+
buf.append(" = 0x").append(Integer.toHexString(id)).append(" = ").append(id);
-
+
return buf.toString();
}
-
+
private static String getConstantName(int id) {
Field[] fields= IProblem.class.getFields();
for (Field f : fields) {
@@ -215,13 +215,13 @@
}
return "<UNKNOWN CONSTANT>";
}
-
+
}
-
+
private static class MarkerPropertyDescriptor extends AttributeDescriptor {
public MarkerPropertyDescriptor(String key, Object value) {
super("org.eclipse.jdt.jeview.IMarker.property." + key, key, value);
}
}
-
+
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MemberValuePairProperties.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MemberValuePairProperties.java
index 1b0f2d9..8ffc210 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MemberValuePairProperties.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/MemberValuePairProperties.java
@@ -24,14 +24,14 @@
import org.eclipse.jdt.core.IMemberValuePair;
public class MemberValuePairProperties implements IPropertySource {
-
+
private static final String C_MEMBER_VALUE_PAIR= "IMemberValuePair";
-
+
private static final String P_MEMBER_NAME= "org.eclipse.jdt.jeview.IMemberValuePair.memberName";
private static final String P_VALUE_KIND= "org.eclipse.jdt.jeview.IMemberValuePair.valueKind";
-
+
protected IMemberValuePair fMemberValuePair;
-
+
private static final ArrayList<IPropertyDescriptor> MEMBER_VALUE_PAIR_PROPERTY_DESCRIPTORS= new ArrayList<>();
static {
addResourceDescriptor(new PropertyDescriptor(P_MEMBER_NAME, "memberName"));
@@ -43,18 +43,18 @@
descriptor.setCategory(C_MEMBER_VALUE_PAIR);
MEMBER_VALUE_PAIR_PROPERTY_DESCRIPTORS.add(descriptor);
}
-
+
public MemberValuePairProperties(IMemberValuePair memberValuePair) {
fMemberValuePair= memberValuePair;
}
-
+
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
ArrayList<IPropertyDescriptor> result= new ArrayList<>(MEMBER_VALUE_PAIR_PROPERTY_DESCRIPTORS);
return result.toArray(new IPropertyDescriptor[result.size()]);
}
-
+
@Override
public Object getPropertyValue(Object name) {
if (name.equals(P_MEMBER_NAME)) {
@@ -62,30 +62,30 @@
} else if (name.equals(P_VALUE_KIND)) {
return getValueKindName(fMemberValuePair.getValueKind());
}
-
+
return null;
}
-
+
@Override
public void setPropertyValue(Object name, Object value) {
// do nothing
}
-
+
@Override
public Object getEditableValue() {
return this;
}
-
+
@Override
public boolean isPropertySet(Object property) {
return false;
}
-
+
@Override
public void resetPropertyValue(Object property) {
// do nothing
}
-
+
static String getValueKindName(int valueKind) {
String name= "UNKNOWN";
Field[] fields= IMemberValuePair.class.getFields();
@@ -103,5 +103,5 @@
}
return valueKind + " (" + name + ")";
}
-
+
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ResourceProperties.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ResourceProperties.java
index 968932d..4770982 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ResourceProperties.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/properties/ResourceProperties.java
@@ -23,9 +23,9 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
public class ResourceProperties implements IPropertySource {
-
+
private static final String C_RESOURCE= "IResource";
-
+
private static final String P_NAME= "org.eclipse.jdt.jeview.IResource.name";
private static final String P_FULL_PATH= "org.eclipse.jdt.jeview.IResource.fullPath";
private static final String P_LOCATION= "org.eclipse.jdt.jeview.IResource.location";
@@ -41,9 +41,9 @@
private static final String P_IS_PHANTOM= "org.eclipse.jdt.jeview.IResource.isPhantom";
private static final String P_IS_TEAM_PRIVATE_MEMBER= "org.eclipse.jdt.jeview.IResource.isTeamPrivateMember";
private static final String P_IS_VIRTUAL= "org.eclipse.jdt.jeview.IResource.isVirtual";
-
+
protected IResource fResource;
-
+
private static final ArrayList<IPropertyDescriptor> RESOURCE_PROPERTY_DESCRIPTORS= new ArrayList<>();
static {
addResourceDescriptor(new PropertyDescriptor(P_NAME, "name"));
@@ -68,12 +68,12 @@
descriptor.setCategory(C_RESOURCE);
RESOURCE_PROPERTY_DESCRIPTORS.add(descriptor);
}
-
+
public ResourceProperties(IResource resource) {
fResource= resource;
}
-
+
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
ArrayList<IPropertyDescriptor> result= new ArrayList<>(RESOURCE_PROPERTY_DESCRIPTORS);
@@ -81,11 +81,11 @@
// result.addAll(MEMBER_PROPERTY_DESCRIPTORS);
// if (fJavaElement instanceof IParent)
// result.addAll(PARENT_PROPERTY_DESCRIPTORS);
-
+
return result.toArray(new IPropertyDescriptor[result.size()]);
}
-
+
@Override
public Object getPropertyValue(Object name) {
if (name.equals(P_NAME)) {
@@ -119,25 +119,25 @@
} else if (name.equals(P_IS_VIRTUAL)) {
return fResource.isVirtual();
}
-
+
return null;
}
-
+
@Override
public void setPropertyValue(Object name, Object value) {
// do nothing
}
-
+
@Override
public Object getEditableValue() {
return this;
}
-
+
@Override
public boolean isPropertySet(Object property) {
return false;
}
-
+
@Override
public void resetPropertyValue(Object property) {
// do nothing
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Error.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Error.java
index f000323..76b28e4 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Error.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Error.java
@@ -40,7 +40,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
Error other= (Error) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -48,31 +48,31 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
if (fException == null) {
if (other.fException != null)
return false;
} else if (! fException.equals(other.fException)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0)
+ (fException != null ? fException.hashCode() : 0);
}
-
+
@Override
public JEAttribute[] getChildren() {
return EMPTY;
@@ -86,7 +86,7 @@
public Exception getException() {
return fException;
}
-
+
@Override
public Object getWrappedObject() {
return fException;
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEAttribute.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEAttribute.java
index fcc54dc..88c3b63 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEAttribute.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEAttribute.java
@@ -1,13 +1,13 @@
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
*
- * This program and the accompanying materials
+ * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -18,19 +18,19 @@
*
*/
public abstract class JEAttribute {
-
+
protected static final JEAttribute[] EMPTY= new JEAttribute[0];
public abstract JEAttribute getParent();
public abstract JEAttribute[] getChildren();
public abstract String getLabel();
-
+
public abstract Object getWrappedObject();
-
+
@Override
public abstract boolean equals(Object obj);
-
+
@Override
public abstract int hashCode();
-
+
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEClasspathEntry.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEClasspathEntry.java
index 654836d..5b6d3a8 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEClasspathEntry.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEClasspathEntry.java
@@ -30,11 +30,11 @@
public class JEClasspathEntry extends JEAttribute {
-
+
private final JEAttribute fParent; // can be null
private final String fName; // can be null
final IClasspathEntry fEntry;
-
+
JEClasspathEntry(JEAttribute parent, String name, IClasspathEntry entry) {
Assert.isNotNull(entry);
fParent= parent;
@@ -46,7 +46,7 @@
public JEAttribute getParent() {
return fParent;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -54,7 +54,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JEClasspathEntry other= (JEClasspathEntry) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -62,33 +62,33 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0)
+ fEntry.hashCode();
}
-
+
@Override
public Object getWrappedObject() {
return fEntry;
}
-
+
@Override
public JEAttribute[] getChildren() {
ArrayList<JEAttribute> result= new ArrayList<>();
-
+
result.add(new JavaElementChildrenProperty(this, "ACCESS RULES") {
@Override protected JEAttribute[] computeChildren() throws CoreException {
IAccessRule[] accessRules= fEntry.getAccessRules();
@@ -170,7 +170,7 @@
return children;
}
});
-
+
return result.toArray(new JEAttribute[result.size()]);
}
@@ -181,7 +181,7 @@
label= fName + ": " + label;
return label;
}
-
+
public static JEAttribute compute(JEAttribute parent, String name, Callable<IClasspathEntry> computer) {
try {
IClasspathEntry entry= computer.call();
@@ -198,5 +198,5 @@
return new JEClasspathEntry(parent, name, entry);
}
}
-
+
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEJarEntryResource.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEJarEntryResource.java
index c12f952..5f58e39 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEJarEntryResource.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEJarEntryResource.java
@@ -24,11 +24,11 @@
public class JEJarEntryResource extends JEAttribute {
-
+
private final JEAttribute fParent; // can be null
private final String fName; // can be null
private IJarEntryResource fJarEntryResource;
-
+
JEJarEntryResource(JEAttribute parent, String name, IJarEntryResource jarEntryResource) {
Assert.isNotNull(jarEntryResource);
fParent= parent;
@@ -40,7 +40,7 @@
public JEAttribute getParent() {
return fParent;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -48,7 +48,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JEJarEntryResource other= (JEJarEntryResource) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -56,29 +56,29 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0)
+ fJarEntryResource.hashCode();
}
-
+
@Override
public Object getWrappedObject() {
return fJarEntryResource;
}
-
+
public IJarEntryResource getJarEntryResource() {
return fJarEntryResource;
}
@@ -86,15 +86,15 @@
@Override
public JEAttribute[] getChildren() {
ArrayList<JEAttribute> result= new ArrayList<>();
-
+
Object parent= fJarEntryResource.getParent();
if (parent instanceof IJarEntryResource)
result.add(new JEJarEntryResource(this, "PARENT", (IJarEntryResource) parent));
else
result.add(new JavaElement(this, "PARENT", (IJavaElement) parent));
-
+
result.add(new JavaElement(this, "PACKAGE FRAGMENT ROOT", fJarEntryResource.getPackageFragmentRoot()));
-
+
result.add(new JavaElementChildrenProperty(this, "CHILDREN") {
@Override protected JEAttribute[] computeChildren() throws CoreException {
IJarEntryResource[] jarEntryResources= getJarEntryResource().getChildren();
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMarker.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMarker.java
index 32c7f44..3254e55 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMarker.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMarker.java
@@ -1,13 +1,13 @@
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
*
- * This program and the accompanying materials
+ * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -56,16 +56,16 @@
return e.getClass().getSimpleName();
}
}
-
+
public IMarker getMarker() {
return fMarker;
}
-
+
@Override
public Object getWrappedObject() {
return fMarker;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -73,7 +73,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JEMarker other= (JEMarker) obj;
if (! fParent.equals(other.fParent)) {
return false;
@@ -84,13 +84,13 @@
if (! fMarker.equals(other.fMarker)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return fParent.hashCode() + fName.hashCode() + fMarker.hashCode();
}
-
+
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMemberValuePair.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMemberValuePair.java
index 8242810..2295871 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMemberValuePair.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEMemberValuePair.java
@@ -22,11 +22,11 @@
public class JEMemberValuePair extends JEAttribute {
-
+
private final JEAttribute fParent;
private String fName; // can be null
private IMemberValuePair fMemberValuePair; // can be null
-
+
JEMemberValuePair(JEAttribute parent, String name, IMemberValuePair memberValuePair) {
Assert.isNotNull(parent);
fParent= parent;
@@ -37,12 +37,12 @@
JEMemberValuePair(JEAttribute parent, IMemberValuePair memberValuePair) {
this(parent, null, memberValuePair);
}
-
+
@Override
public JEAttribute getParent() {
return fParent;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -50,7 +50,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JEMemberValuePair other= (JEMemberValuePair) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -58,36 +58,36 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
if (fMemberValuePair == null) {
if (other.fMemberValuePair != null)
return false;
} else if (! fMemberValuePair.getMemberName().equals(other.fMemberValuePair.getMemberName())) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0)
+ (fMemberValuePair != null ? fMemberValuePair.getMemberName().hashCode() : 0);
}
-
+
@Override
public Object getWrappedObject() {
return fMemberValuePair;
}
-
+
@Override
public JEAttribute[] getChildren() {
if (fMemberValuePair == null)
@@ -114,13 +114,13 @@
static JEAttribute createMVPairValue(JEAttribute parent, String name, Object value) {
if ((value instanceof Object[])) {
return createArrayValuedMVPair(parent, name, (Object[]) value);
-
+
} else if (value instanceof IAnnotation) {
return new JavaElement(parent, name, (IAnnotation) value);
-
+
} else if (value != null) {
return new JavaElementProperty(parent, name, value);
-
+
} else {
return new Null(parent, name);
}
@@ -133,7 +133,7 @@
JEAttribute[] children= new JEAttribute[values.length];
for (int i= 0; i < values.length; i++) {
Object value= values[i];
- String childName= value == null ? "" : value.getClass().getSimpleName();
+ String childName= value == null ? "" : value.getClass().getSimpleName();
children[i]= createMVPairValue(this, childName, value);
}
return children;
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEResource.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEResource.java
index 4da41db..ecc5df3 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEResource.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEResource.java
@@ -31,11 +31,11 @@
public class JEResource extends JEAttribute {
-
+
private final JEAttribute fParent; // can be null
private final String fName; // can be null
private IResource fResource;
-
+
JEResource(JEAttribute parent, String name, IResource resource) {
Assert.isNotNull(resource);
fParent= parent;
@@ -47,7 +47,7 @@
public JEAttribute getParent() {
return fParent;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -55,7 +55,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JEResource other= (JEResource) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -63,29 +63,29 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0)
+ fResource.hashCode();
}
-
+
@Override
public Object getWrappedObject() {
return fResource;
}
-
+
public IResource getResource() {
return fResource;
}
@@ -93,15 +93,15 @@
@Override
public JEAttribute[] getChildren() {
ArrayList<JEAttribute> result= new ArrayList<>();
-
+
IContainer parent= fResource.getParent();
if (parent != null )
result.add(new JEResource(this, "PARENT", parent));
else
result.add(new JavaElementProperty(this, "PARENT", parent));
-
+
result.add(new JavaElement(this, "JavaCore.create(..)", JavaCore.create(fResource)));
-
+
if (fResource instanceof IContainer) {
final IContainer container= (IContainer) fResource;
// result.add(new JavaElementProperty(this, "ModificationStamp") {
@@ -154,7 +154,7 @@
return children;
}
});
-
+
return result.toArray(new JEAttribute[result.size()]);
}
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JERoot.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JERoot.java
index 17423a3..4ff1fda 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JERoot.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JERoot.java
@@ -38,16 +38,16 @@
return new JEJarEntryResource(null, null, (IJarEntryResource) element);
else
throw new IllegalArgumentException(String.valueOf(element));
-
+
}
}.mapToList(javaElementsOrResources);
-
+
// fJavaElements= Mapper.build(javaElements, new Mapper<IJavaElement, JavaElement>() {
// @Override public JavaElement map(IJavaElement element) {
// return new JavaElement(null, element);
// }
// });
-
+
// fJavaElements= new ArrayList<JavaElement>(javaElements.size());
// for (IJavaElement javaElement : javaElements) {
// fJavaElements.add(new JavaElement(null, javaElement));
@@ -68,7 +68,7 @@
public Object getWrappedObject() {
return null;
}
-
+
@Override
public String getLabel() {
StringBuilder buf = new StringBuilder("root: ");
@@ -89,11 +89,11 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JERoot other= (JERoot) obj;
return fJEAttributes.equals(other.fJEAttributes);
}
-
+
@Override
public int hashCode() {
return fJEAttributes.hashCode();
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEViewLabelProvider.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEViewLabelProvider.java
index 4717bb0..39642ab 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEViewLabelProvider.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JEViewLabelProvider.java
@@ -29,51 +29,51 @@
public class JEViewLabelProvider extends LabelProvider /*implements IColorProvider, IFontProvider*/ {
-
+
JavaElementLabelProvider fJavaElementLabelProvider;
private Image fChildrenImg;
private Image fInfoImg;
-
+
public JEViewLabelProvider() {
fChildrenImg= JEPluginImages.IMG_CHILDREN.createImage();
fInfoImg= JEPluginImages.IMG_INFO.createImage();
fJavaElementLabelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_SMALL_ICONS);
}
-
-
+
+
@Override
public String getText(Object element) {
if (element instanceof JEAttribute)
return ((JEAttribute) element).getLabel();
return super.getText(element);
}
-
+
@Override
public Image getImage(Object element) {
if (element instanceof JavaElement) {
return fJavaElementLabelProvider.getImage(((JavaElement) element).getJavaElement());
-
+
} else if (element instanceof JEResource) {
return fJavaElementLabelProvider.getImage(((JEResource) element).getResource());
-
+
} else if (element instanceof JEJarEntryResource) {
return fJavaElementLabelProvider.getImage(((JEJarEntryResource) element).getJarEntryResource());
-
+
} else if (element instanceof JavaElementProperty) {
return fInfoImg;
-
+
} else if (element instanceof JEMemberValuePair) {
return fInfoImg;
-
+
} else if (element instanceof JavaElementChildrenProperty) {
return fChildrenImg;
-
+
} else if (element instanceof JEClasspathEntry) {
return fChildrenImg;
-
+
} else if (element instanceof Error) {
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-
+
} else if (element instanceof JEMarker) {
JEMarker marker= (JEMarker) element;
Object severity= marker.getMarkerAttribute(IMarker.SEVERITY);
@@ -89,12 +89,12 @@
}
}
return null;
-
+
} else {
return super.getImage(element);
}
}
-
+
@Override
public void dispose() {
super.dispose();
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElement.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElement.java
index 28f2da5..bd4b046 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElement.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElement.java
@@ -48,7 +48,7 @@
public class JavaElement extends JEAttribute {
-
+
private static final long LABEL_OPTIONS= JavaElementLabels.F_APP_TYPE_SIGNATURE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_APP_RETURNTYPE | JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.T_TYPE_PARAMETERS | JavaElementLabels.USE_RESOLVED;
private final JEAttribute fParent; //can be null
@@ -60,7 +60,7 @@
fName= name;
fJavaElement= element;
}
-
+
public JavaElement(JEAttribute parent, IJavaElement element) {
this(parent, null, element);
}
@@ -69,11 +69,11 @@
public JEAttribute getParent() {
return fParent;
}
-
+
public IJavaElement getJavaElement() {
return fJavaElement;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -81,7 +81,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JavaElement other= (JavaElement) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -89,24 +89,24 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
if (fJavaElement == null) {
if (other.fJavaElement != null)
return false;
} else if (! fJavaElement.equals(other.fJavaElement)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
@@ -118,13 +118,13 @@
public Object getWrappedObject() {
return fJavaElement;
}
-
+
@Override
public String getLabel() {
StringBuilder sb= new StringBuilder();
if (fName != null)
sb.append(fName).append(": ");
-
+
if (fJavaElement == null) {
sb.append("java element: null");
} else {
@@ -141,15 +141,15 @@
public JEAttribute[] getChildren() {
if (fJavaElement == null)
return EMPTY;
-
+
ArrayList<JEAttribute> result= new ArrayList<>();
-
+
if (fJavaElement instanceof IParent) {
addParentChildren(result, (IParent) fJavaElement);
}
-
+
addJavaElementChildren(result, fJavaElement);
-
+
if (fJavaElement instanceof IJavaModel)
addJavaModelChildren(result, (IJavaModel) fJavaElement);
if (fJavaElement instanceof IJavaProject)
@@ -158,7 +158,7 @@
addPackageFragmentRootChildren(result, (IPackageFragmentRoot) fJavaElement);
if (fJavaElement instanceof IPackageFragment)
addPackageFragmentChildren(result, (IPackageFragment) fJavaElement);
-
+
if (fJavaElement instanceof ITypeRoot)
addTypeRootChildren(result, (ITypeRoot) fJavaElement);
if (fJavaElement instanceof IOrdinaryClassFile)
@@ -167,26 +167,26 @@
addModularClassFileChildren(result, (IModularClassFile) fJavaElement);
if (fJavaElement instanceof ICompilationUnit)
addCompilationUnitChildren(result, (ICompilationUnit) fJavaElement);
-
+
if (fJavaElement instanceof IType)
addTypeChildren(result, (IType) fJavaElement);
if (fJavaElement instanceof IMethod)
addMethodChildren(result, (IMethod) fJavaElement);
if (fJavaElement instanceof IMember)
addMemberChildren(result, (IMember) fJavaElement);
-
+
if (fJavaElement instanceof ITypeParameter)
addTypeParameterChildren(result, (ITypeParameter) fJavaElement);
if (fJavaElement instanceof ILocalVariable)
addLocalVariableChildren(result, (ILocalVariable) fJavaElement);
-
+
if (fJavaElement instanceof IAnnotation)
addAnnotationChildren(result, (IAnnotation) fJavaElement);
if (fJavaElement instanceof IAnnotatable)
addAnnotatableChildren(result, (IAnnotatable) fJavaElement);
-
+
return result.toArray(new JEAttribute[result.size()]);
-
+
}
private void addParentChildren(ArrayList<JEAttribute> result, final IParent parent) {
@@ -296,7 +296,7 @@
}
});
}
-
+
private void addPackageFragmentRootChildren(ArrayList<JEAttribute> result, final IPackageFragmentRoot packageFragmentRoot) {
result.add(new JavaElementChildrenProperty(this, "NON JAVA RESOURCES") {
@Override
@@ -338,7 +338,7 @@
}
});
}
-
+
private void addTypeRootChildren(ArrayList<JEAttribute> result, final ITypeRoot typeRoot) {
result.add(JavaElement.compute(this, "FIND PRIMARY TYPE", new Callable<IJavaElement>() {
@Override
@@ -347,7 +347,7 @@
}
}));
}
-
+
private void addClassFileChildren(ArrayList<JEAttribute> result, final IOrdinaryClassFile classFile) {
result.add(JavaElement.compute(this, "TYPE", new Callable<IJavaElement>() {
@Override
@@ -356,7 +356,7 @@
}
}));
}
-
+
private void addModularClassFileChildren(ArrayList<JEAttribute> result, final IModularClassFile classFile) {
result.add(JavaElement.compute(this, "MODULE", new Callable<IJavaElement>() {
@Override
@@ -395,7 +395,7 @@
}
});
}
-
+
private void addMemberChildren(ArrayList<JEAttribute> result, final IMember member) {
result.add(new JavaElement(this, "CLASS FILE", member.getClassFile()));
result.add(new JavaElement(this, "COMPILATION UNIT", member.getCompilationUnit()));
@@ -408,7 +408,7 @@
}
});
}
-
+
private void addAnnotationChildren(ArrayList<JEAttribute> result, final IAnnotation annotation) {
result.add(new JavaElementChildrenProperty(this, "MEMBER VALUE PAIRS") {
@Override
@@ -418,7 +418,7 @@
}
});
}
-
+
private void addAnnotatableChildren(ArrayList<JEAttribute> result, final IAnnotatable annotatable) {
result.add(new JavaElementChildrenProperty(this, "ANNOTATIONS") {
@Override
@@ -428,7 +428,7 @@
}
});
}
-
+
private void addTypeChildren(ArrayList<JEAttribute> result, final IType type) {
result.add(new JavaElementProperty(this, "IS RESOLVED", type.isResolved()));
result.add(new JavaElementProperty(this, "KEY", type.getKey()));
@@ -445,14 +445,14 @@
return createStrings(this, type.getTypeParameterSignatures());
}
});
-
+
result.add(new JavaElementProperty(this, "SUPERCLASS NAME") {
@Override
protected Object computeValue() throws Exception {
return type.getSuperclassName();
}
});
-
+
result.add(new JavaElementProperty(this, "SUPERCLASS TYPE SIGNATURE") {
@Override
protected Object computeValue() throws Exception {
@@ -471,7 +471,7 @@
return createStrings(this, type.getSuperInterfaceTypeSignatures());
}
});
-
+
result.add(new JavaElementChildrenProperty(this, "FIELDS") {
@Override
protected JEAttribute[] computeChildren() throws JavaModelException {
@@ -541,7 +541,7 @@
result.add(new Error(this, "DEFAULT_VALUE", e));
}
}
-
+
private void addTypeParameterChildren(ArrayList<JEAttribute> result, final ITypeParameter typeParameter) {
result.add(new JavaElement(this, "TYPE ROOT", typeParameter.getTypeRoot()));
result.add(new JavaElement(this, "DECLARING MEMBER", typeParameter.getDeclaringMember()));
@@ -558,12 +558,12 @@
}
});
}
-
+
private void addLocalVariableChildren(ArrayList<JEAttribute> result, final ILocalVariable localVariable) {
result.add(new JavaElement(this, "TYPE ROOT", localVariable.getTypeRoot()));
result.add(new JavaElement(this, "DECLARING MEMBER", localVariable.getDeclaringMember()));
}
-
+
static JavaElement[] createJavaElements(JEAttribute parent, Object[] javaElements) {
JavaElement[] jeChildren= new JavaElement[javaElements.length];
for (int i= 0; i < javaElements.length; i++) {
@@ -571,7 +571,7 @@
}
return jeChildren;
}
-
+
static JavaElement[] createJavaElements(JEAttribute parent, IJavaElement[] javaElements) {
JavaElement[] jeChildren= new JavaElement[javaElements.length];
for (int i= 0; i < javaElements.length; i++) {
@@ -579,7 +579,7 @@
}
return jeChildren;
}
-
+
static JEAttribute[] createResources(JEAttribute parent, Object[] resources) {
JEAttribute[] resourceChildren= new JEAttribute[resources.length];
for (int i= 0; i < resources.length; i++) {
@@ -593,7 +593,7 @@
}
return resourceChildren;
}
-
+
static JEAttribute[] createMemberValuePairs(JEAttribute parent, IMemberValuePair[] mvPairs) {
JEAttribute[] mvPairChildren= new JEAttribute[mvPairs.length];
for (int i= 0; i < mvPairs.length; i++) {
@@ -602,7 +602,7 @@
}
return mvPairChildren;
}
-
+
static JEAttribute[] createCPEntries(JEAttribute parent, IClasspathEntry[] entries) {
JEAttribute[] entryChildren= new JEAttribute[entries.length];
for (int i= 0; i < entries.length; i++) {
@@ -620,7 +620,7 @@
return o1.getKey().compareTo(o2.getKey());
}
});
-
+
JEAttribute[] children= new JEAttribute[entries.size()];
for (int i= 0; i < entries.size(); i++) {
Entry<String, String> entry= entries.get(i);
@@ -628,7 +628,7 @@
}
return children;
}
-
+
static JEAttribute[] createStrings(JEAttribute parent, String[] strings) {
JEAttribute[] children= new JEAttribute[strings.length];
for (int i= 0; i < strings.length; i++) {
@@ -645,7 +645,7 @@
return new Error(parent, name, e);
}
}
-
+
public static JEAttribute create(JEAttribute parent, String name, IJavaElement javaElement) {
if (javaElement == null) {
return new Null(parent, name);
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementChildrenProperty.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementChildrenProperty.java
index 600ed5b..6e72026 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementChildrenProperty.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementChildrenProperty.java
@@ -36,7 +36,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JavaElementChildrenProperty other= (JavaElementChildrenProperty) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -44,28 +44,28 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0);
}
-
+
@Override
public Object getWrappedObject() {
return getChildren().length;
}
-
+
@Override
public JEAttribute[] getChildren() {
try {
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementProperty.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementProperty.java
index 2403d61..affee89 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementProperty.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementProperty.java
@@ -47,7 +47,7 @@
public Object getWrappedObject() {
return fValueObject;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -55,7 +55,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
JavaElementProperty other= (JavaElementProperty) obj;
if (fParent == null) {
if (other.fParent != null)
@@ -63,28 +63,28 @@
} else if (! fParent.equals(other.fParent)) {
return false;
}
-
+
if (fName == null) {
if (other.fName != null)
return false;
} else if (! fName.equals(other.fName)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return (fParent != null ? fParent.hashCode() : 0)
+ (fName != null ? fName.hashCode() : 0);
}
-
+
@Override
public JEAttribute[] getChildren() {
if (fValue != null)
return EMPTY;
-
+
try {
computeValue();
return EMPTY;
@@ -103,7 +103,7 @@
return Error.ERROR;
}
}
-
+
if (fName == null)
return value;
else
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementView.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementView.java
index 5fd6f81..9e4ba42 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementView.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/JavaElementView.java
@@ -144,7 +144,7 @@
TreeViewer fViewer;
private DrillDownAdapter fDrillDownAdapter;
JERoot fInput;
-
+
private Action fFocusAction;
private Action fFindTypeAction;
private Action fFindType2Action;
@@ -160,9 +160,9 @@
private Action fCompareAction;
private Action fPropertiesAction;
Action fDoubleClickAction;
-
+
private Action fLogDeltasAction;
-
+
private PropertySheetPage fPropertySheetPage;
private static class InputDialog extends org.eclipse.jface.dialogs.InputDialog {
@@ -193,7 +193,7 @@
void fireSelectionChanged() {
if (fSelectionChangedListeners != null) {
IStructuredSelection selection = getSelection();
-
+
if (fLastSelection != null) {
List<?> newSelection = selection.toList();
List<?> oldSelection = fLastSelection.toList();
@@ -214,15 +214,15 @@
}
}
fLastSelection= selection;
-
+
SelectionChangedEvent event= new SelectionChangedEvent(this, selection);
-
+
for (ISelectionChangedListener listener : fSelectionChangedListeners) {
listener.selectionChanged(event);
}
}
}
-
+
@Override
public void addSelectionChangedListener(ISelectionChangedListener listener) {
fSelectionChangedListeners.add(listener);
@@ -236,7 +236,7 @@
Object element= iter.next();
if (element instanceof JavaElement) {
IJavaElement javaElement= ((JavaElement) element).getJavaElement();
- if (javaElement != null && ! (javaElement instanceof IJavaModel)) // various selection listeners assume getJavaProject() is non-null
+ if (javaElement != null && ! (javaElement instanceof IJavaModel)) // various selection listeners assume getJavaProject() is non-null
externalSelection.add(javaElement);
} else if (element instanceof JEResource) {
IResource resource= ((JEResource) element).getResource();
@@ -262,7 +262,7 @@
//not supported
}
}
-
+
public JavaElementView() {
//
}
@@ -280,7 +280,7 @@
} else {
setContentDescription("");
}
-
+
}
};
fViewer.setContentProvider(new JEViewContentProvider());
@@ -310,7 +310,7 @@
void setSingleInput(Object javaElementOrResource) {
setInput(Collections.singleton(javaElementOrResource));
}
-
+
void setInput(Collection<?> javaElementsOrResources) {
fInput= new JERoot(javaElementsOrResources);
fViewer.setInput(fInput);
@@ -328,7 +328,7 @@
void setEmptyInput() {
setInput(Collections.emptySet());
}
-
+
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
@@ -367,7 +367,7 @@
manager.add(fResetAction);
manager.add(fRefreshAction);
manager.add(new Separator());
-
+
if (! getSite().getSelectionProvider().getSelection().isEmpty()) {
MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel());
IWorkbenchWindow workbenchWindow= getSite().getWorkbenchWindow();
@@ -376,10 +376,10 @@
}
addElementActionsOrNot(manager);
manager.add(new Separator());
-
+
manager.add(fCopyAction);
manager.add(new Separator());
-
+
fDrillDownAdapter.addNavigationActions(manager);
manager.add(new Separator());
// Other plug-ins can contribute there actions here
@@ -401,7 +401,7 @@
return "Sho&w In" + '\t' + keyBinding;
}
-
+
private void addFocusActionOrNot(IMenuManager manager) {
if (fViewer.getSelection() instanceof IStructuredSelection) {
IStructuredSelection structuredSelection= (IStructuredSelection) fViewer.getSelection();
@@ -425,7 +425,7 @@
}
}
}
-
+
private void addElementActionsOrNot(IMenuManager manager) {
if (fViewer.getSelection() instanceof IStructuredSelection) {
IStructuredSelection structuredSelection= (IStructuredSelection) fViewer.getSelection();
@@ -448,7 +448,7 @@
}
}
}
-
+
private void addCompareActionOrNot(IMenuManager manager) {
if (fViewer.getSelection() instanceof ITreeSelection) {
ITreeSelection treeSelection = (ITreeSelection) fViewer.getSelection();
@@ -457,7 +457,7 @@
}
}
}
-
+
private void fillLocalToolBar(IToolBarManager manager) {
manager.add(fCodeSelectAction);
manager.add(fElementAtAction);
@@ -491,7 +491,7 @@
setEmptyInput();
return;
}
-
+
IJavaElement[] resolved;
try {
resolved= codeResolve(javaElement, (ITextSelection) selection);
@@ -503,12 +503,12 @@
setEmptyInput();
return;
}
-
+
setInput(Arrays.asList(resolved));
}
};
fCodeSelectAction.setToolTipText("Set input from current editor's selection (codeSelect)");
-
+
fElementAtAction= new Action("Set Input from Editor location (&getElementAt)", JEPluginImages.IMG_SET_FOCUS) {
@Override public void run() {
IEditorPart editor= getSite().getPage().getActiveEditor();
@@ -532,7 +532,7 @@
setEmptyInput();
return;
}
-
+
IJavaElement resolved;
try {
resolved= getElementAtOffset(javaElement, (ITextSelection) selection);
@@ -544,12 +544,12 @@
setEmptyInput();
return;
}
-
+
setSingleInput(resolved);
}
};
fElementAtAction.setToolTipText("Set input from current editor's selection location (getElementAt)");
-
+
fCreateFromHandleAction= new Action("Create From &Handle...") {
@Override public void run() {
InputDialog dialog= new InputDialog(getSite().getShell(), "Create Java Element From Handle Identifier", "&Handle identifier:", "", null);
@@ -560,7 +560,7 @@
setSingleInput(javaElement);
}
};
-
+
fFocusAction= new Action() {
@Override public void run() {
Object selected= ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
@@ -572,16 +572,16 @@
}
};
fFocusAction.setToolTipText("Focus on Selection");
-
+
fFindTypeAction= new Action() {
@Override public void run() {
Object selected= ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
final IJavaProject project= (IJavaProject) ((JavaElement) selected).getJavaElement();
-
+
InputDialog dialog= new InputDialog(getSite().getShell(), "IJavaProject#findType(String fullyQualifiedName)", "fullyQualifiedName:", "", null);
if (dialog.open() != Window.OK)
return;
-
+
final String fullyQualifiedName= dialog.getValue();
try {
IType type = project.findType(fullyQualifiedName);
@@ -594,17 +594,17 @@
}
};
fFindTypeAction.setText("findType(String)...");
-
+
fFindType2Action= new Action() {
@Override public void run() {
Object selected= ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
final IJavaProject project= (IJavaProject) ((JavaElement) selected).getJavaElement();
-
+
InputDialog dialog= new InputDialog(getSite().getShell(), "IJavaProject#findType(String fullyQualifiedName, IProgressMonitor pm)", "fullyQualifiedName:", "", null);
if (dialog.open() != Window.OK)
return;
final String fullyQualifiedName= dialog.getValue();
-
+
class Runner implements IRunnableWithProgress {
IType type;
@Override
@@ -630,17 +630,17 @@
}
};
fFindType2Action.setText("findType(String, IProgressMonitor)...");
-
+
fResolveTypeAction= new Action() {
@Override public void run() {
Object selected= ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
final IType type= (IType) ((JavaElement) selected).getJavaElement();
-
+
InputDialog dialog= new InputDialog(getSite().getShell(), "IType#resolveType(String typeName)", "typeName:", "", null);
if (dialog.open() != Window.OK)
return;
final String typeName= dialog.getValue();
-
+
JavaElementChildrenProperty element= new JavaElementChildrenProperty(fInput, "'" + type.getFullyQualifiedName() + "'.resolveType(\"" + typeName +"\")") {
@Override protected JEAttribute[] computeChildren() throws Exception {
String[][] resolvedTypes= type.resolveType(typeName);
@@ -661,17 +661,17 @@
}
};
fResolveTypeAction.setText("resolveType(String)...");
-
+
fGetAnnotationAction= new Action() {
@Override public void run() {
Object selected= ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
final IAnnotatable annotatable= (IAnnotatable) ((JavaElement) selected).getJavaElement();
-
+
InputDialog dialog= new InputDialog(getSite().getShell(), "IAnnotatable#getAnnotation(String name)", "name:", "", null);
if (dialog.open() != Window.OK)
return;
final String name= dialog.getValue();
-
+
JavaElementChildrenProperty element= new JavaElementChildrenProperty(fInput, "'" + ((IJavaElement) annotatable).getElementName() + "'.getAnnotation(\"" + name +"\")") {
@Override protected JEAttribute[] computeChildren() throws Exception {
IAnnotation annotation= annotatable.getAnnotation(name);
@@ -684,17 +684,17 @@
}
};
fGetAnnotationAction.setText("getAnnotation(String)...");
-
+
fCreateFromBindingKeyAction= new Action("Create From &Binding Key...") {
@Override public void run() {
Object selected= ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
final IJavaProject project= (IJavaProject) ((JavaElement) selected).getJavaElement();
-
+
InputDialog dialog= new InputDialog(getSite().getShell(), "IJavaProject#findElement(String bindingKey, WorkingCopyOwner owner)", "&bindingKey:", "", null);
if (dialog.open() != Window.OK)
return;
final String bindingKey= dialog.getValue();
-
+
class Runner implements IRunnableWithProgress {
IJavaElement element;
@Override
@@ -719,14 +719,14 @@
fViewer.setSelection(new StructuredSelection(element));
}
};
-
+
fResetAction= new Action("&Reset View", getJavaModelImageDescriptor()) {
@Override public void run() {
reset();
}
};
fResetAction.setToolTipText("Reset View to JavaModel");
-
+
fRefreshAction= new Action("Re&fresh", JEPluginImages.IMG_REFRESH) {
@Override public void run() {
BusyIndicator.showWhile(getSite().getShell().getDisplay(), new Runnable() {
@@ -739,9 +739,9 @@
};
fRefreshAction.setToolTipText("Refresh");
fRefreshAction.setActionDefinitionId("org.eclipse.ui.file.refresh");
-
+
fCopyAction= new TreeCopyAction(new Tree[] {fViewer.getTree()});
-
+
fPropertiesAction= new Action("&Properties", JEPluginImages.IMG_PROPERTIES) {
@Override
public void run() {
@@ -758,14 +758,14 @@
}
};
fPropertiesAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES);
-
+
fDoubleClickAction = new Action() {
private Object fPreviousDouble;
@Override public void run() {
ISelection selection = fViewer.getSelection();
Object obj = ((IStructuredSelection)selection).getFirstElement();
-
+
boolean isSecondDoubleClick= (obj == fPreviousDouble);
fPreviousDouble= isSecondDoubleClick ? null : obj;
@@ -775,7 +775,7 @@
switch (javaElement.getElementType()) {
case IJavaElement.JAVA_MODEL :
break;
-
+
case IJavaElement.JAVA_PROJECT :
case IJavaElement.PACKAGE_FRAGMENT_ROOT :
case IJavaElement.PACKAGE_FRAGMENT :
@@ -795,7 +795,7 @@
showAndLogError("Could not show element", e1);
}
break;
-
+
default :
try {
IEditorPart editorPart= JavaUI.openInEditor(javaElement);
@@ -814,11 +814,11 @@
}
}
}
-
+
} else if (obj instanceof Error) {
Error error= (Error) obj;
JEViewPlugin.log(error.getException());
-
+
} else if (obj instanceof JEMarker) {
JEMarker marker= (JEMarker) obj;
try {
@@ -829,7 +829,7 @@
}
}
};
-
+
fCompareAction= new Action() {
@Override public void run() {
TreePath[] selection= ((ITreeSelection) fViewer.getSelection()).getPaths();
@@ -839,16 +839,16 @@
boolean equals1= first != null && first.equals(second);
boolean equals2= second != null && second.equals(first);
boolean inconsistentEquals= equals1 != equals2;
-
+
String msg= "==: " + identical + "\nequals(..): " + (inconsistentEquals ? "INCONSISTENT" : equals1);
MessageDialog.openInformation(fViewer.getTree().getShell(), "Comparison", msg);
}
};
fCompareAction.setText("C&ompare with Each Other...");
-
+
fLogDeltasAction= new Action("Log Java element deltas", IAction.AS_CHECK_BOX) {
-
+
private IElementChangedListener fListener= new IElementChangedListener() {
@Override
@SuppressWarnings("deprecation")
@@ -871,7 +871,7 @@
JEViewPlugin.logMessage(event.getDelta().toString() + type);
}
};
-
+
@Override public void run() {
String message;
if (!isChecked()) {
@@ -884,10 +884,10 @@
MessageDialog.openInformation(fViewer.getTree().getShell(), "Log Java Element Deltas", message);
}
};
-
+
}
-
+
static IJavaElement[] codeResolve(IJavaElement input, ITextSelection selection) throws JavaModelException {
if (input instanceof ICodeAssist) {
if (input instanceof ICompilationUnit) {
@@ -899,7 +899,7 @@
}
return new IJavaElement[0];
}
-
+
static IJavaElement getElementAtOffset(IJavaElement input, ITextSelection selection) throws JavaModelException {
if (input instanceof ICompilationUnit) {
ICompilationUnit cunit= (ICompilationUnit) input;
@@ -918,18 +918,18 @@
}
return input;
}
-
+
/* see JavaModelUtil.reconcile((ICompilationUnit) input) */
static void reconcile(ICompilationUnit unit) throws JavaModelException {
synchronized(unit) {
unit.reconcile(
- ICompilationUnit.NO_AST,
- false /* don't force problem detection */,
- null /* use primary owner */,
+ ICompilationUnit.NO_AST,
+ false /* don't force problem detection */,
+ null /* use primary owner */,
null /* no progress monitor */);
}
}
-
+
private ImageDescriptor getJavaModelImageDescriptor() {
JavaElementLabelProvider lp= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_SMALL_ICONS);
Image modelImage= lp.getImage(getJavaModel());
@@ -946,18 +946,18 @@
}
});
}
-
+
void showAndLogError(String message, CoreException e) {
JEViewPlugin.log(message, e);
ErrorDialog.openError(getSite().getShell(), "JavaElement View", message, e.getStatus()); //$NON-NLS-1$
}
-
+
void showAndLogError(String message, Exception e) {
IStatus status= new Status(IStatus.ERROR, JEViewPlugin.getPluginId(), 0, message, e);
JEViewPlugin.log(status);
ErrorDialog.openError(getSite().getShell(), "JavaElement View", null, status); //$NON-NLS-1$
}
-
+
void showMessage(String message) {
MessageDialog.openInformation(
fViewer.getControl().getShell(),
@@ -997,7 +997,7 @@
}
}
}
-
+
Object input= context.getInput();
if (input instanceof IEditorInput) {
Object elementOfInput= getElementOfInput((IEditorInput)context.getInput());
@@ -1009,13 +1009,13 @@
return false;
}
-
+
Object getElementOfInput(IEditorInput input) {
Object adapted= input.getAdapter(IClassFile.class);
if (adapted != null) {
return adapted;
}
-
+
if (input instanceof IFileEditorInput) {
IFile file= ((IFileEditorInput)input).getFile();
IJavaElement javaElement= JavaCore.create(file);
@@ -1033,7 +1033,7 @@
}
return null;
}
-
+
@SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(Class<T> adapter) {
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Null.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Null.java
index 0fd0379..1fa320c 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Null.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/Null.java
@@ -22,7 +22,7 @@
private final JEAttribute fParent;
private final String fName;
-
+
public Null(JEAttribute parent, String name) {
Assert.isNotNull(parent);
Assert.isNotNull(name);
@@ -44,7 +44,7 @@
public Object getWrappedObject() {
return null;
}
-
+
@Override
public String getLabel() {
return fName + ": null";
@@ -57,7 +57,7 @@
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
-
+
Null other= (Null) obj;
if (! fParent.equals(other.fParent)) {
return false;
@@ -65,10 +65,10 @@
if (! fName.equals(other.fName)) {
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return fParent.hashCode() + fName.hashCode();
diff --git a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/TreeCopyAction.java b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/TreeCopyAction.java
index cc3f3f0..5091fdc 100644
--- a/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/TreeCopyAction.java
+++ b/org.eclipse.jdt.jeview/src/org/eclipse/jdt/jeview/views/TreeCopyAction.java
@@ -1,13 +1,13 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
*
- * This program and the accompanying materials
+ * This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -78,9 +78,9 @@
return string;
}
}
-
+
private final Tree[] fTrees;
-
+
public TreeCopyAction(Tree[] trees) {
fTrees= trees;
setText("&Copy"); //$NON-NLS-1$
@@ -102,11 +102,11 @@
}
if (tree == null)
return;
-
+
TreeItem[] selection= tree.getSelection();
if (selection.length == 0)
return;
-
+
Clipboard clipboard= null;
try {
clipboard= new Clipboard(tree.getDisplay());
@@ -125,7 +125,7 @@
HashMap<TreeItem, TreeObject> elementToTreeObj= new HashMap<>();
List<TreeObject> roots= new ArrayList<>();
int indent= Integer.MIN_VALUE;
-
+
for (TreeItem item : selection) {
TreeObject treeObj= elementToTreeObj.get(item);
if (treeObj == null) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java
index c7eb638..82bafed 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java
@@ -442,7 +442,7 @@
break;
}
}, Display.getDefault()::asyncExec);
-
+
CompletableFuture.runAsync(this::initializeJvmFields)
.thenAcceptAsync((VOID) -> {
if (fGroup.isDisposed()) {
@@ -457,11 +457,11 @@
notifyObservers();
}, Display.getDefault()::asyncExec);
}
-
-
+
+
private void initializeJvmFields () {
fDefaultJVMLabel= getDefaultJVMLabel();
-
+
fInstalledJVMs= getWorkspaceJREs();
Arrays.sort(fInstalledJVMs, new Comparator<IVMInstall>() {
@Override
@@ -1041,7 +1041,7 @@
setPageComplete(false);
return;
}
-
+
if (fJREGroup.fUseEEJRE.isSelected() && fJREGroup.fEECombo.getItems().length == 0) {
setPageComplete(false);
return;
@@ -1050,7 +1050,7 @@
setPageComplete(false);
return;
}
-
+
setPageComplete(true);
setErrorMessage(null);