aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Still2013-08-21 07:18:08 (EDT)
committerHendrik Still2013-09-06 13:36:50 (EDT)
commitd8990d167015d654965be9e5ec764a47d9d62fd1 (patch)
treec0a042d6bc0cdb676a819962c618be59febc2677
parent960779a9d66f3148d692c29e3206a09e731d6a24 (diff)
downloadeclipse.platform.ui-d8990d167015d654965be9e5ec764a47d9d62fd1.zip
eclipse.platform.ui-d8990d167015d654965be9e5ec764a47d9d62fd1.tar.gz
eclipse.platform.ui-d8990d167015d654965be9e5ec764a47d9d62fd1.tar.bz2
Bug 415561 - [Viewers] Add generics to the Table Label/Font/Colorrefs/changes/67/16267/1
Provider interfaces Added generic type parameters to ITableLabelProvider/ITableFontProvider/ITableColorProvider Change-Id: I1ef4e373aeeb7f633c733b566697f43e13996c3d Signed-off-by: Hendrik Still <hendrik.still@gammas.de>
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableColorProvider.java16
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableFontProvider.java12
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableLabelProvider.java18
3 files changed, 26 insertions, 20 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableColorProvider.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableColorProvider.java
index 1b0a6ae..f316163 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableColorProvider.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableColorProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 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
@@ -8,6 +8,7 @@
* Contributors:
* Initial implementation - Gunnar Ahlberg (IBS AB, www.ibs.net)
* IBM Corporation - further revisions
+ * Hendrik Still <hendrik.still@gammas.de> - bug 415561
*******************************************************************************/
package org.eclipse.jface.viewers;
@@ -17,29 +18,30 @@ import org.eclipse.swt.graphics.Color;
/**
* Interface to provide color representation for a given cell within
* the row for an element in a table.
+ * @param <E> Type of an single element of the model
* @since 3.1
*/
-public interface ITableColorProvider {
+public interface ITableColorProvider<E> {
/**
* Provides a foreground color for the given element.
- *
+ *
* @param element the element
* @param columnIndex the zero-based index of the column in which
* the color appears
* @return the foreground color for the element, or <code>null</code> to
* use the default foreground color
*/
- Color getForeground(Object element, int columnIndex);
+ Color getForeground(E element, int columnIndex);
/**
* Provides a background color for the given element at the specified index
- *
+ *
* @param element the element
* @param columnIndex the zero-based index of the column in which the color appears
* @return the background color for the element, or <code>null</code> to
* use the default background color
- *
+ *
*/
- Color getBackground(Object element, int columnIndex);
+ Color getBackground(E element, int columnIndex);
}
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableFontProvider.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableFontProvider.java
index 03cd53c..859a878 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableFontProvider.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableFontProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 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
@@ -7,18 +7,20 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Hendrik Still <hendrik.still@gammas.de> - bug 415561
*******************************************************************************/
package org.eclipse.jface.viewers;
import org.eclipse.swt.graphics.Font;
/**
- * The ITableFontProvider is a font provider that provides fonts to
+ * The ITableFontProvider is a font provider that provides fonts to
* individual cells within tables.
+ * @param <E> Type of an single element of the model
* @since 3.1
*/
-public interface ITableFontProvider {
-
+public interface ITableFontProvider<E> {
+
/**
* Provides a font for the given element at index
* columnIndex.
@@ -26,6 +28,6 @@ public interface ITableFontProvider {
* @param columnIndex The index of the column being displayed
* @return Font
*/
- public Font getFont(Object element, int columnIndex);
+ public Font getFont(E element, int columnIndex);
}
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableLabelProvider.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableLabelProvider.java
index a38d722..f2384b5 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableLabelProvider.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ITableLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Hendrik Still <hendrik.still@gammas.de> - bug 415561
*******************************************************************************/
package org.eclipse.jface.viewers;
@@ -14,24 +15,25 @@ import org.eclipse.swt.graphics.Image;
/**
* Extends <code>IBaseLabelProvider</code> with the methods
- * to provide the text and/or image for each column of a given element.
+ * to provide the text and/or image for each column of a given element.
* Used by table viewers.
+ * @param <E> Type of an single element of the model
*
* @see TableViewer
*/
-public interface ITableLabelProvider extends IBaseLabelProvider {
+public interface ITableLabelProvider<E> extends IBaseLabelProvider<E> {
/**
* Returns the label image for the given column of the given element.
*
- * @param element the object representing the entire row, or
+ * @param element the object representing the entire row, or
* <code>null</code> indicating that no input object is set
* in the viewer
* @param columnIndex the zero-based index of the column in which
* the label appears
- * @return Image or <code>null</code> if there is no image for the
+ * @return Image or <code>null</code> if there is no image for the
* given object at columnIndex
*/
- public Image getColumnImage(Object element, int columnIndex);
+ public Image getColumnImage(E element, int columnIndex);
/**
* Returns the label text for the given column of the given element.
@@ -40,8 +42,8 @@ public interface ITableLabelProvider extends IBaseLabelProvider {
* <code>null</code> indicating that no input object is set
* in the viewer
* @param columnIndex the zero-based index of the column in which the label appears
- * @return String or or <code>null</code> if there is no text for the
+ * @return String or or <code>null</code> if there is no text for the
* given object at columnIndex
*/
- public String getColumnText(Object element, int columnIndex);
+ public String getColumnText(E element, int columnIndex);
}