Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElshad Seyidmammadov2016-04-06 03:41:39 -0400
committerGerrit Code Review @ Eclipse.org2016-04-06 08:24:36 -0400
commita328acd1afcd4f281a5b06962b22089c6e83683e (patch)
treece41c56ea42b915a39e9fba884555927f7d2e7ba /bundles
parentce92416c419b14df40b7a288e51d82208596cae5 (diff)
downloadorg.eclipse.rap-a328acd1afcd4f281a5b06962b22089c6e83683e.tar.gz
org.eclipse.rap-a328acd1afcd4f281a5b06962b22089c6e83683e.tar.xz
org.eclipse.rap-a328acd1afcd4f281a5b06962b22089c6e83683e.zip
Make the ErrorBox themeable
Add new CSS elements ErrorBox and ErrorBox-Titlebar. Make font, color and background color titlebar properties themeable. Make error box border themeable. 342140: Customizable error message box https://bugs.eclipse.org/bugs/show_bug.cgi?id=342140 Change-Id: I0a0d73f8181421fdaed79fba71c0bc41e7705c4c Signed-off-by: Elshad Seyidmammadov <elshad@eclipsesource.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/runtime/ErrorHandler.js16
-rw-r--r--bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css12
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.default.css12
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.theme.xml63
4 files changed, 95 insertions, 8 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/runtime/ErrorHandler.js b/bundles/org.eclipse.rap.rwt/js/rwt/runtime/ErrorHandler.js
index 6963f4e5d8..2a69bd2881 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/runtime/ErrorHandler.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/runtime/ErrorHandler.js
@@ -69,8 +69,10 @@ rwt.qx.Class.define( "rwt.runtime.ErrorHandler", {
}
this._overlay = this._createOverlay();
this._box = this._createErrorBoxArea( 450, 150 );
+ var themeStore = rwt.theme.ThemeStore.getInstance();
+ var border = themeStore.getBorder( "ErrorBox", {}, "border" );
+ border.renderElement( this._box );
this._box.style.padding = "0px";
- this._box.style.border = "1px solid #3B5998";
this._box.style.overflow = "hidden";
var errorBoxData = this._getErrorBoxData( errorType );
this._title = this._createErrorBoxTitleArea( this._box );
@@ -221,6 +223,11 @@ rwt.qx.Class.define( "rwt.runtime.ErrorHandler", {
_createErrorBoxTitleArea : function( parentElement ) {
var element = document.createElement( "div" );
+ var themeStore = rwt.theme.ThemeStore.getInstance();
+ var cssElement = "ErrorBox-Titlebar";
+ var color = themeStore.getColor( cssElement, {}, "color" );
+ var font = themeStore.getFont( cssElement, {}, "font" );
+ var backgroundColor = themeStore.getColor( cssElement, {}, "background-color" );
var style = element.style;
style.position = "absolute";
style.left = "0px";
@@ -229,10 +236,9 @@ rwt.qx.Class.define( "rwt.runtime.ErrorHandler", {
style.height = "40px";
style.padding = "10px";
style.textAlign = "left";
- style.backgroundColor = "#406796";
- style.color = "white";
- style.fontSize = "14px";
- style.fontWeight = "bold";
+ style.color = color;
+ style.font = font.toCss();
+ style.backgroundColor = backgroundColor;
parentElement.appendChild( element );
return element;
},
diff --git a/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css b/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
index 81d2228e79..49142c3f47 100644
--- a/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
+++ b/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2015 EclipseSource and others.
+ * Copyright (c) 2012, 2016 EclipseSource 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
@@ -90,6 +90,16 @@ SystemMessage-DisplayOverlay {
background-image: url( resource/widget/rap/display/loading.gif );
}
+ErrorBox-Titlebar {
+ font: bold 14px Verdana, "Lucida Sans", Arial, Helvetica, sans-serif;
+ color: white;
+ background-color: #406796;
+}
+
+ErrorBox {
+ border: 1px solid #3B5998;
+}
+
/* Default theme for all controls */
* {
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.default.css b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.default.css
index 3e0cd223ff..71940b8f54 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.default.css
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.default.css
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2014 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2008, 2016 Innoopract Informationssysteme GmbH 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
@@ -74,3 +74,13 @@ SystemMessage-DisplayOverlay {
background-color: transparent;
background-image: none;
}
+
+ErrorBox-Titlebar {
+ font: bold 14px Verdana, "Lucida Sans", Arial, Helvetica, sans-serif;
+ color: white;
+ background-color: #406796;
+}
+
+ErrorBox {
+ border: 1px solid #3B5998;
+}
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.theme.xml b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.theme.xml
index 35c3d45a58..e11931c9dc 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.theme.xml
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/widgets/widgetkit/Widget.theme.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
- Copyright (c) 2008, 2014 Innoopract Informationssysteme GmbH.
+ Copyright (c) 2008, 2016 Innoopract Informationssysteme GmbH.
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
@@ -283,5 +283,66 @@
</element>
+ <element name="ErrorBox-Titlebar">
+
+ <property name="font">
+ <description>
+ Text font of the title.
+ </description>
+ </property>
+
+ <property name="color">
+ <description>
+ Text color of the title.
+ </description>
+ </property>
+
+ <property name="background-color">
+ <description>
+ Background color of the title bar.
+ </description>
+ </property>
+
+ </element>
+
+ <element name="ErrorBox">
+
+ <property name="border" shorthand="true">
+ <description>
+ The border of the ErrorBox.
+ </description>
+ </property>
+
+ <property name="border-top">
+ <description>
+ The top side border of the ErrorBox.
+ </description>
+ </property>
+
+ <property name="border-right">
+ <description>
+ The right side border of the ErrorBox.
+ </description>
+ </property>
+
+ <property name="border-bottom">
+ <description>
+ The bottom side border of the ErrorBox.
+ </description>
+ </property>
+
+ <property name="border-left">
+ <description>
+ The left side border of the ErrorBox.
+ </description>
+ </property>
+
+ <property name="border-radius">
+ <description>
+ Border radius of the ErrorBox.
+ </description>
+ </property>
+
+ </element>
</theme>

Back to the top