private boolean initialized = false; | private boolean initialized = false; | ||||
private static final String WELCOME_TEXT = | private static final String WELCOME_TEXT = | ||||
"<h3>Welcome to the Millstone feature tour!</h3>" | |||||
+ "In this Millstone application you may view a demonstration of some of its " | |||||
+ "features.<br/>" | |||||
"<h3>Welcome to the IT Mill Toolkit feature tour!</h3>" | |||||
+ "In this application you may view and play with some features of IT Mill Toolkit.<br/>" | |||||
+ "Most of the features can be tested online and include simple example of their " | + "Most of the features can be tested online and include simple example of their " | ||||
+ "usage associated with it.<br/><br/>" | + "usage associated with it.<br/><br/>" | ||||
+ "Start your tour by selecting features from the list on the left.<br/><br/>" | + "Start your tour by selecting features from the list on the left.<br/><br/>" | ||||
+ "For more information, point your browser to: <a href=\"http://www.millstone.org\"" | |||||
+ " target=\"_new\">www.millstone.org</a>"; | |||||
+ "For more information, point your browser to: <a href=\"http://www.itmill.com\"" | |||||
+ " target=\"_new\">www.itmill.com</a>"; | |||||
public void attach() { | public void attach() { | ||||
"", | "", | ||||
new ClassResource( | new ClassResource( | ||||
getClass(), | getClass(), | ||||
"millstone-logo.gif", | |||||
"m-bullet-blue.gif", | |||||
getApplication())); | getApplication())); | ||||
welcomePanel.addComponent(welcome); | welcomePanel.addComponent(welcome); | ||||
welcomePanel.addComponent(greeting); | welcomePanel.addComponent(greeting); | ||||
registerFeature("/Data Model/Containers", new FeatureContainers()); | registerFeature("/Data Model/Containers", new FeatureContainers()); | ||||
registerFeature("/Data Model/Validators", new FeatureValidators()); | registerFeature("/Data Model/Validators", new FeatureValidators()); | ||||
registerFeature("/Data Model/Buffering", new FeatureBuffering()); | registerFeature("/Data Model/Buffering", new FeatureBuffering()); | ||||
registerFeature( | |||||
"/Terminal/Server Initiated Events", | |||||
new FeatureServerEvents()); | |||||
registerFeature( | registerFeature( | ||||
"/Terminal/Parameters and URI Handling", | "/Terminal/Parameters and URI Handling", | ||||
new FeatureParameters()); | new FeatureParameters()); | ||||
layout.removeComponent(1, 0); | layout.removeComponent(1, 0); | ||||
layout.addComponent(currentFeature, 1, 0); | layout.addComponent(currentFeature, 1, 0); | ||||
getWindow().setCaption( | getWindow().setCaption( | ||||
"Millstone Features / " | |||||
"IT Mill Toolkit Features / " | |||||
+ features.getContainerProperty(id, "name")); | + features.getContainerProperty(id, "name")); | ||||
} | } | ||||
} | } |
* @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | ||||
*/ | */ | ||||
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "<p>Millstone data model provides interface for implementing " | |||||
return "<p>IT Mill Toolkit data model provides interface for implementing " | |||||
+ "buffering in data components. The basic idea is that a component " | + "buffering in data components. The basic idea is that a component " | ||||
+ "reading their state from data source can implement " | + "reading their state from data source can implement " | ||||
+ "Buffered-interface, for storing the value internally. " | + "Buffered-interface, for storing the value internally. " |
* @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | ||||
*/ | */ | ||||
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "In Millstone, boolean input values are represented by buttons. " | |||||
return "In IT Mill Toolkit, boolean input values are represented by buttons. " | |||||
+ "Buttons may function either as a push buttons or switches. (checkboxes)<br/><br/>" | + "Buttons may function either as a push buttons or switches. (checkboxes)<br/><br/>" | ||||
+ "Button can be directly connected to any method of an object, which " | + "Button can be directly connected to any method of an object, which " | ||||
+ "is an easy way to trigger events: <code> new Button(\"Play\", myPiano \"playIt\")</code>. " | + "is an easy way to trigger events: <code> new Button(\"Play\", myPiano \"playIt\")</code>. " |
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "<p>Container is the most advanced of the data " | return "<p>Container is the most advanced of the data " | ||||
+ "model supported by Millstone. It provides a very flexible " | |||||
+ "model supported by IT Mill Toolkit. It provides a very flexible " | |||||
+ "way of managing set of items that share common properties. Each " | + "way of managing set of items that share common properties. Each " | ||||
+ "item is identified by an item id. " | + "item is identified by an item id. " | ||||
+ "Properties can be requested from container with item " | + "Properties can be requested from container with item " |
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "<p>Representing Dates and times and providing a way to select " | return "<p>Representing Dates and times and providing a way to select " | ||||
+ "or enter some specific date and/or time is an typical need in " | + "or enter some specific date and/or time is an typical need in " | ||||
+ "data-entry userinterfaces. Millstone provides a DateField " | |||||
+ "data-entry userinterfaces. IT Mill Toolkit provides a DateField " | |||||
+ "component that is intuitive to use and yet controllable through " | + "component that is intuitive to use and yet controllable through " | ||||
+ "its properties.</p>" | + "its properties.</p>" | ||||
+ "<p>The calendar-style allows point-and-click selection "+ | + "<p>The calendar-style allows point-and-click selection "+ |
"source", | "source", | ||||
new Object[] { | new Object[] { | ||||
null, | null, | ||||
new ClassResource("millstone-logo.gif", getApplication())}, | |||||
new Object[] { "null", "Millstone logo" }); | |||||
new ClassResource("m-bullet-blue.gif", getApplication())}, | |||||
new Object[] { "null", "IT Mill (m)" }); | |||||
p.addProperties("Embedded Properties", ap); | p.addProperties("Embedded Properties", ap); | ||||
p.getField("standby").setDescription( | p.getField("standby").setDescription( | ||||
"The text to display while loading the object."); | "The text to display while loading the object."); |
} | } | ||||
} | } | ||||
/* This Millstone sample code is public domain. * | |||||
* For more information see www.millstone.org. */ |
} | } | ||||
} | } | ||||
} | } | ||||
/* This Millstone sample code is public domain. * | |||||
* For more information see www.millstone.org. */ |
} | } | ||||
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "<p>Millstone data model is one of the core concepts " | |||||
return "<p>IT Mill Toolkti data model is one of the core concepts " | |||||
+ "in the library and Property-interface is the base of that " | + "in the library and Property-interface is the base of that " | ||||
+ "model. Property provides standardized API for a singe data object " | + "model. Property provides standardized API for a singe data object " | ||||
+ "that can be getted and setted. A property is always typed, but can optionally " | + "that can be getted and setted. A property is always typed, but can optionally " | ||||
+ "editor and viewer classes. Typically this is used to connect different " | + "editor and viewer classes. Typically this is used to connect different " | ||||
+ "data sources to UI components for editing and viewing their contents.</p>" | + "data sources to UI components for editing and viewing their contents.</p>" | ||||
+ "<p>Properties can be utilized either by implementing the interface " | + "<p>Properties can be utilized either by implementing the interface " | ||||
+ "or by using some of the existing property implementations. Millstone " | |||||
+ "or by using some of the existing property implementations. IT Mill Toolkit " | |||||
+ "includes Property interface implementations for " | + "includes Property interface implementations for " | ||||
+ "arbitrary function pairs or Bean-properties as well as simple object " | + "arbitrary function pairs or Bean-properties as well as simple object " | ||||
+ "properties.</p>" | + "properties.</p>" |
"s.addItem(\"Volvo\");\n"; | "s.addItem(\"Volvo\");\n"; | ||||
} | } | ||||
/** | /** | ||||
* @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | ||||
*/ | */ |
/* ************************************************************************* | |||||
IT Mill Toolkit | |||||
Development of Browser User Intarfaces Made Easy | |||||
Copyright (C) 2000-2006 IT Mill Ltd | |||||
************************************************************************* | |||||
This product is distributed under commercial license that can be found | |||||
from the product package on license/license.txt. Use of this product might | |||||
require purchasing a commercial license from IT Mill Ltd. For guidelines | |||||
on usage, see license/licensing-guidelines.html | |||||
************************************************************************* | |||||
For more information, contact: | |||||
IT Mill Ltd phone: +358 2 4802 7180 | |||||
Ruukinkatu 2-4 fax: +358 2 4802 7181 | |||||
20540, Turku email: info@itmill.com | |||||
Finland company www: www.itmill.com | |||||
Primary source for information and releases: www.itmill.com | |||||
********************************************************************** */ | |||||
package com.itmill.toolkit.demo.features; | |||||
import java.net.MalformedURLException; | |||||
import java.net.URL; | |||||
import com.itmill.toolkit.terminal.ExternalResource; | |||||
import com.itmill.toolkit.ui.*; | |||||
public class FeatureServerEvents extends Feature { | |||||
protected String getTitle() { | |||||
return "Server Events"; | |||||
} | |||||
protected Component getDemoComponent() { | |||||
OrderedLayout l = new OrderedLayout(); | |||||
l.addComponent( | |||||
new Label( | |||||
"<h3>Multiplayer GO-Game</h3><p>For demonstration, see GO-Game example application. The application implements a " | |||||
+ "multi-player board game, where the moved by one player are immediately reflected to " | |||||
+ "another player.</p>" | |||||
+ "<p>Updating another players screen is totally automatic, and the programmed " | |||||
+ "does not need to be avare when the refresh requests are sent to screen by the server. In " | |||||
+ "web adapter the requests are passed through open HTTP-connection as java-script fragments " | |||||
+ "that update the windows that need repainting.</p>", | |||||
Label.CONTENT_UIDL)); | |||||
URL goUrl = null; | |||||
try { | |||||
goUrl = new URL(getApplication().getURL(), "../go/"); | |||||
} catch (MalformedURLException e) { | |||||
} | |||||
if (goUrl != null) { | |||||
Link link = new Link("Start GO-Game", new ExternalResource(goUrl)); | |||||
link.setTargetName("gogame"); | |||||
link.setTargetBorder(Link.TARGET_BORDER_NONE); | |||||
l.addComponent(link); | |||||
} | |||||
l.addComponent( | |||||
new Label( | |||||
"<h3>Chat example</h3><p>For some purposes it might be better to create your own "+ | |||||
"stream. The easiest way of creating a continuous stream for "+ | |||||
"simple purposes is to use StreamResource-class. See chat "+ | |||||
"example below, how this technique can be used for creation "+ | |||||
"of simple chat program.</p>", | |||||
Label.CONTENT_UIDL)); | |||||
URL chatUrl = null; | |||||
try { | |||||
chatUrl = new URL(getApplication().getURL(), "../chat/"); | |||||
} catch (MalformedURLException e) { | |||||
} | |||||
if (goUrl != null) { | |||||
Link link = new Link("Start chat", new ExternalResource(chatUrl)); | |||||
link.setTargetName("chat"); | |||||
link.setTargetBorder(Link.TARGET_BORDER_NONE); | |||||
l.addComponent(link); | |||||
} | |||||
return l; | |||||
} | |||||
protected String getDescriptionXHTML() { | |||||
return "<p>Millstone component framework supports both transactional and " | |||||
+ "continuous terminals. This means that either the events from the " | |||||
+ "terminal are sent together as transactions or the events are " | |||||
+ "passed immediately when the user initiates them through the user " | |||||
+ "interface. </p>" | |||||
+ "<p>WebAdapter converts the Millstone applications to web-environment " | |||||
+ "by transferring the events as HTTP-parameters and drawing the " | |||||
+ "pages after the components have received and handled the events. " | |||||
+ "In the web-environment the web browser is always the active party that " | |||||
+ "starts the transaction. This is problematic when the server should " | |||||
+ "notify the user about changes without HTTP-request initiated by the " | |||||
+ "user.</p>" | |||||
+ "<h3>WebAdapter Solution</h3>" | |||||
+ "<p>Millstone solves the problem by combining component frameworks " | |||||
+ "ability to automatically notify terminal adapter about all visual " | |||||
+ "changes to HTTP-protocols ability to handle very long and slow " | |||||
+ "page downloads. WebAdapter provides the web browser with " | |||||
+ "possibility to keep special server command stream open all the time. " | |||||
+ "All the visual updates that happen in components causes the " | |||||
+ "WebAdapter to automatically creates JavaScript that updates the " | |||||
+ "corresponding web browser window and to send the script immediately " | |||||
+ "to browser for execution.</p>" | |||||
+ "<p>The mechanism is fairly complicated, but using the mechanism in " | |||||
+ "any Millstone application is trivial. Application just needs " | |||||
+ "to make sure that WebBrowser opens a hidden iframe to location: " | |||||
+ "<code>?SERVER_COMMANDS=1</code>.</p>" | |||||
+ "<p>See the example of the usage on Demo-tab to get better understanding " | |||||
+ "of the mechanism. If you read the example's source code, you will notice that " | |||||
+ "the program does not contain any support for sending events to client, as " | |||||
+ "it is completely automatic.</p>"; | |||||
} | |||||
protected String getImage() { | |||||
return "serverevents.jpg"; | |||||
} | |||||
} |
* @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML() | ||||
*/ | */ | ||||
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "<p>Millstone combines the logic of both the single line text-entry field and the multi-line " | |||||
return "<p>TextField combines the logic of both the single line text-entry field and the multi-line " | |||||
+ "text-area into one component. " | + "text-area into one component. " | ||||
+ "As with all Data-components of Millstone, the Textfield can also be bound to an " | |||||
+ "As with all Data-components of IT Mill Toolkit, the TextField can also be bound to an " | |||||
+ "underlying data source, both directly or in a buffered (asynchronous) " | + "underlying data source, both directly or in a buffered (asynchronous) " | ||||
+ "mode. In buffered mode its background color will change to indicate " | + "mode. In buffered mode its background color will change to indicate " | ||||
+ "that the value has changed but is not committed.</p>" | + "that the value has changed but is not committed.</p>" |
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "<p>A tree is a natural way to represent datasets that have" | return "<p>A tree is a natural way to represent datasets that have" | ||||
+ " hierarchical relationships, such as filesystems, message " | + " hierarchical relationships, such as filesystems, message " | ||||
+ "threads or... family trees. Millstone features a versatile " | |||||
+ "threads or... family trees. IT Mill Toolkit features a versatile " | |||||
+ "and powerful Tree component that works much like the tree components " | + "and powerful Tree component that works much like the tree components " | ||||
+ "of most modern operating systems. </p>" | + "of most modern operating systems. </p>" | ||||
+ "<p>The most prominent use of the Tree component is to " | + "<p>The most prominent use of the Tree component is to " |
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return | return | ||||
"<p>Millstone contains simple, yet powerful validation interface, "+ | |||||
"<p>IT Mill Toolkit contains simple, yet powerful validation interface, "+ | |||||
"that consists of two parts: Validator and Validatable. Validator is "+ | "that consists of two parts: Validator and Validatable. Validator is "+ | ||||
"any class that can check validity of an Object. Validatable is "+ | "any class that can check validity of an Object. Validatable is "+ | ||||
"a class with configurable validation. "+ | "a class with configurable validation. "+ |
} | } | ||||
protected String getDescriptionXHTML() { | protected String getDescriptionXHTML() { | ||||
return "The window support of Millstone allows for opening and closing windows, " | |||||
return "The window support in IT Mill Toolkit allows for opening and closing windows, " | |||||
+ "refreshing one window from another (for asynchronous terminals), " | + "refreshing one window from another (for asynchronous terminals), " | ||||
+ "resizing windows and scrolling window content. " | + "resizing windows and scrolling window content. " | ||||
+ "There are also a number of preset window border styles defined by " | + "There are also a number of preset window border styles defined by " |
extends com.itmill.toolkit.Application { | extends com.itmill.toolkit.Application { | ||||
public void init() { | public void init() { | ||||
Window main = new Window("Millstone Features Tour"); | |||||
Window main = new Window("IT Mill Toolkit Features Tour"); | |||||
setMainWindow(main); | setMainWindow(main); | ||||
main.addComponent(new FeatureBrowser()); | main.addComponent(new FeatureBrowser()); | ||||
} | } |
"Those components that have internal state that can be written are settable to readOnly-mode," | "Those components that have internal state that can be written are settable to readOnly-mode," | ||||
+ " where the object can only be read, not written."); | + " where the object can only be read, not written."); | ||||
set.getField("componentError").setDescription( | set.getField("componentError").setDescription( | ||||
"Millstone supports extensive error reporting. One part of the error reporting are component" | |||||
"IT Mill Toolkit supports extensive error reporting. One part of the error reporting are component" | |||||
+ " errors that can be controlled by the programmer. This example only contains couple of " | + " errors that can be controlled by the programmer. This example only contains couple of " | ||||
+ "sample errors; to get the full picture, read browse ErrorMessage-interface implementors " | + "sample errors; to get the full picture, read browse ErrorMessage-interface implementors " | ||||
+ "API documentation."); | + "API documentation."); |