Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2014-04-23 07:05:40 -0400
committerMarc Dumais2014-04-23 11:20:06 -0400
commit55afd48ec007c94c25ea2bd4871083b70e79b4a2 (patch)
treecd0940ebcfa78b926224d12cc2b3dca18f471f96 /visualizer
parent2e36f9b4caea938449c777d397c605c0ab8cbb6b (diff)
downloadorg.eclipse.cdt-55afd48ec007c94c25ea2bd4871083b70e79b4a2.tar.gz
org.eclipse.cdt-55afd48ec007c94c25ea2bd4871083b70e79b4a2.tar.xz
org.eclipse.cdt-55afd48ec007c94c25ea2bd4871083b70e79b4a2.zip
Turned-on API analysis for Visualizer and tweaked previous commits
that broke API stability. Change-Id: Idda130776b54f9e984b4179a32532413f2972f5d Reviewed-on: https://git.eclipse.org/r/25410 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Hudson CI
Diffstat (limited to 'visualizer')
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/.project6
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF2
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/pom.xml2
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java4
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicObject.java5
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/IGraphicObject.java10
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/ITooltipProvider.java28
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java9
8 files changed, 48 insertions, 18 deletions
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/.project b/visualizer/org.eclipse.cdt.visualizer.ui/.project
index a76968ea1d..e89059272a 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/.project
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF b/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF
index a8bc4639c8..3b1076dbf9 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.cdt.visualizer.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.cdt.visualizer.ui.plugin.CDTVisualizerUIPlugin
Bundle-Vendor: %provider.name
Require-Bundle: org.eclipse.ui,
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml b/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml
index 5db64fc031..90b91966a7 100644
--- a/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/pom.xml
@@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.visualizer.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java
index 20fc6c1058..a249b52d83 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicCanvas.java
@@ -53,8 +53,8 @@ public class GraphicCanvas extends BufferedCanvas
case SWT.MouseEnter:
case SWT.MouseMove:
IGraphicObject obj = getGraphicObject(event.x, event.y);
- if (obj != null) {
- String tooltip = obj.getTooltip(event.x, event.y);
+ if (obj instanceof ITooltipProvider) {
+ String tooltip = ((ITooltipProvider) obj).getTooltip(event.x, event.y);
setToolTipText(tooltip);
}
break;
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicObject.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicObject.java
index b62752e19e..bc00108b78 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicObject.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/GraphicObject.java
@@ -26,7 +26,7 @@ import org.eclipse.swt.graphics.Rectangle;
* Base class for objects that can be displayed and manipulated on a GraphicCanvas.
*/
public class GraphicObject
- implements IGraphicObject
+ implements IGraphicObject, ITooltipProvider
{
// --- members ---
@@ -277,6 +277,9 @@ public class GraphicObject
public void paintDecorations(GC gc) {
}
+ /**
+ * @since 1.1
+ */
@Override
public String getTooltip(int x, int y) {
return null;
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/IGraphicObject.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/IGraphicObject.java
index 953b1e63af..d6b624e169 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/IGraphicObject.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/IGraphicObject.java
@@ -7,7 +7,6 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation)
- * Xavier Raynaud (Kalray) - Bug 430804
*******************************************************************************/
package org.eclipse.cdt.visualizer.ui.canvas;
@@ -32,15 +31,6 @@ public interface IGraphicObject
* If decorations is true, paints optional "decorations" layer.
*/
public void paint(GC gc, boolean decorations);
-
- /**
- * Return the tooltip to display when mouse stays on this object.
- * It may return <code>null</code> if there is nothing to display.
- * @param x the x coordinate
- * @param y the y coordinate
- * @return the tooltip to display on this object.
- */
- public String getTooltip(int x, int y);
/** Returns true if object has decorations to paint. */
public boolean hasDecorations();
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/ITooltipProvider.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/ITooltipProvider.java
new file mode 100644
index 0000000000..27992b3d0b
--- /dev/null
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/ITooltipProvider.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson.
+ * 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:
+ * Marc Dumais (Ericsson) - initial API and implementation
+ * Xavier Raynaud (Kalray) - Bug 430804
+ *******************************************************************************/
+
+package org.eclipse.cdt.visualizer.ui.canvas;
+
+/**
+ * Interface that can be implemented by objects that want to provide tooltips.
+ * @since 1.1
+ */
+public interface ITooltipProvider {
+ /**
+ * Return the tooltip to display when mouse stays on this object.
+ * It may return <code>null</code> if there is nothing to display.
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the tooltip to display on this object.
+ */
+ public String getTooltip(int x, int y);
+}
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java
index 138ad4fd1f..b33c61dad2 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java
@@ -89,7 +89,8 @@ public class GUIUtils {
gc.drawText(text, x, y, SWT.DRAW_TRANSPARENT);
}
- /** Draws transparent text, with the default alignment (top/left). */
+ /** Draws transparent text, with the default alignment (top/left).
+ * @since 1.1*/
static public void drawText(GC gc, String text, Rectangle clip, int x, int y)
{
Rectangle oldClip = gc.getClipping();
@@ -112,7 +113,8 @@ public class GUIUtils {
}
}
- /** Draws transparent text, with the specified alignments. */
+ /** Draws transparent text, with the specified alignments.
+ * @since 1.1*/
static public void drawTextAligned(GC gc, String text, Rectangle clip, int x, int y, boolean left, boolean top)
{
Rectangle oldClip = gc.getClipping();
@@ -130,7 +132,8 @@ public class GUIUtils {
y - (int) Math.round(te.y / 2.0), SWT.DRAW_TRANSPARENT);
}
- /** Draws transparent text, centered on the specified point. */
+ /** Draws transparent text, centered on the specified point.
+ * @since 1.1*/
static public void drawTextCentered(GC gc, String text, Rectangle clip, int x, int y)
{
Rectangle oldClip = gc.getClipping();

Back to the top