List of usage examples for com.google.gwt.dom.client StyleInjector injectAtEnd
public static void injectAtEnd(String css)
From source file:client.resources.ApplicationResources.java
License:Apache License
/** * Lazy initialization of client bundle. */// w w w .ja va 2 s .c om private static ApplicationResourceBundle mayInitializeAndInjectBundle() { if (bundle == null) { bundle = GWT.create(ApplicationResourceBundle.class); bundle.common().ensureInjected(); bundle.responsiveDefault().ensureInjected(); /* * Inject the CSS media queries after all previously injected styles. * * This is done so that every style modified by a matching media query overrides its original * style. */ StyleInjector.injectAtEnd(getMediaQueries()); } return bundle; }
From source file:com.arcbees.website.assets.client.forkongithub.ForkOnGithubResourcesLoader.java
License:Apache License
@Inject public ForkOnGithubResourcesLoader(ForkOnGithubResource forkOnGithubResource) { forkOnGithubResource.forkOnGithub_style().ensureInjected(); String mediaCss = "@media only screen and (max-width: 1320px), only screen and (max-device-width: 1320px) {" + forkOnGithubResource.forkOnGithub_mediascreen().getText() + "}"; StyleInjector.injectAtEnd(mediaCss); }
From source file:com.floatzcss.gwt.client.Css.java
License:Apache License
public void onModuleLoad() { // Load all floatz css bundles in the necessary order Floatz.INSTANCE.resetMeyer().ensureInjected(); Floatz.INSTANCE.reset().ensureInjected(); Floatz.INSTANCE.layout().ensureInjected(); Floatz.INSTANCE.form().ensureInjected(); Floatz.INSTANCE.nav().ensureInjected(); // Workaround for injecting media relevant styles (does not work when // defined directly in css file because CSS bundles currently do not // support @media. MUST use inject at end, otherwise not working in IE9 StyleInjector.injectAtEnd("@media print { " + Floatz.INSTANCE.layoutPrint().getText() + " }"); // Load mobile styles only if user agent is mobile webkit if (Browser.isMobileWebkit()) { Floatz.INSTANCE.mobile().ensureInjected(); }/*from w w w. ja v a 2s. c o m*/ }
From source file:com.google.appengine.demos.taskengine.client.Tasks.java
License:Apache License
/** * This is the entry point method.// w w w . j a v a2 s.com */ public void onModuleLoad() { StyleInjector.injectAtEnd(resources.taskDetailsCss().getText() + resources.taskListCss().getText() + resources.controlBarCss().getText() + resources.labelMatrixCss().getText()); uiPages = new PageTransitionPanel(Document.get().getBody()); Controller controller = new Controller(); ControlBar.Controls taskListControls = TaskList.createControls(controller, resources); taskList = new TaskList(uiPages, taskListControls, controller, resources); ControlBar.Controls taskDetailsControls = TaskDetails.createControls(controller, resources); taskDetails = new TaskDetails(uiPages, taskDetailsControls, controller, resources); loadEntireTaskList(); uiPages.doResize(); DeferredCommand.defer(new DeferredCommand() { @Override public void onExecute() { uiPages.doResize(); } }, 100); }
From source file:com.kiahu.sample.client.entrypoint.MultiPageEntryPoint.java
License:Open Source License
protected void bind() { BasicProjectClientBundle.INSTANCE.css().ensureInjected(); // StyleInjector.inject(BasicProjectClientBundle.INSTANCE.media().getText()); // Issue 4911: Support media-dependent selectors in ClientBundle // See: http://code.google.com/p/google-web-toolkit/issues/detail?id=4911 String mgwtCss = "@media only screen and (orientation:portrait) {" + BasicProjectClientBundle.INSTANCE.mgwtCss().getText() + "}"; StyleInjector.injectAtEnd(mgwtCss); I18nUtil.init();/*from w ww . j av a 2s.com*/ // this is required by gwt-platform's proxy generator // see also .gwt.xml // <define-configuration-property name="gin.ginjector" is-multi-valued="false" /> // <set-configuration-property name="gin.ginjector" value="com.kaihu.sample.client.gin.BasicProjectGinjector" /> DelayedBindRegistry.bind(getBasicProjectGinjector()); }
From source file:com.qualogy.qafe.gwt.client.QAFEGWTWeb.java
License:Apache License
private static AsyncCallback<?> createGenerateTypedCSSCallBack() { return new AsyncCallback<Object>() { @Override/* w w w. j av a 2 s . c o m*/ public void onFailure(Throwable caught) { ClientApplicationContext.getInstance().log("Getting generated CSS Failed", caught.getMessage(), true, true, caught); } @Override public void onSuccess(Object result) { if (result != null) { String generatedCss = (String) result; StyleInjector.injectAtEnd(generatedCss); } } }; }
From source file:com.retech.reader.web.client.home.MyDownLoadPanel.java
License:Apache License
@Inject MyDownLoadPanel(final ReaderFactory f, final Provider<BasePlace> places, final PlaceController placeController, final KeyUtil keyUtil, final LocalStorage storage, final Provider<ProgressWidget> progresses) { this.f = f;//w w w .j a v a 2 s . c om this.places = places; this.placeController = placeController; this.keyUtil = keyUtil; this.storage = storage; this.progresses = progresses; // this.getWaveTitle().setText(IssueProxy.ISSUE_DOWN_NAME); this.setWaveContent(binder.createAndBindUi(this)); String portraitCss = "@-webkit-keyframes jiggle { 0% { -webkit-transform: rotate(-2deg);} 50% { -webkit-transform: rotate (2deg);}}"; StyleInjector.injectAtEnd(portraitCss); Element shelf1 = DOM.createDiv(); shelf1.getStyle().setProperty("webkitBorderImage", "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); Element shelf2 = DOM.createDiv(); shelf2.getStyle().setProperty("webkitBorderImage", "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); Element shelf3 = DOM.createDiv(); shelf3.getStyle().setProperty("webkitBorderImage", "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); Element shelf4 = DOM.createDiv(); shelf4.getStyle().setProperty("webkitBorderImage", "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); Element shelf5 = DOM.createDiv(); shelf5.getStyle().setProperty("webkitBorderImage", "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); Element shelf6 = DOM.createDiv(); shelf6.getStyle().setProperty("webkitBorderImage", "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); shelf.appendChild(shelf1); shelf.appendChild(shelf2); shelf.appendChild(shelf3); shelf.appendChild(shelf4); shelf.appendChild(shelf5); shelf.appendChild(shelf6); // myDownLoadPanel.getElement().getStyle().setProperty("webkitBorderImage", // "url(" + res.bookshelfmain().getSafeUri().asString() + ") 25 50 20 50/25px 50px 20px 50px"); }
From source file:com.vaadin.client.ui.ui.UIConnector.java
License:Apache License
/** * Reads CSS strings and resources injected by {@link Styles#inject} from * the UIDL stream./* w ww. j ava2 s. com*/ * * @param uidl * The uidl which contains "css-resource" and "css-string" tags */ private void injectCSS(UIDL uidl) { /* * Search the UIDL stream for CSS resources and strings to be injected. */ for (Iterator<?> it = uidl.getChildIterator(); it.hasNext();) { UIDL cssInjectionsUidl = (UIDL) it.next(); // Check if we have resources to inject if (cssInjectionsUidl.getTag().equals("css-resource")) { String url = getWidget().connection.translateVaadinUri(cssInjectionsUidl.getStringAttribute("url")); LinkElement link = LinkElement.as(DOM.createElement(LinkElement.TAG)); link.setRel("stylesheet"); link.setHref(url); link.setType("text/css"); getHead().appendChild(link); // Check if we have CSS string to inject } else if (cssInjectionsUidl.getTag().equals("css-string")) { for (Iterator<?> it2 = cssInjectionsUidl.getChildIterator(); it2.hasNext();) { StyleInjector.injectAtEnd((String) it2.next()); StyleInjector.flush(); } } } }
From source file:org.ednovo.gooru.application.client.wrap.WrapPresenter.java
License:Open Source License
private void loadResponsiveCss() { // StyleInjector.injectAtEnd("@media (max-width: 767px){"+SearchCBundle.INSTANCE.getResponsiveStyle().getText()+"}"); // StyleInjector.injectAtEnd("@media (max-width: 767px) and (orientation:portrait){"+SearchCBundle.INSTANCE.getResponsive1Style().getText()+"}"); // StyleInjector.injectAtEnd("@media (max-width: 767px) and (orientation:landscape){"+SearchCBundle.INSTANCE.getResponsive2Style().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 480px) and (max-width: 767px){"+SearchCBundle.INSTANCE.getResponsive3Style().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 240px) and (max-width: 319px){"+SearchCBundle.INSTANCE.getResponsive4Style().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 320px) and (max-width: 479px){"+SearchCBundle.INSTANCE.getResponsive5Style().getText()+"}"); // StyleInjector.injectAtEnd("@media screen and (min-width: 768px){"+SearchCBundle.INSTANCE.getResponsive6Style().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 1200px){"+SearchCBundle.INSTANCE.getResponsive7Style().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 768px) and (max-width: 991px) {"+SearchCBundle.INSTANCE.getResponsive8Style().getText()+"}"); ///*from w ww . j av a 2s . co m*/ // SearchCBundle.INSTANCE.css().ensureInjected(); StyleInjector.injectAtEnd("@media (min-width: 240px) and (max-width: 319px){" + LoginPopUpCBundle.INSTANCE.getResponsiveStyle().getText() + "}"); StyleInjector.injectAtEnd("@media (min-width: 320px) and (max-width: 479px){" + LoginPopUpCBundle.INSTANCE.getResponsive1Style().getText() + "}"); StyleInjector.injectAtEnd("@media (min-width: 480px) and (max-width: 767px){" + LoginPopUpCBundle.INSTANCE.getResponsive2Style().getText() + "}"); StyleInjector.injectAtEnd("@media (min-width: 768px) and (max-width: 991px){" + LoginPopUpCBundle.INSTANCE.getResponsive3Style().getText() + "}"); StyleInjector.injectAtEnd( "@media (min-width: 1200px){" + LoginPopUpCBundle.INSTANCE.getResponsive4Style().getText() + "}"); StyleInjector.injectAtEnd("@media screen and (max-width: 767px) {" + LoginPopUpCBundle.INSTANCE.getResponsive5Style().getText() + "}"); StyleInjector.injectAtEnd("@media screen and (min-width: 768px) {" + LoginPopUpCBundle.INSTANCE.getResponsive6Style().getText() + "}"); LoginPopUpCBundle.INSTANCE.css().ensureInjected(); // StyleInjector.injectAtEnd("@media (max-width: 767px) {"+AnalyticsTabCBundle.INSTANCE.getResponsiveStyle().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 768px) and (max-width: 991px) {"+AnalyticsTabCBundle.INSTANCE.getResponsive1Style().getText()+"}"); // // AnalyticsTabCBundle.INSTANCE.css().ensureInjected(); // // StyleInjector.injectAtEnd("@media (max-width: 767px) {"+CollectionSummaryIndividualCBundle.INSTANCE.getResponsiveStyle().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 768px) and (max-width: 991px) {"+CollectionSummaryIndividualCBundle.INSTANCE.getResponsive1Style().getText()+"}"); // // CollectionSummaryIndividualCBundle.INSTANCE.css().ensureInjected(); // StyleInjector.injectAtEnd("@media (max-width: 767px) {"+CollectionPlaySummaryCBundle.INSTANCE.getResponsiveStyle().getText()+"}"); // StyleInjector.injectAtEnd("@media (min-width: 768px) and (max-width: 991px) {"+CollectionPlaySummaryCBundle.INSTANCE.getResponsive1Style().getText()+"}"); // // CollectionPlaySummaryCBundle.INSTANCE.css().ensureInjected(); // StyleInjector.injectAtEnd("@media (min-width: 480px) and (max-width: 767px){"+FolderContainerCBundle.INSTANCE.getResponsiveStyle().getText()+"}"); // FolderContainerCBundle.INSTANCE.css().ensureInjected(); }
From source file:org.gwtbootstrap3.extras.fullcalendar.client.FullCalendarEntryPoint.java
License:Apache License
@Override public void onModuleLoad() { StyleInjector.injectAtEnd(FullCalendarClientBundle.INSTANCE.fullCalendarCss().getText()); StyleInjector.injectAtEnd(/* w ww .j a v a 2 s . c om*/ "@media print {" + FullCalendarClientBundle.INSTANCE.fullCalendarPrintCss().getText() + "}"); if (!isMomentPresent()) { ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getMomentJS().getText()) .setWindow(ScriptInjector.TOP_WINDOW).inject(); } if (!isCalendarPresent()) { ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getFullCalendarJS().getText()) .setWindow(ScriptInjector.TOP_WINDOW).inject(); } if (!isDragAndResizePresent()) { ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getCustomDragResizeJS().getText()) .setWindow(ScriptInjector.TOP_WINDOW).inject(); } }