]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/ILabelProvider.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / gallery / ILabelProvider.java
diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/ILabelProvider.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/ILabelProvider.java
new file mode 100644 (file)
index 0000000..7829a3b
--- /dev/null
@@ -0,0 +1,95 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.g2d.gallery;\r
+\r
+import org.eclipse.jface.viewers.IBaseLabelProvider;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Color;\r
+import org.simantics.g2d.image.Image;\r
+\r
+public interface ILabelProvider extends IBaseLabelProvider {\r
+    /**\r
+     * Returns the image for the label of the given element.  The image\r
+     * is owned by the label provider and must not be disposed directly.\r
+     * Instead, dispose the label provider when no longer needed.\r
+     *\r
+     * @param element the element for which to provide the label image\r
+     * @return the image used to label the element, or <code>null</code>\r
+     *   if there is no image for the given object\r
+     */\r
+    public Image getImage(Object element);\r
+\r
+    /**\r
+     * Returns the text for the label of the given element.\r
+     *\r
+     * @param element the element for which to provide the label text\r
+     * @return the text string used to label the element, or <code>null</code>\r
+     *   if there is no text label for the given object\r
+     */\r
+    public String getText(Object element);\r
+    \r
+    /**\r
+        * Get the image displayed in the tool tip for object.\r
+        * \r
+        * <p>\r
+        * <b>If {@link #getToolTipText(Object)} and\r
+        * {@link #getToolTipImage(Object)} both return <code>null</code> the\r
+        * control is set back to standard behavior</b>\r
+        * </p>\r
+        * \r
+        * @param object\r
+        *            the element for which the tool tip is shown\r
+        * @return {@link Image} or <code>null</code> if there is not image.\r
+        */\r
+\r
+       public java.awt.Image getToolTipImage(Object object);\r
+       \r
+       /**\r
+        * Get the text displayed in the tool tip for object.\r
+        * \r
+        * <p>\r
+        * <b>If {@link #getToolTipText(Object)} and\r
+        * {@link #getToolTipImage(Object)} both return <code>null</code> the\r
+        * control is set back to standard behavior</b>\r
+        * </p>\r
+        * \r
+        * @param element\r
+        *            the element for which the tool tip is shown\r
+        * @return the {@link String} or <code>null</code> if there is not text to\r
+        *         display\r
+        */\r
+       public String getToolTipText(Object element);\r
+       \r
+       /**\r
+        * Return the background color used for the tool tip\r
+        * \r
+        * @param object\r
+        *            the {@link Object} for which the tool tip is shown\r
+        * \r
+        * @return the {@link Color} used or <code>null</code> if you want to use\r
+        *         the default color {@link SWT#COLOR_INFO_BACKGROUND}\r
+        * @see SWT#COLOR_INFO_BACKGROUND\r
+        */\r
+       public Color getToolTipBackgroundColor(Object object);\r
+       \r
+       /**\r
+        * The foreground color used to display the the text in the tool tip\r
+        * \r
+        * @param object\r
+        *            the {@link Object} for which the tool tip is shown\r
+        * @return the {@link Color} used or <code>null</code> if you want to use\r
+        *         the default color {@link SWT#COLOR_INFO_FOREGROUND}\r
+        * @see SWT#COLOR_INFO_FOREGROUND\r
+        */\r
+       public Color getToolTipForegroundColor(Object object);\r
+\r
+}\r