/** * @param schemaPreviewFile * @param schema * @throws IOException */ private void recreateSchemaPreviewFileContents(File schemaPreviewFile, ISchema schema) throws IOException { SchemaTransformer transformer = new SchemaTransformer(); OutputStream os = new FileOutputStream(schemaPreviewFile); PrintWriter printWriter = new PrintWriter(os, true); transformer.transform(schema, printWriter); os.flush(); os.close(); }
private void printStyles() { fWriter.println("<style>@import url(\"" + getCssURL() + "\");</style>"); //$NON-NLS-1$ //$NON-NLS-2$ fWriter.println("<style>@import url(\"" + getSchemaCssURL() + "\");</style>"); //$NON-NLS-1$ //$NON-NLS-2$ }
private void setCssURL(URL cssURL) { try { if (cssURL != null) fCssURL = FileLocator.resolve(cssURL); } catch (IOException e) { } if (fCssURL == null && fCssPurpose != BUILD) fCssURL = getResourceURL(getProductPlugin(), PLATFORM_CSS); if (fCssURL == null && fCssPurpose != BUILD) fCssURL = getResourceURL(PDECore.PLUGIN_ID, PLATFORM_CSS); }
fWriter.println("<p class=\"code SchemaDtd\"><!ATTLIST " //$NON-NLS-1$ + name + "</p>"); //$NON-NLS-1$ int maxWidth = calculateMaxAttributeWidth(element.getAttributes()); for (int i = 0; i < attributes.length; i++) { fWriter.print("<p class=\"code SchemaDtdAttlist\">"); //$NON-NLS-1$ appendAttlist(attributes[i], maxWidth); if (i + 1 == attributes.length) { fWriter.print(">"); //$NON-NLS-1$ String elementType = containsParagraph(description) ? "div" : "p"; //$NON-NLS-1$ //$NON-NLS-2$ fWriter.println("<" + elementType + " class=\"ConfigMarkupElementDesc\">"); //$NON-NLS-1$ //$NON-NLS-2$ transformText(description); fWriter.println("</" + elementType + ">"); //$NON-NLS-1$ //$NON-NLS-2$ fWriter.print("<i style=\"color: red;\">Deprecated</i> "); //$NON-NLS-1$ fWriter.print("<b>" + att.getName() + "</b> - "); //$NON-NLS-1$ //$NON-NLS-2$ transformText(att.getDescription()); fWriter.println("</li>"); //$NON-NLS-1$
+ name + "</p>"); //$NON-NLS-1$ int maxWidth = calculateMaxAttributeWidth(element.getAttributes()); for (int i = 0; i < attributes.length; i++) { appendAttlist(attributes[i], maxWidth); transformText(description); fWriter.println("</p>"); //$NON-NLS-1$ fWriter.print("<i style=\"color: red;\">Deprecated</i> "); //$NON-NLS-1$ fWriter.print("<b>" + att.getName() + "</b> - "); //$NON-NLS-1$ //$NON-NLS-2$ transformText(att.getDescription()); fWriter.println("</li>"); //$NON-NLS-1$
private void transformSection(String title, String sectionId) { IDocumentSection section = findSection(fSchema.getDocumentSections(), sectionId); if (section == null) return; String description = section.getDescription(); if (description == null || description.trim().length() == 0) return; if (title != null) fWriter.print("<h6 class=CaptionFigColumn id=header>" + title + " </h6>"); //$NON-NLS-1$ //$NON-NLS-2$ transformText(description); fWriter.println(); fWriter.println("<p></p>"); //$NON-NLS-1$ fWriter.println(); }
public void transform(ISchema schema, PrintWriter out) { transform(schema, out, null, TEMP); }
private String getSchemaCssURL() { if (fCssPurpose == BUILD) return "../../" + SCHEMA_CSS; //$NON-NLS-1$ URL url = getResourceURL(PLATFORM_PLUGIN_DOC, SCHEMA_CSS); if (url == null) { // this CSS file is last resort and is always there. url = getResourceURL(PDECore.PLUGIN_ID, SCHEMA_CSS); } return url.toString(); }
choices = true; } else if (restriction != null) { appendRestriction(restriction); choices = true; } else {
private void transformSection(String title, String sectionId) { IDocumentSection section = findSection(fSchema.getDocumentSections(), sectionId); if (section == null) return; String description = section.getDescription(); if (description == null || description.trim().length() == 0) return; if (title != null) fWriter.print("<h6 class=\"CaptionFigColumn SchemaHeader\">" + title + " </h6>"); //$NON-NLS-1$ //$NON-NLS-2$ transformText(description); fWriter.println(); if (!sectionId.equals(IDocumentSection.COPYRIGHT)) fWriter.println("<p></p>"); //$NON-NLS-1$ fWriter.println(); }
public void transform(ISchema schema, PrintWriter out) { transform(schema, out, null, TEMP); }
private String getSchemaCssURL() { if (fCssPurpose == BUILD) return "../../" + SCHEMA_CSS; //$NON-NLS-1$ URL url = getResourceURL(PLATFORM_PLUGIN_DOC, SCHEMA_CSS); if (url == null) { // this CSS file is last resort and is always there. url = getResourceURL(PDECore.PLUGIN_ID, SCHEMA_CSS); } return url.toString(); }
fWriter.print("IDREF "); //$NON-NLS-1$ } else if (restriction != null) { appendRestriction(restriction); choices = true; } else {
/** * @param schemaPreviewFile * @param schema * @throws IOException */ private void recreateSchemaPreviewFileContents(File schemaPreviewFile, ISchema schema) throws IOException { SchemaTransformer transformer = new SchemaTransformer(); OutputStream os = new FileOutputStream(schemaPreviewFile); PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, ICoreConstants.UTF_8), true); transformer.transform(schema, printWriter); os.flush(); os.close(); }
private void setCssURL(URL cssURL) { try { if (cssURL != null) fCssURL = FileLocator.resolve(cssURL); } catch (IOException e) { } if (fCssURL == null && fCssPurpose != BUILD) fCssURL = getResourceURL(getProductPlugin(), PLATFORM_CSS); if (fCssURL == null && fCssPurpose != BUILD) fCssURL = getResourceURL(PDECore.PLUGIN_ID, PLATFORM_CSS); }
private void printStyles() { fWriter.println("<style type=\"text/css\">@import url(\"" + getCssURL() + "\");</style>"); //$NON-NLS-1$ //$NON-NLS-2$ fWriter.println("<style type=\"text/css\">@import url(\"" + getSchemaCssURL() + "\");</style>"); //$NON-NLS-1$ //$NON-NLS-2$ }
private void showSchemaDocument() { fPreviewFile = getTempPreviewFile(); if (fPreviewFile == null) return; SchemaTransformer transformer = new SchemaTransformer(); try (OutputStream os = new FileOutputStream(fPreviewFile); PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8), true)) { transformer.transform(fSchema, printWriter); os.flush(); os.close(); showURL(fPreviewFile, fForceExternal); // Associate the generated preview file with the schema file // to enable automatic preview file updates on schema file // changes linkPreviewFileToSchemaFile(); } catch (IOException e) { PDEPlugin.logException(e); } }
Schema schema = (Schema) desc.getSchema(false); SchemaTransformer transformer = new SchemaTransformer(); transformer.transform(schema, writer);
Schema schema = (Schema)desc.getSchema(false); SchemaTransformer transformer = new SchemaTransformer(); transformer.transform(schema, writer);