Introduce disabling of markup validation.
[lgpl/argeo-commons.git] / org.argeo.eclipse.ui.rap / src / org / argeo / eclipse / ui / specific / EclipseUiSpecificUtils.java
index 63cf457a15021a58c05bb895036eba78b38199b8..a89b921cdf6a9012bd38107ed647f046d07644f2 100644 (file)
@@ -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() {