diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/contentprovider/TableContentProviderBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/contentprovider/TableContentProviderBase.java index 866b95dfa51ebe090bc7fd95f09043b610a1c1e4..80dff926bdaef2d26553875ca19c51213d79b5c4 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/contentprovider/TableContentProviderBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/contentprovider/TableContentProviderBase.java @@ -18,11 +18,8 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ package org.fortiss.tooling.base.ui.contentprovider; import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.EditingSupport; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.swt.SWT; @@ -74,27 +71,6 @@ public abstract class TableContentProviderBase implements return viewer; } - /** Creates a simple column. */ - public TableViewerColumn makeColumn(TableViewer viewer, int width, - String title, String tooltip, ColumnLabelProvider labelProvider) { - TableViewerColumn column = new TableViewerColumn(viewer, SWT.LEFT); - column.getColumn().setWidth(width); - column.getColumn().setText(title); - column.getColumn().setToolTipText(tooltip); - column.setLabelProvider(labelProvider); - return column; - } - - /** Creates a simple column with editing support. */ - public TableViewerColumn makeColumn(TableViewer viewer, int width, - String title, String tooltip, ColumnLabelProvider labelProvider, - EditingSupport editingSupport) { - TableViewerColumn column = makeColumn(viewer, width, title, tooltip, - labelProvider); - column.setEditingSupport(editingSupport); - return column; - } - /** {@inheritDoc} */ @Override public void dispose() { diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java index 6bc80a895038eba5bb87e34dc4ab63557a8d12c8..fb956cc97f6d7f185c0c23a71b0621a43dfa7ff7 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/TableViewerUtils.java @@ -18,6 +18,7 @@ $Id$ package org.fortiss.tooling.base.ui.utils; import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.EditingSupport; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.swt.SWT; @@ -28,7 +29,7 @@ import org.eclipse.swt.SWT; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: C0D33568CD83347695F9B10BB6883E7C + * @ConQAT.Rating YELLOW Hash: 0F5344CC790350F28E412502C6A79557 */ public class TableViewerUtils { @@ -47,13 +48,40 @@ public class TableViewerUtils { * the column's label provider * @return the configured viewer column */ - public static TableViewerColumn makeColumn(TableViewer viewer, int width, + public static TableViewerColumn createColumn(TableViewer viewer, int width, String title, String tooltip, ColumnLabelProvider labelProvider) { - final TableViewerColumn column = new TableViewerColumn(viewer, SWT.LEFT); + TableViewerColumn column = new TableViewerColumn(viewer, SWT.LEFT); column.getColumn().setWidth(width); column.getColumn().setText(title); column.getColumn().setToolTipText(tooltip); column.setLabelProvider(labelProvider); return column; } + + /** + * Creates a simple column in the table viewer with editing support. + * + * @param viewer + * the table viewer + * @param width + * the column width + * @param title + * the column title + * @param tooltip + * the column tool tip + * @param labelProvider + * the column's label provider + * @param editingSupport + * the column's editing support + * + * @return the configured viewer column + */ + public static TableViewerColumn createColumn(TableViewer viewer, int width, + String title, String tooltip, ColumnLabelProvider labelProvider, + EditingSupport editingSupport) { + TableViewerColumn column = createColumn(viewer, width, title, tooltip, + labelProvider); + column.setEditingSupport(editingSupport); + return column; + } }