| /******************************************************************************* |
| * Copyright (c) 2008 Angelo Zerr and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation |
| *******************************************************************************/ |
| package org.akrogen.tkui.css.uiforms.engine.html; |
| |
| |
| public class CSSFormTextTest { |
| public static void main(String[] args) { |
| try { |
| // Display display = new Display(); |
| // FormToolkit toolkit = new FormToolkit(display); |
| // |
| // // Create SWT CSS Engine |
| // CSSEngine engine = new CSSSWTEngineImpl(display); |
| // // Parse style sheet |
| // engine.parseStyleSheet(new StringReader( |
| // "Label {color:red;} " |
| // + "FormText {color:white;background-color:#2BAFFA;font-size:11;}" |
| // + "Text {background-color:green;}")); |
| // |
| // /*--- Start UI SWT ---*/ |
| // Shell shell = new Shell(display, SWT.SHELL_TRIM); |
| // FillLayout layout = new FillLayout(); |
| // shell.setLayout(layout); |
| // |
| // Form form = toolkit.createForm(shell); |
| // form.setText("Hello, Eclipse Forms"); |
| // Composite body = form.getBody(); |
| // layout = new FillLayout(); |
| // body.setLayout(layout); |
| // |
| // // Label |
| // Label label1 = toolkit.createLabel(body, "bla bla bla"); |
| // |
| // // Text |
| // Text text1 = toolkit.createText(body, "bla bla bla"); |
| // |
| // FormText formText = toolkit.createFormText(body, true); |
| // formText.setText( |
| // "<form>" |
| // + "<p><img href=\"eclipse\"/> Eclipse Projects: </p>" |
| // + "<li><b>Platform</b> - Eclipse frameworks</li>" |
| // + "<li><b>JDT</b> - Java development tools</li>" |
| // + "<li><b>PDE</b> - Plug-in development environment</li>" |
| // + "</form>", |
| // true, |
| // true); |
| // |
| // /*--- End UI SWT ---*/ |
| // |
| // // Apply Styles |
| // engine.applyStyles(body, true); |
| // |
| // shell.pack(); |
| // shell.open(); |
| // |
| // while (!shell.isDisposed()) { |
| // if (!display.readAndDispatch()) |
| // display.sleep(); |
| // } |
| // |
| // display.dispose(); |
| |
| } catch (Exception e) { |
| e.printStackTrace(); |
| } |
| } |
| } |