| <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' |
| |
| #***************************************************************************** |
| # |
| # picture.php |
| # |
| # Author: Wim Jongman, Dirk Fauth |
| # Date: 2015-06-04 |
| # |
| # Description: Describes the Rich Text. |
| # |
| #**************************************************************************** |
| |
| |
| # |
| # Begin: page-specific settings. Change these. |
| $pageTitle = "Nebula RichText"; |
| $pageKeywords = "Nebula, SWT, Widgets, Controls"; |
| $pageAuthor = "Wim Jongman, Dirk Fauth"; |
| |
| # Add page-specific Nav bars here |
| # Format is Link text, link URL (can be http://www.someothersite.com/), target (_self, _blank), level (1, 2 or 3) |
| # $Nav->addNavSeparator("My Page Links", "downloads.php"); |
| # $Nav->addCustomNav("My Link", "mypage.php", "_self", 3); |
| # $Nav->addCustomNav("Google", "http://www.google.com/", "_blank", 3); |
| |
| |
| # End: page-specific settings |
| # |
| |
| # Paste your HTML content between the EOHTML markers! |
| $html = <<<EOHTML |
| |
| <div id="midcolumn"> |
| <h1>$pageTitle</h1> |
| |
| <p> |
| The Nebula RichText project mainly contains two controls for dealing with HTML formatted text: |
| <ul> |
| <li><code>RichTextEditor</code> for creating HTML formatted text</li> |
| <li><code>RichTextViewer</code> for rendering HTML formatted text</li> |
| </ul> |
| </p> |
| |
| |
| <h2>RichTextEditor</h2> |
| <img src='images/richtext_editor.png'> |
| <p> |
| The <code>RichTextEditor</code> is a <b>WYSIWYG</b> editor control to create HTML formatted text. |
| It is based on <a href="http://ckeditor.com/" target="_blank">CKEditor</a> and wraps a SWT <code>Browser</code> for integration. |
| It supports several customization options, e.g. modifying the toolbar, and provides callbacks to interact with |
| the control using Java code, similar to interacting with a simple SWT <code>Text</code> control. It is not necessary to know about |
| the underlying Javascript, although it is also possible to interact via Javascript code. |
| </p> |
| <p> |
| It is possible to customize the toolbar by creating and setting a custom <code>ToolbarConfiguration</code>. The default toolbar |
| implementation contains all features that are currently supported by the <code>RichTextViewer</code>. For example, rendering and |
| handling of links and images is currently not supported by the viewer, therefore these toolbar items are not enabled by default. |
| </p> |
| <p> |
| This control is useful to quickly create rich text that has to be displayed on a web page, for example |
| if you want build a web content management system in a Eclipse RCP desktop application. |
| </p> |
| |
| <h3>Features</h3> |
| <ul> |
| <li>WYSIWYG editor to create HTML formatted text</li> |
| <li>POJO/RCP/RAP: can be used in a SWT standalone, RCP and RAP Applications.</li> |
| <li>Customizable toolbar</li> |
| </ul> |
| |
| <h2>RichTextViewer</h2> |
| <img src='images/richtext_viewer.png'> |
| <p> |
| The <code>RichTextViewer</code> is a control that is able to render HTML formatted text. |
| It works well with output generated by <a href="http://ckeditor.com/" target="_blank">CKEditor</a>. |
| Technically it is a subclass of SWT <code>Canvas</code> and uses the <code>RichTextPainter</code> that is provided by this |
| project for painting HTML formatted text on a <code>GC</code>. |
| </p> |
| |
| <h2>JFace Viewer Integration</h2> |
| <img src='images/richtext_jface_viewer_integration.png'> |
| <p> |
| The RichText project contains two classes for integration with JFace Viewers: |
| <ul> |
| <li><code>RichTextCellLabelProvider</code></li> |
| <li><code>RichTextCellEditor</code></li> |
| </ul> |
| Using these classes it is possible to edit and render HTML formatted text in a JFace Viewer. |
| </p> |
| <p> |
| Note that in embedded mode, the <code>RichTextEditor</code> is <b>resizable</b> and <b>movable</b> via drag operations. |
| </p> |
| |
| <br/> |
| <br/> |
| |
| <p> |
| There is also a <a href="" target="_blank">NatTable</a> integration available. |
| </p> |
| |
| <br/> |
| <br/> |
| |
| <p> |
| <b>QUICK START:</b> Look at the <a href='/nebula/snippets.php#RichText'>Snippets</a>. Other snippets are available on <a href="/nebula/source.php">git</a>. |
| </p> |
| <p> |
| <b>File a bug:</b> <a href='https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Nebula&component=RichText' target='_blank'>Click here to file a bug or feature request for RichText</a> |
| </p> |
| |
| <hr class="clearer"/> |
| </div> |
| |
| |
| EOHTML; |
| |
| # Generate the web page |
| $App->generatePage ( $theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html ); |
| ?> |