Examples of StyleSheet


Examples of org.apache.poi.hwpf.model.StyleSheet

  {
    initAll();
    PAPX papx = (PAPX)_paragraphs.get(_parStart);
    short istd = papx.getIstd();

    StyleSheet ss = _doc.getStyleSheet();
    CharacterProperties baseStyle = ss.getCharacterStyle(istd);
    byte[] grpprl = CharacterSprmCompressor.compressCharacterProperty(props, baseStyle);
    SprmBuffer buf = new SprmBuffer(grpprl);
    _doc.getCharacterTable().insert(_charStart, _start, buf);

    return insertBefore(text);
View Full Code Here

Examples of org.apache.poi.hwpf.model.StyleSheet

  {
    initAll();
    PAPX papx = (PAPX)_paragraphs.get(_parEnd - 1);
    short istd = papx.getIstd();

    StyleSheet ss = _doc.getStyleSheet();
    CharacterProperties baseStyle = ss.getCharacterStyle(istd);
    byte[] grpprl = CharacterSprmCompressor.compressCharacterProperty(props, baseStyle);
    SprmBuffer buf = new SprmBuffer(grpprl);
    _doc.getCharacterTable().insert(_charEnd, _end, buf);
    _charEnd++;
    return insertAfter(text);
View Full Code Here

Examples of org.apache.poi.hwpf.model.StyleSheet

   */
  protected Paragraph insertBefore(ParagraphProperties props, int styleIndex, String text)
    //throws UnsupportedEncodingException
  {
    initAll();
    StyleSheet ss = _doc.getStyleSheet();
    ParagraphProperties baseStyle = ss.getParagraphStyle(styleIndex);
    CharacterProperties baseChp = ss.getCharacterStyle(styleIndex);

    byte[] grpprl = ParagraphSprmCompressor.compressParagraphProperty(props, baseStyle);
    byte[] withIndex = new byte[grpprl.length + LittleEndian.SHORT_SIZE];
    LittleEndian.putShort(withIndex, (short)styleIndex);
    System.arraycopy(grpprl, 0, withIndex, LittleEndian.SHORT_SIZE, grpprl.length);
View Full Code Here

Examples of org.apache.xalan.templates.Stylesheet

                                                  handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet",
                                                                          "xsl:stylesheet");

        handler.pushProcessor(lreProcessor);

        Stylesheet stylesheet;
        try
        {
          stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener());
        }
        catch(TransformerConfigurationException tfe)
        {
          throw new TransformerException(tfe);
        }

        // stylesheet.setDOMBackPointer(handler.getOriginatingNode());
        // ***** Note that we're assigning an empty locator. Is this necessary?
        SAXSourceLocator slocator = new SAXSourceLocator();
        Locator locator = handler.getLocator();
        if(null != locator)
        {
          slocator.setLineNumber(locator.getLineNumber());
          slocator.setColumnNumber(locator.getColumnNumber());
          slocator.setPublicId(locator.getPublicId());
          slocator.setSystemId(locator.getSystemId());
        }
        stylesheet.setLocaterInfo(slocator);
        stylesheet.setPrefixes(handler.getNamespaceSupport());
        handler.pushStylesheet(stylesheet);

        isLREAsStyleSheet = true;

        AttributesImpl stylesheetAttrs = new AttributesImpl();
        AttributesImpl lreAttrs = new AttributesImpl();
        int n = attributes.getLength();

        for (int i = 0; i < n; i++)
        {
          String attrLocalName = attributes.getLocalName(i);
          String attrUri = attributes.getURI(i);
          String value = attributes.getValue(i);

          if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL))
          {
            stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName,
                                         attributes.getType(i),
                                         attributes.getValue(i));
          }
          else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals(
                                                                               "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL))
          {

            // ignore
          }
          else
          {
            lreAttrs.addAttribute(attrUri, attrLocalName,
                                  attributes.getQName(i),
                                  attributes.getType(i),
                                  attributes.getValue(i));
          }
        }

        attributes = lreAttrs;

        // Set properties from the attributes, but don't throw
        // an error if there is an attribute defined that is not
        // allowed on a stylesheet.
        try{
        stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet",
                                                        stylesheetAttrs, stylesheet);
        }
        catch (Exception e)
        {
          // This is pretty ugly, but it will have to do for now.
          // This is just trying to append some text specifying that
          // this error came from a missing or invalid XSLT namespace
          // declaration.
          // If someone comes up with a better solution, please feel
          // free to contribute it. -mm
          String msg = e.getMessage();
          if (stylesheet.getDeclaredPrefixes() == null ||
            !declaredXSLNS(stylesheet))
          {
            msg = msg +"; " + XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null);
           
          }
          //else
            throw new org.xml.sax.SAXException(msg, e);
        }
        handler.pushElemTemplateElement(stylesheet);

        ElemTemplate template = new ElemTemplate();

        appendAndPush(handler, template);

        XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH,
             handler.getStylesheetProcessor().getErrorListener());

        template.setMatch(rootMatch);

        // template.setDOMBackPointer(handler.getOriginatingNode());
        stylesheet.setTemplate(template);

        p = handler.getElemTemplateElement();
        excludeXSLDecl = true;
      }

      XSLTElementDef def = getElemDef();
      Class classObject = def.getClassObject();
      boolean isExtension = false;
      boolean isComponentDecl = false;
      boolean isUnknownTopLevel = false;

      while (null != p)
      {

        // System.out.println("Checking: "+p);
        if (p instanceof ElemLiteralResult)
        {
          ElemLiteralResult parentElem = (ElemLiteralResult) p;

          isExtension = parentElem.containsExtensionElementURI(uri);
        }
        else if (p instanceof Stylesheet)
        {
          Stylesheet parentElem = (Stylesheet) p;

          isExtension = parentElem.containsExtensionElementURI(uri);

          if ((false == isExtension) && (null != uri)
              && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL)
                  || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL)))
          {
View Full Code Here

Examples of org.apache.xalan.templates.Stylesheet

          StylesheetComposed imported = stylesheet.getGlobalImport(i);
          int includedCount = imported.getIncludeCountComposed();

          for (int j = -1; j < includedCount; j++)
          {
            Stylesheet included = imported.getIncludeComposed(j);

            included.runtimeInit(this);

            for (ElemTemplateElement child = included.getFirstChildElem();
                    child != null; child = child.getNextSiblingElem())
            {
              child.runtimeInit(this);
            }
          }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.Stylesheet

    public static String getTransletErrorMessage() {
  return _runtimeError;
    }

    private String getFileName(SyntaxTreeNode node) {
  Stylesheet stylesheet = node.getStylesheet();
  if (stylesheet != null)
      return stylesheet.getSystemId();
  else
      return null;
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.Stylesheet

    public static String getTransletErrorMessage() {
  return _runtimeError;
    }

    private String getFileName(SyntaxTreeNode node) {
  Stylesheet stylesheet = node.getStylesheet();
  if (stylesheet != null)
      return stylesheet.getSystemId();
  else
      return null;
    }
View Full Code Here

Examples of org.dom4j.rule.Stylesheet

    /**
     * Factory method to create a new stylesheet
     */
    protected Stylesheet createStylesheet(final XMLOutput output) {
        // add default actions
        Stylesheet answer = new Stylesheet();
        answer.setValueOfAction(
            new Action() {
                public void run(Node node) throws Exception {                   
                    String text = node.getStringValue();
                    if ( text != null && text.length() > 0 ) {
                        // #### should use an 'output' property
View Full Code Here

Examples of org.eclipse.rap.rwt.internal.theme.css.StyleSheet

      @Override
      public InputStream getResourceAsStream( String resourceName ) throws IOException {
        return new ByteArrayInputStream( "".getBytes() );
      }
    };
    StyleSheet styleSheet = CssFileReader.readStyleSheet( "", resourceLoader );
    Theme theme = new Theme( themeId, "unknown", styleSheet );
    ApplicationContextImpl applicationContext = ContextProvider.getContext().getApplicationContext();
    environment.resetThemes();
    ThemeManager themeManager = applicationContext.getThemeManager();
    themeManager.registerTheme( theme );
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.excel.xlsx.loader.template.Stylesheet

    }
  }

  public void save() throws IOException, SpreadsheetException
  {
    final Stylesheet template;
    if (this.templateInputStream != null) {
      template = TemplateLoader.loadWorkbook( this.templateInputStream );
    }
    else {
      final InputStream is = ClassLoader.getSystemResourceAsStream( STYLESHEET_TEMPLATE );
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.