diff options
author | Christophe Cornu <ccornu> | 2004-11-01 20:12:12 +0000 |
---|---|---|
committer | Christophe Cornu <ccornu> | 2004-11-01 20:12:12 +0000 |
commit | f6070cb911d2d98afce205bd48395c0b5f9cf058 (patch) | |
tree | 61bc131dc93787b235fc45299562ebbd04e643dc | |
parent | a210372dbf525c2057b86f0a891e5f4096fd8ec9 (diff) | |
download | eclipse.platform.swt-f6070cb911d2d98afce205bd48395c0b5f9cf058.tar.gz eclipse.platform.swt-f6070cb911d2d98afce205bd48395c0b5f9cf058.tar.xz eclipse.platform.swt-f6070cb911d2d98afce205bd48395c0b5f9cf058.zip |
*** empty log message ***
-rw-r--r-- | examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java index 500bc9d362..e17d1c37ae 100644 --- a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java +++ b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java @@ -20,6 +20,29 @@ public class EditorTab { Browser browser; Text htmlText, scriptText; Button htmlButton, scriptButton; + static String html = + "<html>\r\n"+ + " <body>\r\n"+ + " <h1 id='myid'>HTML Document</h1>\r\n"+ + " <h2>Set HTML content</h2>\r\n"+ + " <ol>\r\n"+ + " <li>Enter html data into the 'setText' pane</li>\r\n"+ + " <li>Click on 'setText' to set the new content</li>\r\n"+ + " </ol>\r\n"+ + " <h2>Query or modify HTML document</h2>\r\n"+ + " <ol>\r\n"+ + " <li>Enter javascript commands into the 'execute' pane</li>\r\n"+ + " <li>Click on 'execute' to run the javascript in the current document</li>\r\n"+ + " </ol>\r\n"+ + " </body>\r\n"+ + "</html>"; + + static String script = + "var node = document.createElement('P');\r\n"+ + "var text = document.createTextNode('Content inserted!');\r\n"+ + "node.appendChild(text);\r\n"+ + "document.getElementById('myid').appendChild(node);\r\n\r\n"+ + "document.bgColor = 'yellow';"; public EditorTab(TabItem item) { final Composite parent = new Composite(item.getParent(), SWT.NONE); @@ -106,9 +129,9 @@ public class EditorTab { scriptButton.setLayoutData(gridData); scriptGroup.layout(); - browser.setUrl("http://www.eclipse.org"); - htmlText.setText("<html><title>Hello</title><p>Hello World</html>"); - scriptText.setText("document.bgColor = 'yellow'"); + browser.setText(html); + htmlText.setText(html); + scriptText.setText(script); parent.layout(); Listener listener = new Listener() { |