]> git.argeo.org Git - lgpl/argeo-commons.git/blob - rcp/org.argeo.swt.specific.rcp/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java
Asynchronous UUID factory.
[lgpl/argeo-commons.git] / rcp / org.argeo.swt.specific.rcp / src / org / argeo / eclipse / ui / specific / EclipseUiSpecificUtils.java
1 package org.argeo.eclipse.ui.specific;
2
3 import org.eclipse.jface.viewers.ColumnViewer;
4 import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
5 import org.eclipse.jface.viewers.Viewer;
6 import org.eclipse.swt.widgets.Widget;
7
8 /** Static utilities to bridge differences between RCP and RAP */
9 public class EclipseUiSpecificUtils {
10 private final static String CSS_CLASS = "org.eclipse.e4.ui.css.CssClassName";
11
12 public static void setStyleData(Widget widget, Object data) {
13 widget.setData(CSS_CLASS, data);
14 }
15
16 public static Object getStyleData(Widget widget) {
17 return widget.getData(CSS_CLASS);
18 }
19
20 public static void setMarkupData(Widget widget) {
21 // does nothing
22 }
23
24 public static void setMarkupValidationDisabledData(Widget widget) {
25 // does nothing
26 }
27
28 /**
29 * TootlTip support is supported for {@link ColumnViewer} in RCP
30 *
31 * @see ColumnViewerToolTipSupport#enableFor(Viewer)
32 */
33 public static void enableToolTipSupport(Viewer viewer) {
34 if (viewer instanceof ColumnViewer)
35 ColumnViewerToolTipSupport.enableFor((ColumnViewer) viewer);
36 }
37
38 private EclipseUiSpecificUtils() {
39 }
40 }