summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Becker2011-01-20 11:15:08 (EST)
committerJuergen Becker2011-01-20 11:15:08 (EST)
commit2be49bc79eb77738c9fc7c547817247e2efc377c (patch)
tree8a7bb4c66127a03b1a41ff490261611eb616afc2
parentabb32ffccfc6af280e3afbda47be09253bb8ead0 (diff)
downloadorg.eclipse.riena.rap-2be49bc79eb77738c9fc7c547817247e2efc377c.zip
org.eclipse.riena.rap-2be49bc79eb77738c9fc7c547817247e2efc377c.tar.gz
org.eclipse.riena.rap-2be49bc79eb77738c9fc7c547817247e2efc377c.tar.bz2
added new RAP LnF and Theme
added new MarkerSUpport for RAP (currently not active)
-rw-r--r--org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF5
-rw-r--r--org.eclipse.riena.ui.swt.rap/build.properties4
-rw-r--r--org.eclipse.riena.ui.swt.rap/plugin.xml22
-rw-r--r--org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPLnf.java42
-rw-r--r--org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPMarkerSupport.java80
-rw-r--r--org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPTheme.java42
-rw-r--r--org.eclipse.riena.ui.swt.rap/theme1/ror-extensions.css10
7 files changed, 202 insertions, 3 deletions
diff --git a/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF b/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF
index 0ee6fe3..b050a2e 100644
--- a/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF
+++ b/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF
@@ -1,14 +1,15 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Riena SWT Plug-in - RAP Fragment
-Bundle-SymbolicName: org.eclipse.riena.ui.swt.rap
+Bundle-SymbolicName: org.eclipse.riena.ui.swt.rap;singleton:=true
Bundle-Version: 3.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.riena.core,
org.eclipse.riena.ui.core,
org.eclipse.riena.ui.common,
org.eclipse.riena.ui.ridgets,
- org.eclipse.riena.ui.swt,
+ org.eclipse.riena.ui.ridgets.swt,
+ org.eclipse.riena.ui.swt,
org.eclipse.riena.navigation.ui.swt,
org.eclipse.rap.rwt;resolution:=optional;visibility:=reexport,
org.eclipse.rap.ui.workbench;resolution:=optional;visibility:=reexport
diff --git a/org.eclipse.riena.ui.swt.rap/build.properties b/org.eclipse.riena.ui.swt.rap/build.properties
index 9cbab3c..e129c00 100644
--- a/org.eclipse.riena.ui.swt.rap/build.properties
+++ b/org.eclipse.riena.ui.swt.rap/build.properties
@@ -2,5 +2,7 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- about.html
+ about.html,\
+ theme1/,\
+ plugin.xml
src.includes = about.html
diff --git a/org.eclipse.riena.ui.swt.rap/plugin.xml b/org.eclipse.riena.ui.swt.rap/plugin.xml
new file mode 100644
index 0000000..0328ff3
--- /dev/null
+++ b/org.eclipse.riena.ui.swt.rap/plugin.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.riena.ui.swt.defaultLnf">
+ <lnf class="org.eclipse.riena.ui.swt.lnf.rap.RAPLnf" />
+ </extension>
+ <extension
+ point="org.eclipse.riena.ui.swt.lnfMarkerSupport">
+ <markerSupport
+ class="org.eclipse.riena.ui.swt.lnf.rap.RAPMarkerSupport"
+ id="rapMarkerSupport">
+ </markerSupport>
+ </extension>
+ <extension
+ point="org.eclipse.rap.ui.themes">
+ <themeContribution
+ themeId="org.eclipse.rap.rwt.theme.Default"
+ file="theme1/ror-extensions.css" />
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPLnf.java b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPLnf.java
new file mode 100644
index 0000000..6cdb0c1
--- /dev/null
+++ b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPLnf.java
@@ -0,0 +1,42 @@
+package org.eclipse.riena.ui.swt.lnf.rap;
+
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 compeople AG 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+
+import org.eclipse.riena.ui.swt.lnf.rienadefault.RienaDefaultLnf;
+
+/**
+ * Look and Feel (Lnf) Riena on RAP applications.<br>
+ * The Lnf uses its own theme.
+ */
+public class RAPLnf extends RienaDefaultLnf {
+
+ /**
+ * ID of this Look and Feel
+ */
+ public final static String LNF_ID = "RAPLnf"; //$NON-NLS-1$
+
+ /**
+ * Creates a new instance of {@code ExampleLnf}
+ */
+ public RAPLnf() {
+ super(new RAPTheme());
+ }
+
+ /**
+ * @see org.eclipse.riena.ui.swt.lnf.rienadefault.RienaDefaultLnf#getLnfId()
+ */
+ @Override
+ protected String getLnfId() {
+ return LNF_ID;
+ }
+
+}
diff --git a/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPMarkerSupport.java b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPMarkerSupport.java
new file mode 100644
index 0000000..beb5cea
--- /dev/null
+++ b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPMarkerSupport.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 compeople AG 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.ui.swt.lnf.rap;
+
+import org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler;
+import org.eclipse.rwt.lifecycle.WidgetUtil;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+import org.eclipse.riena.core.util.Nop;
+import org.eclipse.riena.ui.ridgets.IControlDecoration;
+import org.eclipse.riena.ui.ridgets.swt.MarkerSupport;
+
+/**
+ * Helper class for SWT Ridgets under RAP to delegate their marker issues to.
+ * The markers are visiualised throu CSS.
+ */
+public class RAPMarkerSupport extends MarkerSupport {
+ private static final long FLASH_DURATION_MS = 300;
+ private boolean isFlashInProgress = false;
+ private IControlDecoration errorDecoration;
+
+ @Override
+ protected void addError(final Control control) {
+ control.setData(WidgetUtil.CUSTOM_VARIANT, "Emo"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void clearError(final Control control) {
+ control.setData(WidgetUtil.CUSTOM_VARIANT, null);
+ }
+
+ @Override
+ public synchronized void flash() {
+ final Control control = getUIControl();
+ final String ridgetID = getRidget().getID();
+ if (!isFlashInProgress && control != null) {
+ isFlashInProgress = true;
+
+ UICallBackServiceHandler.activateUICallBacksFor(ridgetID);
+
+ if (errorDecoration == null) {
+ errorDecoration = createErrorDecoration(control);
+ }
+
+ errorDecoration.show();
+
+ final Display display = control.getDisplay();
+ final Runnable op = new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(FLASH_DURATION_MS);
+ } catch (final InterruptedException e) {
+ Nop.reason("ignore"); //$NON-NLS-1$
+ } finally {
+ display.syncExec(new Runnable() {
+ public void run() {
+ if (!control.isDisposed()) {
+ errorDecoration.hide();
+ }
+ UICallBackServiceHandler.deactivateUICallBacksFor(ridgetID);
+ }
+ });
+ isFlashInProgress = false;
+ }
+ }
+ };
+
+ new Thread(op).start();
+ }
+ }
+}
diff --git a/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPTheme.java b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPTheme.java
new file mode 100644
index 0000000..8698997
--- /dev/null
+++ b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/lnf/rap/RAPTheme.java
@@ -0,0 +1,42 @@
+package org.eclipse.riena.ui.swt.lnf.rap;
+
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 compeople AG 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+
+import org.eclipse.riena.ui.swt.lnf.ILnfCustomizer;
+import org.eclipse.riena.ui.swt.lnf.LnfKeyConstants;
+import org.eclipse.riena.ui.swt.lnf.rienadefault.RienaDefaultTheme;
+
+/**
+ * Webtheme for Riena on RAP
+ */
+public class RAPTheme extends RienaDefaultTheme {
+
+ @Override
+ public void customizeLnf(final ILnfCustomizer lnf) {
+ super.customizeLnf(lnf);
+ customizeSettings(lnf);
+ }
+
+ private void customizeSettings(final ILnfCustomizer lnf) {
+ //lnf.putLnfSetting(LnfKeyConstants.MARKER_SUPPORT_ID, "rapMarkerSupport"); //$NON-NLS-1$
+ lnf.putLnfSetting(LnfKeyConstants.MARKER_SUPPORT_ID, "borderMarkerSupport"); //$NON-NLS-1$
+ lnf.putLnfSetting(LnfKeyConstants.INFO_FLYOUT_PAUSE_ANIMATION_TIME, 0);
+ lnf.putLnfSetting(LnfKeyConstants.INFO_FLYOUT_SHOW_AND_HIDE_ANIMATION_TIME, 10);
+ lnf.putLnfSetting(LnfKeyConstants.INFO_FLYOUT_WAIT_ANIMATION_TIME, 10);
+
+ }
+
+ @Override
+ protected boolean hideOsBorder() {
+ return true;
+ }
+}
diff --git a/org.eclipse.riena.ui.swt.rap/theme1/ror-extensions.css b/org.eclipse.riena.ui.swt.rap/theme1/ror-extensions.css
new file mode 100644
index 0000000..fc6edae
--- /dev/null
+++ b/org.eclipse.riena.ui.swt.rap/theme1/ror-extensions.css
@@ -0,0 +1,10 @@
+/* Riena on RAP marker styles */
+
+Combo, CCombo {
+ background-color: rgb(231, 233, 0);
+}
+
+/* Error Marker */
+Button.Emo, Combo.Emo, CCombo.Emo, Composite.Emo, DateTime.Emo, List.Emo, Table.Emo, Text.Emo, Tree.Emo {
+ border: 2px solid red;
+} \ No newline at end of file