1 package $packageName$; 2 3 import java.io.*; 4 import java.util.*; 5 6 import org.eclipse.swt.widgets.*; 7 import org.eclipse.ui.forms.widgets.*; 8 import org.eclipse.ui.intro.config.*; 9 import org.w3c.dom.*; 10 11 13 public class DynamicContentProvider implements IIntroXHTMLContentProvider { 14 15 16 public void init(IIntroContentProviderSite site) { 17 } 18 19 20 public void createContent(String id, PrintWriter out) { 21 } 22 23 public void createContent(String id, Composite parent, FormToolkit toolkit) { 24 } 25 26 private String getCurrentTimeString() { 27 StringBuffer content = new StringBuffer ( 28 "Dynamic content from Intro ContentProvider: "); 29 content.append("Current time is: "); 30 content.append(new Date(System.currentTimeMillis())); 31 return content.toString(); 32 } 33 34 public void createContent(String id, Element parent) { 35 Document dom = parent.getOwnerDocument(); 36 Element para = dom.createElement("p"); 37 para.setAttribute("id", "someDynamicContentId"); 38 para.appendChild(dom.createTextNode(getCurrentTimeString())); 39 parent.appendChild(para); 40 41 } 42 43 44 public void dispose() { 45 46 } 47 48 49 50 } 51 | Popular Tags |