Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 252338 Details for
Bug 56062
[source lookup] Duplicate source lookup should indicate full location of duplicate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
JDT SourceElementLabelProvider Adapter
Bug 56062 JDT SourceElementLabelProvider.patch (text/plain), 5.85 KB, created by
Sarika Sinha
on 2015-04-13 08:48:30 EDT
(
hide
)
Description:
JDT SourceElementLabelProvider Adapter
Filename:
MIME Type:
Creator:
Sarika Sinha
Created:
2015-04-13 08:48:30 EDT
Size:
5.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.debug.ui >diff --git plugin.xml plugin.xml >index 8e0b12a..f755402 100644 >--- plugin.xml >+++ plugin.xml >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <?eclipse version="3.0"?> > <!-- >- Copyright (c) 2005, 2014 IBM Corporation and others. >+ Copyright (c) 2005, 2015 IBM Corporation and others. > All rights reserved. This program and the accompanying materials > are made available under the terms of the Eclipse Public License v1.0 > which accompanies this distribution, and is available at >@@ -3216,6 +3216,11 @@ > adaptableType="org.eclipse.jdt.launching.sourcelookup.containers.ClasspathContainerSourceContainer"> > <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/> > </factory> >+ <factory >+ class="org.eclipse.jdt.internal.debug.ui.sourcelookup.SourceElementLabelProviderAdapterFactory" >+ adaptableType="org.eclipse.jdt.core.IJavaElement"> >+ <adapter type="org.eclipse.debug.internal.ui.sourcelookup.SourceElementLabelProvider"/> >+ </factory> > > <!-- Adapters for runtime classpath entries --> > <factory >diff --git ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaDebugSourceElementLabelProviderAdapter.java ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaDebugSourceElementLabelProviderAdapter.java >new file mode 100644 >index 0000000..b23f0fd >--- /dev/null >+++ ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaDebugSourceElementLabelProviderAdapter.java >@@ -0,0 +1,68 @@ >+/******************************************************************************* >+ * Copyright (c) 2015 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.jdt.internal.debug.ui.sourcelookup; >+ >+import org.eclipse.debug.internal.ui.sourcelookup.SourceElementLabelProvider; >+import org.eclipse.jdt.core.IJavaElement; >+import org.eclipse.jdt.internal.ui.JavaPlugin; >+import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; >+import org.eclipse.jdt.ui.JavaElementLabels; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.swt.graphics.Image; >+ >+/** >+ * Class provides the Duplicate JavaElement labels and Images for SourceElementLabelProvider Objects while debugging >+ */ >+@SuppressWarnings("restriction") >+public class JavaDebugSourceElementLabelProviderAdapter extends SourceElementLabelProvider { >+ private JavaElementImageProvider fImageProvider; >+ >+ public JavaDebugSourceElementLabelProviderAdapter() { >+ fImageProvider = new JavaElementImageProvider(); >+ } >+ /* >+ * Append Root path to identify full path for duplicate Java elements in source lookup dialog >+ */ >+ @Override >+ public String getText(Object element) { >+ return JavaElementLabels.getTextLabel(getJavaElement(element), JavaElementLabels.ALL_DEFAULT | JavaElementLabels.APPEND_ROOT_PATH); >+ } >+ >+ private IJavaElement getJavaElement(Object element) { >+ if (element instanceof IJavaElement) { >+ return (IJavaElement) element; >+ } >+ return null; >+ } >+ >+ @Override >+ public Image getImage(Object element) { >+ ImageDescriptor descriptor = getImageDescriptor(element); >+ if (descriptor == null) { >+ return null; >+ } >+ >+ >+ return JavaPlugin.getImageDescriptorRegistry().get(descriptor); >+ } >+ >+ public ImageDescriptor getImageDescriptor(Object element) { >+ IJavaElement je = getJavaElement(element); >+ if (je != null) { >+ return fImageProvider.getJavaImageDescriptor(je, JavaElementImageProvider.OVERLAY_ICONS | JavaElementImageProvider.SMALL_ICONS); >+ } >+ >+ return null; >+ >+ } >+ >+} >diff --git ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/SourceElementLabelProviderAdapterFactory.java ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/SourceElementLabelProviderAdapterFactory.java >new file mode 100644 >index 0000000..1de03ca >--- /dev/null >+++ ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/SourceElementLabelProviderAdapterFactory.java >@@ -0,0 +1,41 @@ >+/******************************************************************************* >+ * Copyright (c) 2015 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.debug.ui.sourcelookup; >+ >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.jdt.core.IJavaElement; >+ >+/** >+ * Adapter factory for duplicate source lookup elements. >+ * >+ * @since 3.7 >+ */ >+public class SourceElementLabelProviderAdapterFactory implements IAdapterFactory { >+ /* (non-Javadoc) >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) >+ */ >+ @Override >+ @SuppressWarnings({ "unchecked", "restriction" }) >+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { >+ if (adapterType.equals(org.eclipse.debug.internal.ui.sourcelookup.SourceElementLabelProvider.class) >+ && adaptableObject instanceof IJavaElement) { >+ return (T) new JavaDebugSourceElementLabelProviderAdapter(); >+ } >+ return null; >+ } >+ /* (non-Javadoc) >+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() >+ */ >+ @Override >+ public Class<?>[] getAdapterList() { >+ return new Class[] { org.eclipse.debug.internal.ui.sourcelookup.SourceElementLabelProvider.class }; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 56062
:
249815
|
249920
|
252111
|
252112
| 252338 |
252343