How to style GWT's NotificationMole with CSS

gwt tutorial
gwt panels
gwt id
gwt examples
gwt uihandler
gwt widgets tutorial
gwt code
gwt tutorial pdf

Has anyone had any success applying your own CSS style to GWT's NotificationMole.

If I add my own stylename then that style only applies to the outer DIV which is NOT removed when the mole is hidden, and I can't fing a way to apply style to the inner divs...

A dirty solution :

package; // important for package visibility access


public class NotificationMoleHelper {

    protected NotificationMole notificationMole;

    public NotificationMoleHelper(NotificationMole notificationMole) {
        this.notificationMole = notificationMole;

    public SpanElement getNotificationText() {
        return notificationMole.notificationText;

    public DivElement getHeightMeasure() {
        return notificationMole.heightMeasure;

public DivElement getBorderElement() {
    return notificationMole.borderElement;

     * Change heightMeasure's background color
     * @param backgroundColor
    public void setBackgroundColor(String backgroundColor) {


Example :

final NotificationMoleHelper notificationMoleHelper = new NotificationMoleHelper(notificationMole);

Css Styling, Styling Existing Widgets​​ By default, the class name for each component is gwt-<classname> . For example, the Button widget has a default style of gwt-Button . All of the widgets created with the GWT toolkit will have a default class name, but a widget's style name can be set using setStyleName(). For example, the Button widget has a default style of gwt-Button and similar way TextBox widgest has a default style of gwt-TextBox. In order to give all buttons and text boxes a larger font, you could put the following rule in your application's CSS file.gwt-Button { font-size: 150%; } .gwt-TextBox { font-size: 150%; }

Well your NotificationMole has an associated ui.xml file, so any custom styles you want to apply should be applied there.

Style (GWT Javadoc), Provides programmatic access to properties of the style object. Note that if a property or value is not explicitly enumerated in this class, you can still access it via  What about using style classes? I mean, you can write a style class like this:.someClass { position:absolute; top:0px; left:0px; } And then add the style class to the TextArea. ta.addStyleName("someClass"); It will help you to write a more concise code, without inline styling that could be difficult to maintain.

This might be easy: define your own style first, after init of the NotificationMole, just replace its built-in class with your defined ones, that's what i did in my project. Using DOM to replace classes or using gwtquery, both are OK.

GWT - Style with CSS, public void setStylePrimaryName(java.lang.String style)​​ txtWidget. addStyleName("gwt-Red-Text"); Using above method you can add as many styles as you like to apply on a widget. If you remove first style from the button widget then second style will still remain with the text. 1. int getCharacterWidth () Gets the requested width of the text box (this is not an exact value, as not all characters are created equal). 2. int getCursorPos () Gets the current position of the cursor (this also serves as the beginning of the text selection). 3.

A further alternative which might be more palatable for some people:

  1. Set the id of the mole mole.getElement().setId("mole"); or mole.ensureDebugId("mole")
  2. Then in your ui binder file add style:

        width: 200px !important;
            height: 60px !important;

I tried without the !importants but gwt was including default widths and height so it wasn't listening to my styling. You won't need the !important if you add styles that gwt doesn't add by default.

Modify Style from GWT, Don't set style via setAttribute . In JavaScript the style attribute is actually an array. Thus depending on how smart the browser is and  The Anchor widget that represents a simple <a> element. Class Declaration. Following is the declaration for class − public class Anchor extends FocusWidget implements HasHorizontalAlignment, HasName, HasHTML, HasWordWrap, HasDirection CSS Style Rules

Ways of setting a CSS property to an element in GWT [UPDATED] |, However, if there was already any style information for defined for that element, it would be overwritten. You could get the current attributes first  Doggy style isn't just for penis-in-vagina sex, so don't be afraid to switch up the entry point or add other stimulation into the mix. Here's how to get into position, adjust for deeper or more

GWT - Tutorial, This tutorial describes how to develop a Web application with GWT and the Google Plugin for Eclipse. This article assumes basic Eclipse and  If the length of your cut allows for it, slick down freshly blow-dried hair using Hardwear 16 and brush hair in a sideswept motion for a sleek look. To rock a chic disheveled look, opt for a texturizing hair powder. Sprinkle the product throughout the roots and use your fingertips to distribute the powder for a natural lift.

Java Code Examples, This page provides Java code examples for The examples are extracted from open source Java projects. GWT is an open source, completely free, and used by thousands of developers around the world. It is licensed under the Apache License version 2.0. This tutorial will give you a great understanding of GWT concepts needed to get a web application up and running.