Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 166183 Details for
Bug 310611
Improve HTML rendering for Confluence markup language (e.g. table borders)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Adding more info (CSS classes and additional wrappers) to built document
wikitext-confluence-patch1 (text/plain), 5.37 KB, created by
Wojciech Seliga
on 2010-04-27 08:06:16 EDT
(
hide
)
Description:
Adding more info (CSS classes and additional wrappers) to built document
Filename:
MIME Type:
Creator:
Wojciech Seliga
Created:
2010-04-27 08:06:16 EDT
Size:
5.37 KB
patch
obsolete
>Index: src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/TableBlock.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.wikitext.confluence.core/src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/TableBlock.java,v >retrieving revision 1.4 >diff -u -r1.4 TableBlock.java >--- src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/TableBlock.java 29 Oct 2008 03:38:28 -0000 1.4 >+++ src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/TableBlock.java 27 Apr 2010 12:04:26 -0000 >@@ -10,20 +10,29 @@ > *******************************************************************************/ > package org.eclipse.mylyn.internal.wikitext.confluence.core.block; > >-import java.util.regex.Matcher; >-import java.util.regex.Pattern; >- > import org.eclipse.mylyn.wikitext.core.parser.Attributes; > import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType; > import org.eclipse.mylyn.wikitext.core.parser.markup.Block; > >+import java.util.regex.Matcher; >+import java.util.regex.Pattern; >+ > /** > * Table block, matches blocks that start with <code>table. </code> or those that start with a table row. > * > * @author David Green >+ * @author Wojciech Seliga > */ > public class TableBlock extends Block { > >+ private static final String TABLE_WRAP_CSS_CLASS = "table-wrap"; //$NON-NLS-1$ >+ >+ private static final String TABLE_CSS_CLASS = "confluenceTable"; //$NON-NLS-1$ >+ >+ private static final String CELL_CSS_CLASS = "confluenceTd"; //$NON-NLS-1$ >+ >+ private static final String HEADER_CSS_CLASS = "confluenceTh"; //$NON-NLS-1$ >+ > static final Pattern startPattern = Pattern.compile("(\\|(.*)?(\\|\\s*$))"); //$NON-NLS-1$ > > static final Pattern TABLE_ROW_PATTERN = Pattern.compile("\\|(\\|)?" + "((?:(?:[^\\|\\[]*)(?:\\[[^\\]]*\\])?)*)" //$NON-NLS-1$ //$NON-NLS-2$ >@@ -39,7 +48,12 @@ > @Override > public int processLineContent(String line, int offset) { > if (blockLineCount == 0) { >+ Attributes tableWrapperAttributes = new Attributes(); >+ tableWrapperAttributes.setCssClass(TABLE_WRAP_CSS_CLASS); >+ builder.beginBlock(BlockType.DIV, tableWrapperAttributes); >+ > Attributes attributes = new Attributes(); >+ attributes.setCssClass(TABLE_CSS_CLASS); > builder.beginBlock(BlockType.TABLE, attributes); > } else if (markupLanguage.isEmptyLine(line)) { > setClosed(true); >@@ -73,6 +87,7 @@ > boolean header = headerIndicator != null && "|".equals(headerIndicator); //$NON-NLS-1$ > > Attributes attributes = new Attributes(); >+ attributes.setCssClass(header ? HEADER_CSS_CLASS : CELL_CSS_CLASS); > builder.beginBlock(header ? BlockType.TABLE_CELL_HEADER : BlockType.TABLE_CELL_NORMAL, attributes); > > markupLanguage.emitMarkupLine(getParser(), state, lineOffset, text, 0); >@@ -100,7 +115,8 @@ > @Override > public void setClosed(boolean closed) { > if (closed && !isClosed()) { >- builder.endBlock(); >+ builder.endBlock(); // closing wrapping div >+ builder.endBlock(); // closing table > } > super.setClosed(closed); > } >Index: src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/ExtendedPreformattedBlock.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.wikitext.confluence.core/src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/ExtendedPreformattedBlock.java,v >retrieving revision 1.4 >diff -u -r1.4 ExtendedPreformattedBlock.java >--- src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/ExtendedPreformattedBlock.java 29 Oct 2008 03:38:28 -0000 1.4 >+++ src/org/eclipse/mylyn/internal/wikitext/confluence/core/block/ExtendedPreformattedBlock.java 27 Apr 2010 12:04:26 -0000 >@@ -15,9 +15,11 @@ > > /** > * quoted text block, matches blocks that start with <code>{noformat}</code>. Creates an extended block type of >- * {@link ParagraphBlock paragraph}. >+ * {@link ParagraphBlock paragraph}. In order to allow direct reuse of Confluence CSS and visually match web UI output, >+ * an additional div wrapping is used > * > * @author David Green >+ * @author Wojciech Seliga > */ > public class ExtendedPreformattedBlock extends AbstractConfluenceDelimitedBlock { > >@@ -28,11 +30,28 @@ > @Override > protected void beginBlock() { > Attributes attributes = new Attributes(); >- builder.beginBlock(BlockType.PREFORMATTED, attributes); >+ >+ attributes.appendCssClass("preformatted"); //$NON-NLS-1$ >+ attributes.appendCssClass("panel"); //$NON-NLS-1$ >+ >+ // to stick to web renderer used by Confluence and Crucible >+ // as this style is not configured via CSS, but rather included in-line >+ attributes.appendCssStyle("border-width: 1px;"); //$NON-NLS-1$ >+ >+ builder.beginBlock(BlockType.DIV, attributes); >+ >+ Attributes attributes2 = new Attributes(); >+ attributes2.appendCssClass("preformattedContent"); //$NON-NLS-1$ >+ attributes2.appendCssClass("panelContent"); //$NON-NLS-1$ >+ >+ builder.beginBlock(BlockType.DIV, attributes2); >+ builder.beginBlock(BlockType.PREFORMATTED, new Attributes()); > } > > @Override > protected void endBlock() { >+ builder.endBlock(); // div >+ builder.endBlock(); // div > builder.endBlock(); // pre > } > >@@ -40,10 +59,10 @@ > protected void handleBlockContent(String content) { > if (content.length() > 0) { > builder.characters(content); >+ builder.characters("\n"); //$NON-NLS-1$ > } else if (blockLineCount == 1) { > return; > } >- builder.characters("\n"); //$NON-NLS-1$ > } > > @Override
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 310611
: 166183 |
166185