Examples of CssStylesheet


Examples of com.google.gwt.resources.css.ast.CssStylesheet

  protected void optimize(TreeLogger logger, ResourceContext context,
      JMethod method,
      Map<String, Map<JMethod, String>> classReplacementsWithPrefix,
      Map<JMethod, String> actualReplacements) {
    boolean strict = isStrict(logger, method);
    CssStylesheet sheet = stylesheetMap.get(method);
   
    // Create CSS sprites
    (new Spriter(logger, context)).accept(sheet);

    // Perform @def and @eval substitutions
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

  @Override
  public String createAssignment(TreeLogger logger, ResourceContext context,
      JMethod method) throws UnableToCompleteException {
    JClassType cssResourceSubtype = method.getReturnType().isInterface();
    assert cssResourceSubtype != null;
    CssStylesheet stylesheet = stylesheetMap.get(method);

    // Optimize the stylesheet, recording the class selector obfuscations
    Map<JMethod, String> actualReplacements = optimize(logger, context, method);

    outputCssMapArtifact(logger, context, method, actualReplacements);
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

      logger.log(TreeLogger.ERROR, "At least one source must be specified");
      throw new UnableToCompleteException();
    }

    // Create the AST and do a quick scan for requirements
    CssStylesheet sheet = GenerateCssAst.exec(logger, resources);
    checkSheet(logger, sheet);
    stylesheetMap.put(method, sheet);
    (new RequirementsCollector(logger, context.getRequirements())).accept(sheet);
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssStylesheet

    // Compute the local effective namespace
    Map<String, Map<JMethod, String>> classReplacementsWithPrefix = processImports(
        logger, typeOracle, cssResourceSubtype, method, context);

    boolean strict = isStrict(logger, method);
    CssStylesheet sheet = stylesheetMap.get(method);

    // Create CSS sprites
    (new Spriter(logger, context)).accept(sheet);

    // Perform @def and @eval substitutions
View Full Code Here

Examples of com.volantis.mcs.themes.CSSStyleSheet

            // Compile the style sheet.
            styleSheet = (StyleSheet) baseStyleSheet;

        } else if (baseStyleSheet instanceof CSSStyleSheet) {

            CSSStyleSheet cssStyleSheet = (CSSStyleSheet) baseStyleSheet;
            CSSParserMode parserMode = cssStyleSheet.getParserMode();
            String css = cssStyleSheet.getCSS();

            // Prefix sufficient blank lines and white space to the front of
            // the CSS to ensure that any line and column numbers that the
            // parser reports are correct relative to the source XML.
            String url = cssStyleSheet.getSourceDocumentName();
            int line = cssStyleSheet.getSourceLineNumber();
            int column = cssStyleSheet.getSourceColumnNumber();
            StringBuffer buffer = new StringBuffer(
                    css.length() + line + column);

            for (int i = 1; i < line; i += 1) {
                buffer.append('\n');
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleSheet

    @Override
    public InputStream getInputStream() throws IOException {
        FacesContext ctx = FacesContext.getCurrentInstance();
        InputStream stream = null;
        CSSStyleSheet styleSheet = null;
        try {
            stream = getResourceInputStream();
            if (null == stream) {
                return null;
            }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleSheet

   */
  private void processStylesheet(String css){
    try {
      CSSOMParser parser = new CSSOMParser();
      InputSource is = new InputSource(new StringReader(css));
      CSSStyleSheet stylesheet = parser.parseStyleSheet(is);
      CSSRuleList list = stylesheet.getCssRules();
//      ArrayList assists = new ArrayList();
      for(int i=0;i<list.getLength();i++){
        CSSRule rule = list.item(i);
        if(rule instanceof CSSStyleRule){
          CSSStyleRule styleRule = (CSSStyleRule)rule;
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleSheet

        (Element e, String pe, CSSOMReadOnlyStyleDeclaration rd) {
        try {
            CSSOMRuleList authorRules = new CSSOMRuleList();
            StyleSheetList l = ((DocumentStyle)document).getStyleSheets();
            for (int i = 0; i < l.getLength(); i++) {
                CSSStyleSheet ss = (CSSStyleSheet)l.item(i);
                if (!ss.getDisabled() && mediaMatch(ss.getMedia())) {
                    Node on = ss.getOwnerNode();
                    URL baseURI = null;
                    if (on instanceof ExtendedLinkStyle) {
                        try {
                            baseURI =
                                new URL(((ExtendedLinkStyle)on).getStyleSheetURI());
                        } catch (MalformedURLException ex) {
                        }
                    }
                    addMatchingRules(ss.getCssRules(),
                                     e,
                                     pe,
                                     baseURI,
                                     authorRules);
                }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleSheet

                            buri = new URL(buri, ir.getHref());
                        }
                    } catch (MalformedURLException ex) {
                        break;
                    }
                    CSSStyleSheet is = ir.getStyleSheet();
                    if (is != null) {
                        addMatchingRules(is.getCssRules(), e, pe, buri, rl);
                    }
                }
    break;

      case CSSRule.MEDIA_RULE:
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleSheet

    /**
     * Returns the user-agent stylesheet.
     */
    public CSSStyleSheet getUserAgentStyleSheet() {
        CSSStyleSheet result = null;

        URL url = getClass().getResource("resources/UserAgentStyleSheet.css");
        if (url != null) {
            String uri = url.toString();
            result = createCSSStyleSheet("User Agent Style Sheet", "all");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.