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 249920 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]
Debug WorkbenchAdapter to append rootpath to labels
Bug 56062 - [source lookup] Duplicate source lookup should indicate full location of duplicate with own Adapter.patch (text/plain), 5.31 KB, created by
Sarika Sinha
on 2015-01-14 03:35:16 EST
(
hide
)
Description:
Debug WorkbenchAdapter to append rootpath to labels
Filename:
MIME Type:
Creator:
Sarika Sinha
Created:
2015-01-14 03:35:16 EST
Size:
5.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.debug.ui >diff --git plugin.xml plugin.xml >index 8e0b12a..58425fb 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.WorkbenchAdapterFactory" >+ adaptableType="org.eclipse.jdt.core.IJavaElement"> >+ <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/> >+ </factory> > > <!-- Adapters for runtime classpath entries --> > <factory >diff --git ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaDebugWorkbenchAdapter.java ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaDebugWorkbenchAdapter.java >new file mode 100644 >index 0000000..42732dd >--- /dev/null >+++ ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/JavaDebugWorkbenchAdapter.java >@@ -0,0 +1,75 @@ >+/******************************************************************************* >+ * 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.jdt.core.IJavaElement; >+import org.eclipse.jdt.core.IParent; >+import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; >+import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; >+import org.eclipse.jdt.ui.JavaElementLabels; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.ui.model.IWorkbenchAdapter; >+ >+/** >+ * Class provides the JavaElement labels for WorkbenchAdapater Objects while debugging >+ */ >+public class JavaDebugWorkbenchAdapter implements IWorkbenchAdapter { >+ private JavaElementImageProvider fImageProvider; >+ >+ public JavaDebugWorkbenchAdapter() { >+ fImageProvider = new JavaElementImageProvider(); >+ } >+ >+ /* >+ * Append Root path to identify full path for duplicate Java elements in source lookup dialog >+ */ >+ >+ public String getLabel(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; >+ } >+ >+ public Object[] getChildren(Object element) { >+ IJavaElement je = getJavaElement(element); >+ if (je instanceof IParent) { >+ try { >+ return ((IParent) je).getChildren(); >+ } >+ catch (JavaModelException e) { >+ JDIDebugUIPlugin.log(e); >+ } >+ } >+ return new Object[0]; >+ } >+ >+ public ImageDescriptor getImageDescriptor(Object element) { >+ IJavaElement je = getJavaElement(element); >+ if (je != null) { >+ return fImageProvider.getJavaImageDescriptor(je, JavaElementImageProvider.OVERLAY_ICONS | JavaElementImageProvider.SMALL_ICONS); >+ } >+ >+ return null; >+ >+ } >+ >+ public Object getParent(Object element) { >+ IJavaElement je = getJavaElement(element); >+ return je != null ? je.getParent() : null; >+ } >+} >diff --git ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/WorkbenchAdapterFactory.java ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/WorkbenchAdapterFactory.java >index c92dce1..18bdeba 100644 >--- ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/WorkbenchAdapterFactory.java >+++ ui/org/eclipse/jdt/internal/debug/ui/sourcelookup/WorkbenchAdapterFactory.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 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 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.internal.debug.ui.sourcelookup; > > import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.ui.model.IWorkbenchAdapter; > > /** >@@ -22,6 +23,9 @@ > * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) > */ > public Object getAdapter(Object adaptableObject, Class adapterType) { >+ if (adaptableObject instanceof IJavaElement && adapterType.equals(IWorkbenchAdapter.class)) { >+ return new JavaDebugWorkbenchAdapter(); >+ } > if (adapterType.equals(IWorkbenchAdapter.class)) { > return new WorkbenchAdapter(); > }
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