Additional implementation for Bug 314610 - Produce warning when two roles capture the same method at the same time
- add markers to binary types and support those markers in the UI
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml b/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml
index d1bfb26..0a0d968 100644
--- a/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml
@@ -170,6 +170,18 @@
icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
</team>
</aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.ui.ide">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.MarkerViewAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
</extension>
<extension
point="org.eclipse.ui.decorators">
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/MarkerViewAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/MarkerViewAdaptor.java
new file mode 100644
index 0000000..37c495e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/MarkerViewAdaptor.java
@@ -0,0 +1,66 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2011 GK Software AG
+ *
+ * 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
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import org.eclipse.core.internal.resources.WorkspaceRoot;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
+import org.eclipse.objectteams.otdt.core.ext.IMarkableJavaElement;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+
+import base org.eclipse.ui.internal.views.markers.ExtendedMarkersView;
+
+@SuppressWarnings("restriction")
+public team class MarkerViewAdaptor {
+
+ /**
+ * Name of the handle id attribute in a Java marker.
+ * Copy of protected constant from JavaCore.
+ */
+ static final String ATT_HANDLE_ID =
+ "org.eclipse.jdt.internal.core.JavaModelManager.handleId" ; //$NON-NLS-1$
+
+ protected class MarkersView playedBy ExtendedMarkersView {
+
+ void openMarkerInEditor(IMarker marker, IWorkbenchPage page)
+ <- after void openMarkerInEditor(IMarker marker, IWorkbenchPage page)
+ base when (marker.getResource() instanceof WorkspaceRoot);
+
+ private static void openMarkerInEditor(IMarker marker, IWorkbenchPage page) {
+ String handleIdentifier = marker.getAttribute(ATT_HANDLE_ID, null);
+ if (handleIdentifier != null) {
+ IJavaElement target = JavaCore.create(handleIdentifier);
+ try {
+ IEditorPart part = EditorUtility.openInEditor(target);
+ // do we have a detail identifier to position the editor?
+ String detailIdentifier = marker.getAttribute(IMarkableJavaElement.ATT_DETAIL_ID, null);
+ if (detailIdentifier != null) {
+ IJavaElement detail = JavaCore.create(detailIdentifier);
+ if (detail.exists())
+ EditorUtility.revealInEditor(part, detail);
+ }
+ } catch (PartInitException ex) {
+ OTDTUIPlugin.logException("Problems initializing editor", ex); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+}