X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.eclipse.ui.rap%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2Fspecific%2FEclipseUiSpecificUtils.java;h=a89b921cdf6a9012bd38107ed647f046d07644f2;hb=c53fec78daddb69c489686844188036b04e1615a;hp=63cf457a15021a58c05bb895036eba78b38199b8;hpb=04a1908a7a366d20d2db5b30832028eee85b5a91;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java b/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java index 63cf457a1..a89b921cd 100644 --- a/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java +++ b/org.argeo.eclipse.ui.rap/src/org/argeo/eclipse/ui/specific/EclipseUiSpecificUtils.java @@ -1,35 +1,37 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.argeo.eclipse.ui.specific; import org.eclipse.jface.viewers.AbstractTableViewer; +import org.eclipse.jface.viewers.ColumnViewer; import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.rap.rwt.RWT; +import org.eclipse.swt.widgets.Widget; /** Static utilities to bridge differences between RCP and RAP */ public class EclipseUiSpecificUtils { + public static void setStyleData(Widget widget, Object data) { + widget.setData(RWT.CUSTOM_VARIANT, data); + } + + public static Object getStyleData(Widget widget) { + return widget.getData(RWT.CUSTOM_VARIANT); + } + + public static void setMarkupData(Widget widget) { + widget.setData(RWT.MARKUP_ENABLED, true); + } + + public static void setMarkupValidationDisabledData(Widget widget) { + widget.setData("org.eclipse.rap.rwt.markupValidationDisabled", Boolean.TRUE); + } + /** * TootlTip support is supported only for {@link AbstractTableViewer} in RAP - * - * @see ColumnViewerToolTipSupport#enableFor(AbstractTableViewer) */ public static void enableToolTipSupport(Viewer viewer) { - if (viewer instanceof AbstractTableViewer) - ColumnViewerToolTipSupport.enableFor((AbstractTableViewer) viewer); + if (viewer instanceof ColumnViewer) + ColumnViewerToolTipSupport.enableFor((ColumnViewer) viewer); } private EclipseUiSpecificUtils() {