How Can I remove the injected CSS Resource in GWT?


Tags: gwt,uibinder,gwt2,clientbundle,cssresource

Problem :

I want to remove the injected CSSResource in GWT application.

I used the following code MyClass.INSTANCE.ensureInjected();

I want the above CSSResource for a particular page only. So the remaining pages should be work as per the actual css/theme.

Once I inject this then its applicable for the whole application. How can I overcome this?

Help me.



Solution :

You can inject your css bundle using directly StyleInjector utility class, instead of the ensureInjected() method

Then you will have a reference of the injected element which you can remove when you want.

// Equivalent to MyClass.INSTANCE.ensureInjected()
StyleElement e  = StyleInjector.injectStylesheet(MyClass.INSTANCE.css().getText());


// Remove the injected css element
e.removeFromParent();

    CSS Howto..

    How to move the scrollbar down

    How to make css transition effect apply to all its children?

    How to display text on the same line?

    How can I transform dots to line between CSS menu items?

    How to emulate Google's thick, red underline text decoration

    Centered CSS pages that are longer than one screen appear 5px~ further to the left than shorter ones - how do I stop this?

    Create template page for showing jpg's from direct links [closed]

    How apply css to div in catch statement using jquery

    Jquery - How to alternate an :Odd :Even pattern every 4 ?

    how to change css property of 2nd & 6rd DIV using jquery

    How do I create a region/zone map for the web? [closed]

    CSS - How to make IE7 respect min-width

    How to make the page layout stay the same after minimized?

    How to register Css of html page in wordpress theme

    How to customize post excerpt css

    How to use CSS Loader in my website?

    How to create a margin between two seperate divs?

    How to achieve pages like a math notebook in css?

    How to apply “-webkit” css rules using jquery .css

    how to apply two kind of css to one control, one for internet explorer, another for firefox and chrome

    How do I edit an external css file with PHP?

    Materialize CSS Showing errors on form fields

    how to make html table first row 'absolute'

    How to make the progress bar with html css javascript

    How to implement a partially flexible screen layout with a grid framework?

    how to edit a css selector in order to shorten the amount of characters used in file

    jQuery: How can I set css with own width?

    How do I handle setting multiple styles (due to vendor prefixes) in CSS with Javascript?

    How to overflow in CSS/HTML? [closed]

    How to wrap a div vertically and then horizontally