public class SimplestApplication extends com.itmill.toolkit.Application {
+ @Override
public void init() {
final Window main = new Window("Simplest Application window");
setMainWindow(main);
RandomComponents randomComponents = new RandomComponents();
+ @Override
public void init() {
createNewView();
}
}
public void buttonClick(ClickEvent event) {
- if (event.getButton() == create)
+ if (event.getButton() == create) {
create();
- else if (event.getButton() == remove) {
+ } else if (event.getButton() == remove) {
main.removeAllComponents();
close.removeListener(this);
remove.removeListener(this);
/**
* Create complex layouts with components and listeners.
*/
+ @Override
public void create() {
count++;
// remove old stressLayout, all dependant components should be now
// allowed for garbage collection.
- if (stressLayout != null)
+ if (stressLayout != null) {
main.removeComponent(stressLayout);
+ }
// create new stress layout
stressLayout = randomComponents
String clazz = st[3].getClassName() + ".java";
key = "(" + clazz + ":" + line + ")" + " " + methodName;
Integer value = (Integer) classMethodCallCounter.get(key);
- if (value == null)
+ if (value == null) {
value = new Integer(1);
- else
+ } else {
value = new Integer(value.intValue() + 1);
+ }
classMethodCallCounter.put(key, value);
return value.intValue() + ": " + key;
} catch (Exception e) {
public void add(int type, String message) {
String source = getSource();
if (type >= debug) {
- if (showClassInformation)
+ if (showClassInformation) {
System.out.println(source + ": " + message);
- else
+ } else {
System.out.println(message);
+ }
}
}
VERSION_BUILD = digits[2];
}
+ @Override
public void init(javax.servlet.ServletConfig servletConfig)
throws javax.servlet.ServletException {
super.init(servletConfig);
}
+ @Override
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
Writer w = response.getWriter();
String p = "";
p += "<p>StatusServlet " + dfHuman.format(new Date()) + "</p>";
- for (int i = 0; i < 30; i++)
+ for (int i = 0; i < 30; i++) {
System.gc();
+ }
long inUse = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
.freeMemory());
p += "<p>Memory:<br />\n<memused>" + inUse
* is possible if the commit operation triggers more than
* one error at the same time.
*/
+ @Override
public final Throwable getCause() {
if (causes.length == 0) {
return null;
public Item addItem(Object itemId) throws UnsupportedOperationException {
// Null ids are not accepted
- if (itemId == null)
+ if (itemId == null) {
throw new NullPointerException("Container item id can not be null");
+ }
final Item item = container.addItem(itemId);
if (!hierarchical && item != null) {
}
+ @Override
public boolean equals(Object obj) {
return obj == listener || (obj != null && obj.equals(listener));
}
+ @Override
public int hashCode() {
return listener.hashCode();
}
}
+ @Override
public boolean equals(Object obj) {
return obj == listener || (obj != null && obj.equals(listener));
}
+ @Override
public int hashCode() {
return listener.hashCode();
}
*
* @return A locally unique hash-code as integer
*/
+ @Override
public int hashCode() {
return file.hashCode() ^ FilesystemContainer.this.hashCode();
}
* @return <code>true</code> if the given object is the same as this
* object, <code>false</code> if not
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof FileItem)) {
return false;
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
if ("".equals(file.getName())) {
return file.getAbsolutePath();
*
* @see com.itmill.toolkit.data.util.IndexedContainer#addItem()
*/
+ @Override
public Object addItem() {
final Object id = super.addItem();
if (id != null && !roots.contains(id)) {
* @see
* com.itmill.toolkit.data.util.IndexedContainer#addItem(java.lang.Object)
*/
+ @Override
public Item addItem(Object itemId) {
final Item item = super.addItem(itemId);
if (item != null) {
*
* @see com.itmill.toolkit.data.util.IndexedContainer#removeAllItems()
*/
+ @Override
public boolean removeAllItems() {
final boolean success = super.removeAllItems();
* com.itmill.toolkit.data.util.IndexedContainer#removeItem(java.lang.Object
* )
*/
+ @Override
public boolean removeItem(Object itemId) {
final boolean success = super.removeItem(itemId);
*
* @return <code>String</code> representation of the Item contents
*/
+ @Override
public String toString() {
String retValue = "";
*
* @return A locally unique hash-code as integer
*/
+ @Override
public int hashCode() {
return itemId.hashCode();
}
* @return <code>true</code> if the given object is the same as this
* object, <code>false</code> if not
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null
|| !obj.getClass().equals(IndexedContainerItem.class)) {
* @return <code>String</code> representation of the value stored in the
* Property
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value == null) {
*
* @return A locally unique hash-code as integer
*/
+ @Override
public int hashCode() {
return itemId.hashCode() ^ propertyId.hashCode();
}
* @return <code>true</code> if the given object is the same as this
* object, <code>false</code> if not
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null
|| !obj.getClass().equals(IndexedContainerProperty.class)) {
* @throws CloneNotSupportedException
* if an object cannot be cloned. .
*/
+ @Override
public Object clone() throws CloneNotSupportedException {
// Creates the clone
*
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return super.equals(obj);
}
this.onlyMatchPrefix = onlyMatchPrefix;
}
+ @Override
public boolean equals(Object obj) {
// Only ones of the objects of the same class can be equal
return true;
}
+ @Override
public int hashCode() {
return (propertyId != null ? propertyId.hashCode() : 0)
^ (filterString != null ? filterString.hashCode() : 0);
*
* @return String representation of the value stored in the Property
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value == null) {
/**
* @see java.lang.Throwable#getCause()
*/
+ @Override
public Throwable getCause() {
return cause;
}
* @return <code>String</code> representation of the value stored in the
* ObjectProperty
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value != null) {
* @return If the datasource returns null, this is null. Otherwise this is
* String given by format().
*/
+ @Override
public String toString() {
Object value = dataSource == null ? false : dataSource.getValue();
if (value == null) {
public boolean addItemProperty(Object id, Property property) {
// Null ids are not accepted
- if (id == null)
+ if (id == null) {
throw new NullPointerException("Item property id can not be null");
+ }
// Cant add a property twice
if (map.containsKey(id)) {
*
* @return <code>String</code> representation of the Item contents
*/
+ @Override
public String toString() {
String retValue = "";
*
* @see java.lang.Object#clone()
*/
+ @Override
public Object clone() throws CloneNotSupportedException {
final PropertysetItem npsi = new PropertysetItem();
* otherwise <code>false</code>.
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof PropertysetItem)) {
* @return the hash code value.
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return (list == null ? 0 : list.hashCode())
*
* @see #close()
*/
+ @Override
public void finalize() {
try {
close();
// The embedded page
Embedded emb = new Embedded();
+ @Override
public void init() {
// Create and set main window
final Window browser = new Window("IT Mill Browser");
private TextField text;
+ @Override
public void init() {
final Window w = new Window("Buffered UI components demo");
*/\r
public class CachingDemo extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window("Client-side caching example");\r
layout.setMargin(true);\r
l = new Label(\r
"The first time you change to this tab, this label is very slow to produce (server-side).<br/> However, it will seem fast the second time you change to this tab, because it has not changed and is cached client-side.") {\r
+ @Override\r
public void paintContent(PaintTarget target) throws PaintException {\r
try {\r
Thread.sleep(3000);\r
private final GridLayout layout = new GridLayout(4, 5);
// Application initialization creates UI and connects it to business logic
+ @Override
public void init() {
// Place the layout to a floating dialog inside the browser main window
* com.itmill.toolkit.service.Application class. It will be automatically
* called by the framework when a user accesses the application.
*/
+ @Override
public void init() {
/*
* com.itmill.toolkit.service.Application class. It will be automatically
* called by the framework when a user accesses the application.
*/
+ @Override
public void init() {
/*
private TextField f;
+ @Override
public void init() {
final Window w = new Window("Keyboard shortcuts demo");
loki = new VerticalLayout();
main.addComponent(loki);
- main.setExpandRatio(loki,1.0f);
+ main.setExpandRatio(loki, 1.0f);
w.addActionHandler(this);
* com.itmill.toolkit.service.Application class. It will be automatically
* called by the framework when a user accesses the application.
*/
+ @Override
public void init() {
// Create new window for the application and give the window a visible.
Link portletMax = new Link();\r
Link someAction = null;\r
\r
+ @Override\r
public void init() {\r
main = new Window();\r
setMainWindow(main);\r
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window main = new Window("Select demo");
setMainWindow(main);
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window main = new Window("Table demo");
setMainWindow(main);
servlets.put("Notification demo", "NotificationDemo/");
}
+ @Override
public void init() {
// Create new window for the application and give the window a visible.
}
/** The property value of the field is an Integer. */
+ @Override
public Class getType() {
return String.class;
}
/** Tag is the UIDL element name for client-server communications. */
+ @Override
public String getTag() {
return "colorpicker";
}
}
/** Paint (serialize) the component for the client. */
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// Superclass writes any common attributes in the paint target.
super.paintContent(target);
}
/** Deserialize changes received from client. */
+ @Override
public void changeVariables(Object source, Map variables) {
// Sets the currently selected color
if (variables.containsKey("colorname") && !isReadOnly()) {
/* Another component. */
Label colorname;
+ @Override
public void init() {
setMainWindow(main);
\r
public class ColorPickerWidgetSet extends DefaultWidgetSet {\r
/** Resolves UIDL tag name to widget class. */\r
+ @Override\r
protected Class resolveWidgetType(UIDL uidl) {\r
final String tag = uidl.getTag();\r
- if ("colorpicker".equals(tag))\r
+ if ("colorpicker".equals(tag)) {\r
return IColorPicker.class;\r
+ }\r
\r
// Let the DefaultWidgetSet handle resolution of default widgets\r
return super.resolveWidgetType(uidl);\r
}\r
\r
/** Creates a widget instance according to its class object. */\r
+ @Override\r
public Paintable createWidget(UIDL uidl) {\r
final Class type = resolveWidgetType(uidl);\r
- if (IColorPicker.class == type)\r
+ if (IColorPicker.class == type) {\r
return new IColorPicker();\r
+ }\r
\r
// Let the DefaultWidgetSet handle creation of default widgets\r
return super.createWidget(uidl);\r
// Set the button background colors.
DOM.setStyleAttribute(button.getElement(), "background",
- colors[colornum]);
+ colors[colornum]);
// For dark colors, the button label must be in white.
- if ("black navy maroon blue purple".indexOf(colors[colornum]) != -1)
- DOM.setStyleAttribute(button.getElement(), "color", "white");
+ if ("black navy maroon blue purple".indexOf(colors[colornum]) != -1) {
+ DOM
+ .setStyleAttribute(button.getElement(), "color",
+ "white");
+ }
}
}
// before the widget has been added to the horizontal panel.
final Element panelcell = DOM.getParent(currentcolor.getElement());
DOM.setElementProperty(panelcell, "className",
- "colorpicker-currentcolorbox");
+ "colorpicker-currentcolorbox");
// Set initial color. This will be overridden with the value read from
// server.
// Obtain the DOM elements. This assumes that the <td> element
// of the HorizontalPanel is the parent of the label element.
final Element nameelement = currentcolor.getElement();
- final Element cell = DOM.getParent(nameelement);
+ final Element cell = DOM.getParent(nameelement);
// Give feedback by changing the background color
- DOM.setStyleAttribute(cell, "background", newcolor);
+ DOM.setStyleAttribute(cell, "background", newcolor);
DOM.setStyleAttribute(nameelement, "background", newcolor);
- if ("black navy maroon blue purple".indexOf(newcolor) != -1)
+ if ("black navy maroon blue purple".indexOf(newcolor) != -1) {
DOM.setStyleAttribute(nameelement, "color", "white");
- else
+ } else {
DOM.setStyleAttribute(nameelement, "color", "black");
+ }
}
}
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
// This call should be made first. Ensure correct implementation,
// and let the containing layout manage caption, etc.
- if (client.updateComponent(this, uidl, true))
+ if (client.updateComponent(this, uidl, true)) {
return;
+ }
// Save reference to server connection object to be able to send
// user interaction later
}
/** Override the method to communicate the new value to server. */
+ @Override
public void setColor(String newcolor) {
// Ignore if no change
- if (newcolor.equals(currentcolor.getText()))
+ if (newcolor.equals(currentcolor.getText())) {
return;
+ }
// Let the original implementation to do whatever it needs to do
super.setColor(newcolor);
// Updating the state to the server can not be done before
// the server connection is known, i.e., before updateFromUIDL()
// has been called.
- if (uidlId == null || client == null)
+ if (uidlId == null || client == null) {
return;
+ }
// Communicate the user interaction parameters to server. This call will
// initiate an AJAX request to the server.
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window main = new Window("Calendar demo");
setMainWindow(main);
* Gets the components UIDL tag string. Don't add a JavaDoc comment here, we\r
* use the default documentation from implemented interface.\r
*/\r
+ @Override\r
public String getTag() {\r
return TAGNAME;\r
}\r
* the resolution to set.\r
* @see com.itmill.toolkit.ui.DateField#setResolution(int)\r
*/\r
+ @Override\r
public void setResolution(int resolution) {\r
if (resolution != RESOLUTION_DAY && resolution != RESOLUTION_HOUR) {\r
throw new IllegalArgumentException();\r
* @throws PaintException\r
* if the paint operation failed.\r
*/\r
+ @Override\r
public void paintContent(PaintTarget target) throws PaintException {\r
super.paintContent(target);\r
\r
private Object itemMarkerXPropertyId = new Object();\r
private Object itemMarkerYPropertyId = new Object();\r
\r
+ @Override\r
public String getTag() {\r
return "googlemap";\r
}\r
\r
+ @Override\r
public void paintContent(PaintTarget target) throws PaintException {\r
super.paintContent(target);\r
// Add size info as variables\r
\r
private GoogleMap map;\r
\r
+ @Override\r
public void init() {\r
//\r
db = new SampleDB();\r
import com.itmill.toolkit.terminal.gwt.client.UIDL;\r
\r
public class ReservationWidgetSet extends DefaultWidgetSet {\r
+ @Override\r
public Paintable createWidget(UIDL uidl) {\r
final Class type = resolveWidgetType(uidl);\r
if (IGoogleMap.class == type) {\r
return super.createWidget(uidl);\r
}\r
\r
+ @Override\r
protected Class resolveWidgetType(UIDL uidl) {\r
final String tag = uidl.getTag();\r
if ("googlemap".equals(tag)) {\r
});\r
}\r
\r
+ @Override\r
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
super.updateFromUIDL(uidl, client);\r
// We want to draw our own hour list\r
protected User user;
+ @Override
public void init() {
final Window w = new Window("Simple Reserver");
w.addStyleName("simplereserver");
return db;
}
+ @Override
public Object getUser() {
if (getContext() instanceof PortletApplicationContext) {
try {
super(caption, resource);
}
+ @Override
public String getTag() {
return TAG;
}
fireEvent(new LinkActivatedEvent(this, linkOpened));
}
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
}
}
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
if (!isReadOnly() && variables.containsKey("activated")) {
super(content, CONTENT_PREFORMATTED);
}
+ @Override
public String getTag() {
return TAG;
}
+ @Override
public void setContentMode(int contentMode) {
if (contentMode != Label.CONTENT_PREFORMATTED) {
throw new UnsupportedOperationException(
* May return null, if the example has no related resources.
* </p>
* <p>
- * The name of the NamedExternalResource will be shown in the UI. <br/> Note
- * that Javadoc should be referenced via {@link #getRelatedAPI()}.
+ * The name of the NamedExternalResource will be shown in the UI. <br/>
+ * Note that Javadoc should be referenced via {@link #getRelatedAPI()}.
* </p>
*
* @see #getThemeBase()
return SamplerApplication.getThemeBase();
}
+ @Override
public String toString() {
return getName();
}
}
}
+ @Override
public String getDescription() {
return desc;
}
+ @Override
public String getPathName() {
return pathname;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public String getIconName() {
return icon;
}
+ @Override
public APIResource[] getRelatedAPI() {
return null;
}
+ @Override
public Class[] getRelatedFeatures() {
return null;
}
+ @Override
public NamedExternalResource[] getRelatedResources() {
return null;
}
this.domainName = domainName;
}
+ @Override
public String getTag() {
return TAG;
}
requestRepaint();
}
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
target.addAttribute("trackerid", trackerId);
// used when trying to guess theme location
private static String APP_URL = null;
+ @Override
public void init() {
setTheme("sampler");
setMainWindow(new SamplerWindow());
}
// Supports multiple browser windows
+ @Override
public Window getWindow(String name) {
/*- REST code, using fragments
if (features.getFeatureByPath(name) != null) {
public class ProminentPrimaryAction extends Feature {
+ @Override
public String getDescription() {
return "A primary action is an action that is clearly the"
+ " default, and it should be visually more prominent"
+ " - don't force it if it's not obvious.";
}
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Button.class),
new APIResource(Link.class) };
}
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { ButtonPush.class, ButtonLink.class };
}
+ @Override
public NamedExternalResource[] getRelatedResources() {
return new NamedExternalResource[] {
public class ButtonLink extends Feature {
+ @Override
public String getDescription() {
return "A link-styled button.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Button.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { ButtonPush.class, ButtonSwitch.class,
LinkCurrentWindow.class, LinkNoDecorations.class,
FeatureSet.Links.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class ButtonPush extends Feature {
+ @Override
public String getDescription() {
return "A basic push-button.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Button.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { ButtonLink.class, ButtonSwitch.class,
ProminentPrimaryAction.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class ButtonSwitch extends Feature {
+ @Override
public String getDescription() {
return "A switch button.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Button.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { ButtonPush.class, ButtonLink.class,
ProminentPrimaryAction.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class Icons extends Feature {
-
+ @Override
public String getDescription() {
return "Most components can have an <i>icon</i>,"
+ " which is usually displayed next to the caption.<br/>"
+ " Beware of overuse, which will have the opposite effect.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Component.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
// TODO Auto-generated method stub
return null;
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class Tooltips extends Feature {
-
+ @Override
public String getDescription() {
return "Most components can have a <i>description</i>,"
+ " which is shown as a <i>\"tooltip\"</i>.<br/>"
+ " for that compoenent.)";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(AbstractComponent.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
// TODO Auto-generated method stub
return null;
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class LinkCurrentWindow extends Feature {
+ @Override
public String getDescription() {
return "An external link.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Link.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { LinkNoDecorations.class, LinkSizedWindow.class,
ButtonLink.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class LinkNoDecorations extends Feature {
+ @Override
public String getDescription() {
return "A link that opens a new window w/o decorations";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Link.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { LinkCurrentWindow.class, LinkSizedWindow.class,
ButtonLink.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class LinkSizedWindow extends Feature {
+ @Override
public String getDescription() {
return "A link that opens a small new window w/o decorations";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Link.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { LinkCurrentWindow.class, LinkNoDecorations.class,
ButtonLink.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
// TODO Auto-generated method stub
return null;
public class NotificationCustom extends Feature {
-
+ @Override
public String getDescription() {
return "Notifications are lightweight informational messages,"
+ " used to inform the user of various events.<br/>"
+ " and to the point.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Window.class),
new APIResource(Window.Notification.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { NotificationHumanized.class,
NotificationWarning.class, NotificationError.class,
NotificationTray.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
return new NamedExternalResource[] { new NamedExternalResource(
"Monolog Boxes and Transparent Messages",
public class NotificationError extends Feature {
-
+ @Override
public String getDescription() {
return "Notifications are lightweight informational messages,"
+ " used to inform the user of various events. The"
+ " can proceed to correct the situation.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Window.class),
new APIResource(Window.Notification.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { NotificationHumanized.class,
NotificationTray.class, NotificationWarning.class,
NotificationCustom.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
return null;
}
public class NotificationHumanized extends Feature {
-
+ @Override
public String getDescription() {
return "Notifications are lightweight informational messages,"
+ " used to inform the user of various events. The"
+ " safely ignore, once the application is familliar.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Window.class),
new APIResource(Window.Notification.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { NotificationTray.class, NotificationWarning.class,
NotificationError.class, NotificationCustom.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
return new NamedExternalResource[] { new NamedExternalResource(
"Monolog Boxes and Transparent Messages",
public class NotificationTray extends Feature {
-
+ @Override
public String getDescription() {
return "Notifications are lightweight informational messages,"
+ " used to inform the user of various events. The"
+ " (as opposed to being a direct result of the users last action.)";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Window.class),
new APIResource(Window.Notification.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { NotificationHumanized.class,
NotificationWarning.class, NotificationError.class,
NotificationCustom.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
return new NamedExternalResource[] { new NamedExternalResource(
"Monolog Boxes and Transparent Messages",
public class NotificationWarning extends Feature {
-
+ @Override
public String getDescription() {
return "Notifications are lightweight informational messages,"
+ " used to inform the user of various events. The"
+ " be made aware of, but are probably intentional.";
}
-
+ @Override
public APIResource[] getRelatedAPI() {
return new APIResource[] { new APIResource(Window.class),
new APIResource(Window.Notification.class) };
}
-
+ @Override
public Class[] getRelatedFeatures() {
return new Class[] { NotificationHumanized.class,
NotificationTray.class, NotificationError.class,
NotificationCustom.class };
}
-
+ @Override
public NamedExternalResource[] getRelatedResources() {
return new NamedExternalResource[] { new NamedExternalResource(
"Monolog Boxes and Transparent Messages",
public class SamplerWidgetSet extends DefaultWidgetSet {
+ @Override
public Paintable createWidget(UIDL uidl) {
final Class classType = resolveWidgetType(uidl);
if (IGoogleAnalytics.class == classType) {
}
}
+ @Override
protected Class resolveWidgetType(UIDL uidl) {
final String tag = uidl.getTag();
if ("googleanalytics".equals(tag)) {
return !listening || opened;
}
+ @Override
public void onClick(Widget sender) {
if (sendVariables()) {
}
}
+ @Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
// Ensure correct implementation,
// but don't let container manage caption etc.
super();
}
+ @Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client);
Element pre = getElement().getFirstChildElement();
.equals(this.method));
}
+ @Override
public int hashCode() {
int hash = 7;
return hash;
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
* is nonexistent or unknown.
* @see java.lang.Throwable#getCause()
*/
+ @Override
public Throwable getCause() {
return cause;
}
* @return the error message.
* @see java.lang.Throwable#getMessage()
*/
+ @Override
public String getMessage() {
return message;
}
/**
* @see java.lang.Throwable#toString()
*/
+ @Override
public String toString() {
String msg = super.toString();
if (cause != null) {
+ "</a><br>Close this window to shutdown the server.</center>"
+ "</html>");
link.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseClicked(MouseEvent e) {
BrowserLauncher.openBrowser(applicationUrl);
}
cancelButton.addActionListener(buttonListener);
frame.addWindowListener(new WindowAdapter() {
+ @Override
public void windowClosing(WindowEvent e) {
final Rectangle bounds = frame.getBounds();
frame.setTitle("Confirm close");
*
* @return String, comma separated list of error messages.
*/
+ @Override
public String toString() {
String retval = "[";
int pos = 0;
* separately (and components might have different default
* unit).
*/
+ @Deprecated
public void setWidth(float width);
/**
* but is error-prone since the unit must be set separately (and
* components might have different default unit).
*/
+ @Deprecated
public void setHeight(float height);
/**
* {@link #setWidth(String)} or {@link #setWidth(float, int)},
* which is less error-prone.
*/
+ @Deprecated
public void setWidthUnits(int units);
/**
* {@link #setHeight(String)} or {@link #setHeight(float, int)},
* which is less error-prone.
*/
+ @Deprecated
public void setHeightUnits(int units);
/**
* @return the cause.
* @see java.lang.Throwable#getCause()
*/
+ @Override
public Throwable getCause() {
return cause;
}
* <code>false</code> if not.
* @see java.lang.Object#equals(Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof ThemeResource
&& resourceID.equals(((ThemeResource) obj).resourceID);
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return resourceID.hashCode();
}
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return resourceID.toString();
}
}
/* Documented in superclass */
+ @Override
public String toString() {
return msg;
}
*
* @deprecated use resolveWidgetType instead
*/
+ @Deprecated
protected String resolveWidgetTypeName(UIDL uidl) {
Class type = resolveWidgetType(uidl);
return type.getName();
}
};
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
switch (DOM.eventGetType(event)) {
.getClientHeight() - 160);
}
+ @Override
public void setPixelSize(int width, int height) {
panel.setHeight((height - 20) + "px");
panel.setWidth((width - 2) + "px");
private MouseEventDetails() {
}
+ @Override
public String toString() {
return "" + button + DELIM + clientX + DELIM + clientY + DELIM + altKey
+ DELIM + ctrlKey + DELIM + metaKey + DELIM + shiftKey + DELIM
* Returns pixels available vertically for contained widget, including
* possible scrollbars.
*/
+ @Override
public int getHeight() {
return super.getHeight();
}
* Returns pixels available horizontally for contained widget, including
* possible scrollbars.
*/
+ @Override
public int getWidth() {
return super.getWidth();
}
return json.size() - 2;
}
+ @Override
public String toString() {
String s = "<" + getTag();
}
+ @Override
protected boolean isKeyboardNavigationEnabled(TreeItem currentItem) {
return false;
}
private static Timer lazySizeChangeTimer = new Timer() {
private boolean lazySizeChangeTimerScheduled = false;
+ @Override
public void run() {
componentSizeUpdated(latelyChangedWidgets);
latelyChangedWidgets.clear();
*
* @return true if IE
*/
+ @Deprecated
public static boolean isIE() {
return BrowserInfo.get().isIE();
}
*
* @return true if IE6
*/
+ @Deprecated
public static boolean isIE6() {
return BrowserInfo.get().isIE6();
}
* @deprecated use BrowserInfo class instead
* @return
*/
+ @Deprecated
public static boolean isIE7() {
return BrowserInfo.get().isIE7();
}
* @deprecated use BrowserInfo class instead
* @return
*/
+ @Deprecated
public static boolean isFF2() {
return BrowserInfo.get().isFF2();
}
}
}
+ @Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
rendering = true;
selectedUIDLItemIndex = -1;
rendering = false;
}
+ @Override
protected void renderTab(UIDL tabUidl, int index, boolean selected,
boolean hidden) {
StackItem item;
}
+ @Override
protected void selectTab(final int index, final UIDL contentUidl) {
StackItem item = stack.get(index);
if (index != activeTabIndex) {
}
}
+ @Override
public void setWidth(String width) {
if (this.width.equals(width)) {
return;
}
}
+ @Override
public void setHeight(String height) {
super.setHeight(height);
this.height = height;
}
}
+ @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
}
updateCaption(tabUidl);
}
+ @Override
public void onBrowserEvent(Event event) {
onSelectTab(this);
}
}
+ @Override
protected void clearPaintables() {
stack.clear();
clear();
return width == null || width.equals("");
}
+ @Override
protected Iterator getPaintableIterator() {
return paintables.iterator();
}
super(true);
}
+ @Override
public void onPopupClosed(PopupPanel sender, boolean autoClosed) {
super.onPopupClosed(sender, autoClosed);
hide();
sinkEvents(ITooltip.TOOLTIP_EVENTS);\r
}\r
\r
+ @Override\r
public void onBrowserEvent(Event event) {\r
super.onBrowserEvent(event);\r
if (client != null) {\r
add(date);\r
}\r
\r
+ @Override\r
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
super.updateFromUIDL(uidl, client);\r
date.updateCalendar();\r
return url;
}
+ @Override
public void setWidth(String width) {
this.width = width;
if (isDynamicHeight()) {
return height == null || height.equals("");
}
+ @Override
public void setHeight(String height) {
this.height = height;
super.setHeight(height);
}
+ @Override
protected void onDetach() {
// Force browser to fire unload event when component is detached from
// the view (IE doesn't do this automatically)
super.onDetach();
}
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if (DOM.eventGetType(event) == Event.ONLOAD) {
public int getTextboxPadding() {
if (textboxPadding < 0) {
- textboxPadding = Util.measureHorizontalPaddingAndBorder(tb.getElement(), 4);
+ textboxPadding = Util.measureHorizontalPaddingAndBorder(tb
+ .getElement(), 4);
}
return textboxPadding;
}
return owner;
}
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if (client != null) {
}
}
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if (owner != null) {
sinkEvents(ITooltip.TOOLTIP_EVENTS);
}
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if (event.getTypeInt() == Event.ONLOAD) {
select.setVisibleItemCount(VISIBLE_COUNT);
}
+ @Override
protected void buildOptions(UIDL uidl) {
select.setClient(client);
select.setMultipleSelect(isMultiselect());
}
}
+ @Override
protected Object[] getSelectedItems() {
final Vector selectedItemKeys = new Vector();
for (int i = 0; i < select.getItemCount(); i++) {
return selectedItemKeys.toArray();
}
+ @Override
public void onChange(Widget sender) {
final int si = select.getSelectedIndex();
if (si == -1 && !isNullSelectionAllowed()) {
}
}
+ @Override
public void setHeight(String height) {
select.setHeight(height);
super.setHeight(height);
}
+ @Override
public void setWidth(String width) {
select.setWidth(width);
super.setWidth(width);
}
+ @Override
protected void setTabIndex(int tabIndex) {
((TooltipListBox) optionsContainer).setTabIndex(tabIndex);
}
pntbl = s;
}
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if (client != null) {
}
}
+ @Override
public boolean equals(Object obj) {
if (!(obj instanceof IMarginInfo)) {
return false;
Element table = DOM.createTable();
Element tbody = DOM.createTBody();
- DOM.appendChild(this.getElement(), table);
+ DOM.appendChild(getElement(), table);
DOM.appendChild(table, tbody);
if (!subMenu) {
uidlId = uidl.getId();
// Empty the menu every time it receives new information
- if (!this.getItems().isEmpty()) {
- this.clearItems();
+ if (!getItems().isEmpty()) {
+ clearItems();
}
UIDL options = uidl.getChildUIDL(0);
if (collapseItems) {
int topLevelWidth = 0;
- int ourWidth = this.getOffsetWidth();
+ int ourWidth = getOffsetWidth();
int i = 0;
for (; i < getItems().size() && topLevelWidth < ourWidth; i++) {
topLevelWidth += item.getOffsetWidth();
}
- if (topLevelWidth > this.getOffsetWidth()) {
+ if (topLevelWidth > getOffsetWidth()) {
ArrayList toBeCollapsed = new ArrayList();
IMenuBar collapsed = new IMenuBar(true);
for (int j = i - 2; j < getItems().size(); j++) {
* com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt.user
* .client.Event)
*/
+ @Override
public void onBrowserEvent(Event e) {
super.onBrowserEvent(e);
}
+ @Override
protected void buildOptions(UIDL uidl) {
select.setClient(client);
select.setEnabled(!isDisabled() && !isReadonly());
}
+ @Override
protected Object[] getSelectedItems() {
final Vector selectedItemKeys = new Vector();
for (int i = 0; i < select.getItemCount(); i++) {
return selectedItemKeys.toArray();
}
+ @Override
public void onChange(Widget sender) {
if (select.isMultipleSelect()) {
}
}
+ @Override
public void setHeight(String height) {
select.setHeight(height);
super.setHeight(height);
}
+ @Override
public void setWidth(String width) {
select.setWidth(width);
super.setWidth(width);
}
+ @Override
protected void setTabIndex(int tabIndex) {
((TooltipListBox) optionsContainer).setTabIndex(tabIndex);
}
/*\r
* Return true if no elements were changed, false otherwise.\r
*/\r
+ @Override\r
protected void buildOptions(UIDL uidl) {\r
panel.clear();\r
for (final Iterator it = uidl.getChildIterator(); it.hasNext();) {\r
}\r
}\r
\r
+ @Override\r
protected Object[] getSelectedItems() {\r
return selectedKeys.toArray();\r
}\r
\r
+ @Override\r
public void onClick(Widget sender) {\r
super.onClick(sender);\r
if (sender instanceof CheckBox) {\r
}\r
}\r
\r
+ @Override\r
protected void setTabIndex(int tabIndex) {\r
for (Iterator iterator = panel.iterator(); iterator.hasNext();) {\r
if (isMultiselect()) {\r
// For some reason ONMOUSEOUT events are not always recieved, so we have
// to use ONMOUSEMOVE that doesn't target the popup
+ @Override
public boolean onEventPreview(Event event) {
Element target = DOM.eventGetTarget(event);
return super.onEventPreview(event);
}
+ @Override
public void hide() {
// Notify children with focus
if ((popupComponentWidget instanceof HasFocus)) {
super.hide();
}
+ @Override
public boolean remove(Widget w) {
unregisterPaintables();
}
}
+ @Override
protected void onAttach() {
super.onAttach();
if (pollerSuspendedDueDetach) {
}
}
+ @Override
protected void onDetach() {
super.onDetach();
poller.cancel();
pollerSuspendedDueDetach = true;
}
+ @Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (!visible) {
class Poller extends Timer {
+ @Override
public void run() {
client.sendPendingVariableChanges();
}
setWidget(new Label(textContent));
}
+ @Override
public void onBrowserEvent(Event event) {
System.out.println("CEll event: " + event.toString());
switch (DOM.eventGetType(event)) {
import com.google.gwt.user.client.Element;\r
import com.google.gwt.user.client.ui.ComplexPanel;\r
import com.google.gwt.user.client.ui.Widget;\r
-import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;\r
import com.itmill.toolkit.terminal.gwt.client.Util;\r
\r
/**\r
add(text);\r
}\r
\r
+ @Override\r
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
\r
int origRes = currentResolution;\r
return format.trim();\r
}\r
\r
+ @Override\r
public void setWidth(String newWidth) {\r
if (!"".equals(newWidth) && (width == null || !newWidth.equals(width))) {\r
if (BrowserInfo.get().isIE6()) {\r
panel.add(selections);\r
}\r
\r
+ @Override\r
protected void buildOptions(UIDL uidl) {\r
final boolean enabled = !isDisabled() && !isReadonly();\r
options.setMultipleSelect(isMultiselect());\r
\r
}\r
\r
+ @Override\r
protected Object[] getSelectedItems() {\r
final Vector selectedItemKeys = new Vector();\r
for (int i = 0; i < selections.getItemCount(); i++) {\r
return selectedIndexes;\r
}\r
\r
+ @Override\r
public void onClick(Widget sender) {\r
super.onClick(sender);\r
if (sender == add) {\r
}\r
}\r
\r
+ @Override\r
public void setHeight(String height) {\r
super.setHeight(height);\r
if ("".equals(height)) {\r
selections.setHeight("100%");\r
}\r
\r
+ @Override\r
public void setWidth(String width) {\r
super.setWidth(width);\r
if (!"".equals(width) && width != null) {\r
widthSet = true;\r
}\r
\r
+ @Override\r
protected void setTabIndex(int tabIndex) {\r
options.setTabIndex(tabIndex);\r
selections.setTabIndex(tabIndex);\r
* changes from UploadStarted event. Will be cleared on complete.
*/
t = new Timer() {
+ @Override
public void run() {
client.sendPendingVariableChanges();
}
*
* @deprecated
*/
+@Deprecated
public class MenuBar extends Widget implements PopupListener {
private final Element body;
return autoOpen;
}
+ @Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
return selectedItem;
}
+ @Override
protected void onDetach() {
// When the menu is detached, make sure to close all of its children.
if (popup != null) {
item.getSubMenu().onShow();
}
+ @Override
public boolean onEventPreview(Event event) {
// Hook the popup panel's event preview. We use this to keep it
// from
*
* @deprecated
*/
+@Deprecated
public class MenuItem extends UIObject implements HasHTML {
private static final String DEPENDENT_STYLENAME_SELECTED_ITEM = "selected";
*
* Actions are always sent immediatedly to server.
*/
+ @Override
public void execute() {
owner.getClient().updateVariable(owner.getPaintableId(), "action",
targetKey + "," + actionKey, true);
return cx;\r
}\r
\r
+ @Override\r
protected void removeApplication(Application application) {\r
portletListeners.remove(application);\r
for (Iterator it = portletToApplication.keySet().iterator(); it\r
super.removeApplication(application);\r
}\r
\r
+ @Override\r
public boolean equals(Object obj) {\r
if (portletSession == null) {\r
return super.equals(obj);\r
return portletSession.equals(obj);\r
}\r
\r
+ @Override\r
public int hashCode() {\r
if (portletSession == null) {\r
return super.hashCode();\r
/**\r
* @see java.lang.Throwable#getCause()\r
*/\r
+ @Override\r
public Throwable getCause() {\r
return cause;\r
}\r
return cx;
}
+ @Override
public boolean equals(Object obj) {
return session.equals(obj);
}
+ @Override
public int hashCode() {
return session.hashCode();
}
private RandomComponents randomComponents;
+ @Override
public void init() {
// addWindow(new Window("ATFTest", create()));
final Window mainWindow = new Window("Testing", create());
/**
* ErrorEvents are printed to default error stream and not in GUI.
*/
+ @Override
public void terminalError(
com.itmill.toolkit.terminal.Terminal.ErrorEvent event) {
final Throwable e = event.getThrowable();
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window mainWindow = new Window("CustomLayout demo");
setMainWindow(mainWindow);
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window mainWindow = new Window("Layout demo");
setMainWindow(mainWindow);
HashMap buttonListeners = new HashMap();
+ @Override
public void init() {
createNewView();
}
private Window test;
private Button reopen;
+ @Override
public void init() {
// Create main window
Window main = new Window("Windowing test");
+ @Override
public void init() {
setMainWindow(main);
"Commit (saves window state: size, place, scrollpos)"));
}
+ @Override
public Window getWindow(String name) {
final Window w = super.getWindow(name);
private final Table params = new Table();
+ @Override
@SuppressWarnings("deprecation")
public void init() {
final Window main = new Window("Parameters demo");
*
* @see com.itmill.toolkit.terminal.URIHandler#handleURI(URL, String)
*/
+ @Override
public DownloadStream handleURI(URL context, String relativeUri) {
this.context.setValue(context.toString());
relative.setValue(relativeUri);
.getTestTable(5, 200);
Table t2 = new Table("Test Table with 199 rows rendered initially") {
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
// end timing on cache row request
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window main = new Window("QueryContainer demo");
setMainWindow(main);
/**
* Initialize Application. Demo components are added to main window.
*/
+ @Override
public void init() {
final Window mainWindow = new Window("Layout demo");
setMainWindow(mainWindow);
HashMap itemCaptions = new HashMap();
+ @Override
public void init() {
// Add testable classes to hierarchical container
setCompositionRoot(main);
}
+ @Override
public void attach() {
super.attach();
createNewView();
private final Action ACTION3 = new Action("Show history");
private final Action[] actions = new Action[] { ACTION1, ACTION2, ACTION3 };
+ @Override
public void init() {
sampleDatabase = new SampleDatabase();
createNewView();
+ "All components are in immmediate mode. See source how to tweak this test."));
main.addComponent(eventListenerFeedback);
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
window = new Window("Components inside Window (TEST: Window)");
getMainWindow().addWindow(window);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target
target.addComponent(ol);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target
target.addComponent(ol2);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target.addComponent(new Label(
// test(expandLayout);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (true) {
target.addComponent(new Label(
// test(expandLayout);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target.addComponent(new Label(
// test(gridLayout);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target
target.addComponent(el);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target.addComponent(new Label(
target.addComponent(panel);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target
target.addComponent(sp1l);
}
- ////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////
// ////
if (false) {
target
df4.setLocale(new Locale("fi", "FI"));\r
}\r
\r
+ @Override\r
public void attach() {\r
final ClassResource res = new ClassResource("m.gif", super\r
.getApplication());\r
SplitPanel firstLevelSplit;
+ @Override
public void init() {
setMainWindow(main);
Window main = new Window("Windowing test");
+ @Override
public void init() {
setMainWindow(main);
"Commit (saves window state: size, place, scrollpos)"));
}
+ @Override
public Window getWindow(String name) {
final Window w = super.getWindow(name);
int selectedPanel = 0;
+ @Override
public void init() {
final Window mainWindow = new Window("TestSetVisibleAndCaching");
setMainWindow(mainWindow);
private Button next;
private Panel testPanel;
+ @Override
public void init() {
initComponentList();
cont.addItem(t);
t = new Testable(c);
t.addConfiguration(new Configuration("100px*100px") {
+ @Override
void configure(Component c) {
c.setWidth(60);
c.setHeight(60);
});
t = new Testable(c);
t.addConfiguration(new Configuration("Width 50em") {
+ @Override
void configure(Component c) {
c.setWidth("50em");
}
cont.addItem(t);
t = new Testable(c);
t.addConfiguration(new Configuration("Height 7cm") {
+ @Override
void configure(Component c) {
c.setHeight("7cm");
}
});
cont.addItem(t);
t = new Testable(c) {
+ @Override
public Component getComponent()
throws InstantiationException,
IllegalAccessException {
};
t.addConfiguration(new Configuration("100%*100%") {
+ @Override
void configure(Component c) {
c.setSizeFull();
}
return c;
}
+ @Override
public String toString() {
return getTestableName();
}
abstract void configure(Component c);
+ @Override
public String toString() {
return getDescription();
}
// SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
SplitPanel verticalSplit = new SplitPanel(SplitPanel.ORIENTATION_VERTICAL);
+ @Override
public void init() {
final Window mainWindow = new Window("Feature Browser");
setMainWindow(mainWindow);
private final Tree tree = new Tree();
+ @Override
public void init() {
final Window main = new Window("Tree filesystem demo");
setMainWindow(main);
private final Label fileProperties = new Label();
+ @Override
public void init() {
final Window w = new Window("Tree FilesystemContainer demo");
setMainWindow(w);
private final GridLayout layout = new GridLayout(2, 1);
/* Initialize the application */
+ @Override
public void init() {
// Create the main window of the application
// Overriding usetUser method is a simple way of updating application
// privileges when the user is changed
+ @Override
public void setUser(Object user) {
super.setUser(user);
if (user != null) {
public static Random random = new Random(1);
+ @Override
public void init() {
final Window main = new Window("Select demo");
setMainWindow(main);
this.estimatedHours = estimatedHours;
}
+ @Override
public String toString() {
return type + ", " + assignedTo;
}
} else if (param.equals("paging")) {
PagingTable table = new PagingTable();
table.addContainerProperty("Column 1", String.class, null);
- for (int i = 0; i < 100; i++)
+ for (int i = 0; i < 100; i++) {
table.addItem(new Object[] { "Item " + i }, new Integer(i));
+ }
main.addComponent(table);
}
- } else
+ } else {
main.addComponent(new TableExample1());
+ }
}
void example_Upload(Window main, String param) {
for (int i = 0; i < 9; i++) {
HorizontalLayout celllayout = new HorizontalLayout();
celllayout.addComponent((Component) cells[i][0]);
- if (i == 0)
+ if (i == 0) {
celllayout.setExpandRatio((Component) cells[i][0], 1);
+ }
celllayout.setComponentAlignment((Component) cells[i][0],
((Integer) cells[i][1]).intValue(),
form.getFooter().addComponent(okbar);
main.addComponent(form);
- } else
+ } else {
main.addComponent(new FormExample());
+ }
}
void example_ExpandLayout(Window main, String param) {
// Grow the progress value until it reaches 1.0.
current += 0.01;
- if (current > 1.0)
+ if (current > 1.0) {
indicator.setValue(new Float(1.0));
- else
+ } else {
indicator.setValue(new Float(current));
+ }
// After the progress is full for a while, stop.
if (current > 1.2) {
String items[] = new String[] { "-- Select --", "Mercury",
"Venus", "Earth", "Mars", "Jupiter", "Saturn",
"Uranus", "Neptune" };
- for (int i = 0; i < items.length; i++)
+ for (int i = 0; i < items.length; i++) {
select.addItem(items[i]);
+ }
select.setNullSelectionItemId(items[0]);
// When an item is selected in the second window, add
.getBrowserApplication();
// Add a browser-dependent style name for the main window
- if (browserApplication.indexOf("Firefox/2") != -1)
+ if (browserApplication.indexOf("Firefox/2") != -1) {
main.addStyleName("firefox2");
+ }
// Display the client identification string
main.addComponent(new Label(browserApplication));
package com.itmill.toolkit.tests.book;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import com.itmill.toolkit.Application;
-import com.itmill.toolkit.ui.*;
+import com.itmill.toolkit.ui.Button;
+import com.itmill.toolkit.ui.ProgressIndicator;
+import com.itmill.toolkit.ui.Table;
+import com.itmill.toolkit.ui.TextField;
+import com.itmill.toolkit.ui.Window;
import com.itmill.toolkit.ui.Button.ClickEvent;
-public class ChatApplication extends Application implements Button.ClickListener {
- /* ChatApplication instances of different users.
- * Warning: a hack, not safe, because sessions can expire. */
+public class ChatApplication extends Application implements
+ Button.ClickListener {
+ /*
+ * ChatApplication instances of different users. Warning: a hack, not safe,
+ * because sessions can expire.
+ */
static List users = new ArrayList();
-
+
/* Messages as a shared list. */
- static List messages = new ArrayList();
- int localSize = 0;
+ static List messages = new ArrayList();
+ int localSize = 0;
/* User interface. */
- Table messageTable = new Table();
- TextField username = new TextField("Username:");
- TextField message = new TextField("Message:");
+ Table messageTable = new Table();
+ TextField username = new TextField("Username:");
+ TextField message = new TextField("Message:");
+ @Override
public void init() {
- final Window main = new Window ("Chat");
+ final Window main = new Window("Chat");
setMainWindow(main);
setTheme("tests-magi");
users.add(this);
messageTable.addContainerProperty("Sender", String.class, "");
messageTable.addContainerProperty("Message", String.class, "");
updateTable();
-
+
main.addComponent(message);
-
+
Button send = new Button("Send");
send.addListener(this);
main.addComponent(send);
}
public void buttonClick(ClickEvent event) {
- synchronized(users) {
+ synchronized (users) {
// Create the new message in the shared list.
- messages.add(new String[]{new String((String) username.getValue()),
- new String((String) message.getValue())});
+ messages.add(new String[] {
+ new String((String) username.getValue()),
+ new String((String) message.getValue()) });
// Update the message tables for all users.
- for (Iterator i = users.iterator();i.hasNext();)
- ((ChatApplication)i.next()).updateTable();
+ for (Iterator i = users.iterator(); i.hasNext();) {
+ ((ChatApplication) i.next()).updateTable();
+ }
}
}
void updateTable() {
- if (localSize == messages.size())
+ if (localSize == messages.size()) {
return; // No updating needed
+ }
// Add new messages to the table
- while (localSize < messages.size())
- messageTable.addItem((Object[])messages.get(localSize++),
- new Integer(localSize-1));
+ while (localSize < messages.size()) {
+ messageTable.addItem((Object[]) messages.get(localSize++),
+ new Integer(localSize - 1));
+ }
}
}
import com.itmill.toolkit.event.Action;
import com.itmill.toolkit.event.ShortcutAction;
import com.itmill.toolkit.event.Action.Handler;
-import com.itmill.toolkit.ui.AbstractField;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.CustomComponent;
import com.itmill.toolkit.ui.FormLayout;
TextField password = new TextField("Password");
OrderedLayout buttons = new FormLayout();
- // Create buttons and define their listener methods. Here we use parameterless
+ // Create buttons and define their listener methods. Here we use
+ // parameterless
// methods so that we can use same methods for both click events and
// keyboard actions.
Button ok = new Button("OK", this, "okHandler");
// Have the unmodified Enter key cause an event
Action action_ok = new ShortcutAction("Default key",
- ShortcutAction.KeyCode.ENTER,
- null);
+ ShortcutAction.KeyCode.ENTER, null);
// Have the C key modified with Alt cause an event
Action action_cancel = new ShortcutAction("Alt+C",
- ShortcutAction.KeyCode.C,
- new int[] { ShortcutAction.ModifierKey.ALT });
+ ShortcutAction.KeyCode.C,
+ new int[] { ShortcutAction.ModifierKey.ALT });
Window window = null;
*/
public Action[] getActions(Object target, Object sender) {
System.out.println("getActions()");
- return new Action[] {action_ok, action_cancel};
+ return new Action[] { action_ok, action_cancel };
}
/**
* the same listener methods that are called with ButtonClick events.
*/
public void handleAction(Action action, Object sender, Object target) {
- if (action == action_ok)
+ if (action == action_ok) {
okHandler();
- if (action == action_cancel)
+ }
+ if (action == action_cancel) {
cancelHandler();
+ }
}
public void okHandler() {
// Do something: report the click
- formlayout.addComponent(new Label("OK clicked. "+
- "User="+username.getValue()+
- ", password="+password.getValue()));
+ formlayout.addComponent(new Label("OK clicked. " + "User="
+ + username.getValue() + ", password=" + password.getValue()));
//
}
public void cancelHandler() {
// Do something: report the click
- formlayout.addComponent(new Label("Cancel clicked. User="+username.getValue()+", password="+password.getValue()));
+ formlayout.addComponent(new Label("Cancel clicked. User="
+ + username.getValue() + ", password=" + password.getValue()));
}
}
public class FormExample extends CustomComponent {
/** Contact information data model. */
public class Contact {
- String name = "";
- String address = "";
- int postalCode = 20540;
+ String name = "";
+ String address = "";
+ int postalCode = 20540;
String city;
}
public void setPostalCode(String postalCode) {
try {
- if (postalCode != null)
+ if (postalCode != null) {
this.postalCode = Integer.parseInt(postalCode);
- else
+ } else {
this.postalCode = 0;
+ }
} catch (NumberFormatException e) {
this.postalCode = 0;
}
}
public String getPostalCode() {
- if (postalCode > 0)
+ if (postalCode > 0) {
return String.valueOf(postalCode);
- else
+ } else {
return "";
+ }
}
public void setCity(String city) {
Component uiContext) {
String pid = (String) propertyId;
- if (pid.equals("name"))
+ if (pid.equals("name")) {
return new TextField("Name");
-
- if (pid.equals("address"))
+ }
+
+ if (pid.equals("address")) {
return new TextField("Street Address");
-
+ }
+
if (pid.equals("postalCode")) {
TextField field = new TextField("Postal Code");
field.setColumns(5);
return ((String) value).matches("[0-9]{5}");
}
- public void validate(Object value) throws InvalidValueException {
+ public void validate(Object value)
+ throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException(
"Postal code must be a number 10000-99999.");
field.addValidator(postalCodeValidator);
return field;
}
-
+
if (pid.equals("city")) {
Select select = new Select("City");
final String cities[] = new String[] { "Amsterdam", "Berlin",
"Helsinki", "Hong Kong", "London", "Luxemburg",
"New York", "Oslo", "Paris", "Rome", "Stockholm",
"Tokyo", "Turku" };
- for (int i = 0; i < cities.length; i++)
+ for (int i = 0; i < cities.length; i++) {
select.addItem(cities[i]);
+ }
return select;
}
return null;
// Set form caption and description texts.
form.setCaption("Contact Information");
- form.setDescription("Please enter valid name and address. Fields marked with * are required.");
+ form
+ .setDescription("Please enter valid name and address. Fields marked with * are required.");
// Use custom field factory to create the fields in the form.
form.setFieldFactory(new MyFieldFactory());
// necessary for the validation of the fields to occur immediately when
// the input focus changes and not just on commit.
form.setImmediate(true);
-
+
// Set buffering so that commit() must be called for the form
// before input is written to the data. (Input is not written
// immediately through).
form.setReadThrough(false);
// Add Commit and Discard controls to the form.
- ExpandLayout footer = new ExpandLayout(OrderedLayout.ORIENTATION_HORIZONTAL);
+ ExpandLayout footer = new ExpandLayout(
+ OrderedLayout.ORIENTATION_HORIZONTAL);
// The Commit button calls form.commit().
Button commit = new Button("Commit", form, "commit");
Button discard = new Button("Discard", form, "discard");
footer.addComponent(commit);
footer.setComponentAlignment(commit, ExpandLayout.ALIGNMENT_RIGHT,
- ExpandLayout.ALIGNMENT_TOP);
+ ExpandLayout.ALIGNMENT_TOP);
footer.setHeight("25px");
footer.addComponent(discard);
form.setFooter(footer);
public class PersonBean {
String name = "";
String city = "";
-
+
public void setName(String name) {
this.name = name;
}
public Field createField(Item item, Object propertyId,
Component uiContext) {
String pid = (String) propertyId;
- if (pid.equals("name"))
+ if (pid.equals("name")) {
return new TextField("Name");
- else if (pid.equals("city")) {
+ } else if (pid.equals("city")) {
Select select = new Select("City");
select.addItem("Berlin");
select.addItem("Helsinki");
// Set form caption and description texts
form.setCaption("Contact Information");
- form.setDescription("Please specify name of the person and the city where the person lives in.");
+ form
+ .setDescription("Please specify name of the person and the city where the person lives in.");
// Use the custom field factory to create the fields in the form.
form.setFieldFactory(new MyFieldFactory());
order.add("name");
order.add("city");
form.setVisibleItemProperties(order);
-
+
form.getField("name").setRequired(true);
form.getField("name").setRequiredError("You must enter a name.");
form.getField("city").setRequired(true);
OrderedLayout root = new OrderedLayout();
root.setWidth(300, OrderedLayout.UNITS_PIXELS);
root.addComponent(form);
- this.setCompositionRoot(root);
+ setCompositionRoot(root);
}
}
package com.itmill.toolkit.tests.book;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Graphics;
import java.awt.image.BufferedImage;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.net.URL;
import java.util.Map;
+
import javax.imageio.ImageIO;
-import com.itmill.toolkit.terminal.*;
+
+import com.itmill.toolkit.terminal.DownloadStream;
+import com.itmill.toolkit.terminal.ParameterHandler;
+import com.itmill.toolkit.terminal.URIHandler;
/**
* Demonstrates handling URI parameters and the URI itself to create a dynamic
*/
public void handleParameters(Map parameters) {
// Get and store the passed HTTP parameter.
- if (parameters.containsKey("text"))
- textToDisplay = ((String[])parameters.get("text"))[0];
+ if (parameters.containsKey("text")) {
+ textToDisplay = ((String[]) parameters.get("text"))[0];
+ }
}
/**
public DownloadStream handleURI(URL context, String relativeUri) {
// Catch the given URI that identifies the resource, otherwise let other
// URI handlers or the Application to handle the response.
- if (!relativeUri.startsWith("myresource"))
+ if (!relativeUri.startsWith("myresource")) {
return null;
-
+ }
+
// Create an image and draw some background on it.
- BufferedImage image = new BufferedImage (200, 200, BufferedImage.TYPE_INT_RGB);
+ BufferedImage image = new BufferedImage(200, 200,
+ BufferedImage.TYPE_INT_RGB);
Graphics drawable = image.getGraphics();
drawable.setColor(Color.lightGray);
- drawable.fillRect(0,0,200,200);
+ drawable.fillRect(0, 0, 200, 200);
drawable.setColor(Color.yellow);
- drawable.fillOval(25,25,150,150);
+ drawable.fillOval(25, 25, 150, 150);
drawable.setColor(Color.blue);
- drawable.drawRect(0,0,199,199);
-
+ drawable.drawRect(0, 0, 199, 199);
+
// Use the parameter to create dynamic content.
drawable.setColor(Color.black);
- drawable.drawString("Text: "+textToDisplay, 75, 100);
+ drawable.drawString("Text: " + textToDisplay, 75, 100);
try {
// Write the image to a buffer.
ImageIO.write(image, "png", imagebuffer);
// Return a stream from the buffer.
- ByteArrayInputStream istream = new ByteArrayInputStream(imagebuffer.toByteArray());
- return new DownloadStream (istream,null,null);
+ ByteArrayInputStream istream = new ByteArrayInputStream(imagebuffer
+ .toByteArray());
+ return new DownloadStream(istream, null, null);
} catch (IOException e) {
return null;
}
import java.io.OutputStream;
import com.itmill.toolkit.terminal.FileResource;
-import com.itmill.toolkit.ui.*;
+import com.itmill.toolkit.ui.CustomComponent;
+import com.itmill.toolkit.ui.Embedded;
+import com.itmill.toolkit.ui.Label;
+import com.itmill.toolkit.ui.Panel;
+import com.itmill.toolkit.ui.Upload;
-public class MyUploader extends CustomComponent
-implements Upload.SucceededListener, Upload.FailedListener, Upload.Receiver {
- Panel root; // Root element for contained components.
- Panel imagePanel; // Panel that contains the uploaded image.
- File file; // File to write to.
+public class MyUploader extends CustomComponent implements
+ Upload.SucceededListener, Upload.FailedListener, Upload.Receiver {
+ Panel root; // Root element for contained components.
+ Panel imagePanel; // Panel that contains the uploaded image.
+ File file; // File to write to.
MyUploader() {
root = new Panel("My Upload Component");
upload.addListener((Upload.FailedListener) this);
root.addComponent(upload);
- root.addComponent(new Label("Click 'Browse' to select a file and then click 'Upload'."));
+ root.addComponent(new Label(
+ "Click 'Browse' to select a file and then click 'Upload'."));
// Create a panel for displaying the uploaded file (image).
imagePanel = new Panel("Uploaded image");
// Log the upload on screen.
root.addComponent(new Label("File " + event.getFilename()
+ " of type '" + event.getMIMEType() + "' uploaded."));
-
+
// Display the uploaded file in the image panel.
- final FileResource imageResource = new FileResource(file, getApplication());
+ final FileResource imageResource = new FileResource(file,
+ getApplication());
imagePanel.removeAllComponents();
imagePanel.addComponent(new Embedded("", imageResource));
}
package com.itmill.toolkit.tests.book;
-import java.text.MessageFormat;
-
import com.itmill.toolkit.data.Property;
import com.itmill.toolkit.data.Validator;
import com.itmill.toolkit.data.Property.ValueChangeEvent;
public class SSNField extends CustomComponent implements
Property.ValueChangeListener {
OrderedLayout layout = new FormLayout();
- // new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); //;new FormLayout();
+ // new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); //;new
+ // FormLayout();
TextField myfield;
Label myerror;
/** Validate the given SSN. */
public void validate(Object value) throws InvalidValueException {
final String ssn = (String) value;
- if (ssn.length() == 0)
- return;
+ if (ssn.length() == 0) {
+ return;
+ }
- if (ssn.length() != 11)
+ if (ssn.length() != 11) {
throw new InvalidValueException("Invalid SSN length");
+ }
final String numbers = ssn.substring(0, 6) + ssn.substring(7, 10);
final int checksum = new Integer(numbers).intValue() % 31;
/* Create and set the validator object for the field. */
myfield.addValidator(new SSNValidator());
- /* ValueChageEvent will be generated immediately when the component
- loses focus. */
+ /*
+ * ValueChageEvent will be generated immediately when the component
+ * loses focus.
+ */
myfield.setImmediate(true);
/* Listen for ValueChangeEvent events. */
planetName = name;
}
+ @Override
public String toString() {
return "The Planet " + planetName;
}
public TableCellStyle() {
Table table = new Table("Table with Cell Styles");
table.addStyleName("checkerboard");
-
+
// Add some columns in the table. In this example, the property IDs
// of the container are integers so we can determine the column number
// easily.
- table.addContainerProperty("0", String.class, null, "", null, null); // Row header
- for (int i=0; i<8; i++)
- table.addContainerProperty(""+(i+1), String.class, null,
- String.valueOf((char) (65+i)), null, null);
-
+ table.addContainerProperty("0", String.class, null, "", null, null); // Row
+ // header
+ for (int i = 0; i < 8; i++) {
+ table.addContainerProperty("" + (i + 1), String.class, null, String
+ .valueOf((char) (65 + i)), null, null);
+ }
+
// Add some items in the table.
- table.addItem(new Object[]{"1", "R", "N", "B", "Q", "K", "B", "N", "R"}, new Integer(0));
- table.addItem(new Object[]{"2", "P", "P", "P", "P", "P", "P", "P", "P"}, new Integer(1));
- for (int i=2; i<6; i++)
- table.addItem(new Object[]{String.valueOf(i+1), "", "", "", "", "", "", "", ""}, new Integer(i));
- table.addItem(new Object[]{"7", "P", "P", "P", "P", "P", "P", "P", "P"}, new Integer(6));
- table.addItem(new Object[]{"8", "R", "N", "B", "Q", "K", "B", "N", "R"}, new Integer(7));
+ table.addItem(new Object[] { "1", "R", "N", "B", "Q", "K", "B", "N",
+ "R" }, new Integer(0));
+ table.addItem(new Object[] { "2", "P", "P", "P", "P", "P", "P", "P",
+ "P" }, new Integer(1));
+ for (int i = 2; i < 6; i++) {
+ table.addItem(new Object[] { String.valueOf(i + 1), "", "", "", "",
+ "", "", "", "" }, new Integer(i));
+ }
+ table.addItem(new Object[] { "7", "P", "P", "P", "P", "P", "P", "P",
+ "P" }, new Integer(6));
+ table.addItem(new Object[] { "8", "R", "N", "B", "Q", "K", "B", "N",
+ "R" }, new Integer(7));
table.setPageLength(8);
-
+
// Set cell style generator
table.setCellStyleGenerator(new Table.CellStyleGenerator() {
public String getStyle(Object itemId, Object propertyId) {
- int row = ((Integer)itemId).intValue();
- int col = Integer.parseInt((String)propertyId);
-
+ int row = ((Integer) itemId).intValue();
+ int col = Integer.parseInt((String) propertyId);
+
// The first column.
- if (col == 0)
+ if (col == 0) {
return "rowheader";
-
+ }
+
// Other cells.
- if ((row+col)%2 == 1)
+ if ((row + col) % 2 == 1) {
return "black";
- else
+ } else {
return "white";
+ }
}
});
-
+
setCompositionRoot(table);
}
}
import com.itmill.toolkit.data.Property;
import com.itmill.toolkit.data.Property.ValueChangeEvent;
-import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.CheckBox;
import com.itmill.toolkit.ui.CustomComponent;
-import com.itmill.toolkit.ui.Label;
import com.itmill.toolkit.ui.OrderedLayout;
-import com.itmill.toolkit.ui.RichTextArea;
import com.itmill.toolkit.ui.Table;
-import com.itmill.toolkit.ui.TextField;
-import com.itmill.toolkit.ui.Button.ClickEvent;
public class TableEditable extends CustomComponent {
/* A layout needed for the example. */
OrderedLayout layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
-
+
TableEditable() {
setCompositionRoot(layout);
// Create a table. It is by default not editable.
final Table table = new Table();
-
+
// Define the names and data types of columns.
- table.addContainerProperty("Date", Date.class, null);
- table.addContainerProperty("Work", Boolean.class, null);
- table.addContainerProperty("Comments", String.class, null);
-
+ table.addContainerProperty("Date", Date.class, null);
+ table.addContainerProperty("Work", Boolean.class, null);
+ table.addContainerProperty("Comments", String.class, null);
+
// Add a few items in the table.
- for (int i=0; i<100; i++) {
- Calendar calendar = new GregorianCalendar(2008,0,1);
+ for (int i = 0; i < 100; i++) {
+ Calendar calendar = new GregorianCalendar(2008, 0, 1);
calendar.add(Calendar.DAY_OF_YEAR, i);
-
+
// Create the table row.
- table.addItem(new Object[] {calendar.getTime(),
- new Boolean(false),
- ""},
- new Integer(i)); // Item identifier
+ table.addItem(new Object[] { calendar.getTime(),
+ new Boolean(false), "" }, new Integer(i)); // Item
+ // identifier
}
-
+
table.setPageLength(8);
layout.addComponent(table);
-
+
final CheckBox switchEditable = new CheckBox("Editable");
switchEditable.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- table.setEditable(((Boolean)event.getProperty().getValue()).booleanValue());
+ table.setEditable(((Boolean) event.getProperty().getValue())
+ .booleanValue());
}
});
switchEditable.setImmediate(true);
import com.itmill.toolkit.ui.Table;
/**
- * Shows how to bind a bean to a table and make it editable.
+ * Shows how to bind a bean to a table and make it editable.
*/
public class TableEditableBean extends CustomComponent {
/**
* Let's have a simple example bean.
*/
- public class MyBean {
- boolean selected;
- String text;
-
- public MyBean() {
- this.selected = false;
- this.text = "";
- }
-
- public boolean isSelected() {
- System.out.println("isSelected() called: " + selected);
+ public class MyBean {
+ boolean selected;
+ String text;
+
+ public MyBean() {
+ selected = false;
+ text = "";
+ }
+
+ public boolean isSelected() {
+ System.out.println("isSelected() called: " + selected);
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
- System.out.println("setSelected1("+selected+") called.");
+ System.out.println("setSelected1(" + selected + ") called.");
}
public String getText() {
public void setText(String text) {
this.text = text;
- System.out.println("setText("+text+") called.");
+ System.out.println("setText(" + text + ") called.");
}
- };
+ };
/**
* Custom field factory that sets the fields as immediate for debugging
* purposes. This is not normally necessary, unless you want to have some
* interaction that requires it.
*/
- public class MyFieldFactory extends BaseFieldFactory {
- public Field createField(Class type, Component uiContext) {
- // Let the BaseFieldFactory create the fields
- Field field = super.createField(type, uiContext);
-
- // ...and just set them as immediate
- ((AbstractField)field).setImmediate(true);
-
+ public class MyFieldFactory extends BaseFieldFactory {
+ @Override
+ public Field createField(Class type, Component uiContext) {
+ // Let the BaseFieldFactory create the fields
+ Field field = super.createField(type, uiContext);
+
+ // ...and just set them as immediate
+ ((AbstractField) field).setImmediate(true);
+
return field;
- }
- }
+ }
+ }
/**
* This is a custom container that allows adding BeanItems inside it. The
* Most of the interface methods are implemented with just dummy
* implementations, as they are not needed in this example.
*/
- public class MyContainer implements Container {
+ public class MyContainer implements Container {
Item[] items;
- int current = 0;
-
- public MyContainer() {
- items = new Item[100]; // Yeah this is just a test
- }
+ int current = 0;
+
+ public MyContainer() {
+ items = new Item[100]; // Yeah this is just a test
+ }
public boolean addContainerProperty(Object propertyId, Class type,
Object defaultValue) throws UnsupportedOperationException {
}
/**
- * This addItem method is specific for this container and allows adding
- * BeanItem objects. The BeanItems must be bound to MyBean objects.
+ * This addItem method is specific for this container and allows adding
+ * BeanItem objects. The BeanItems must be bound to MyBean objects.
*/
public void addItem(BeanItem item) throws UnsupportedOperationException {
items[current++] = item;
public boolean containsId(Object itemId) {
if (itemId instanceof Integer) {
- int pos = ((Integer)itemId).intValue();
- if (pos >= 0 && pos < 100)
+ int pos = ((Integer) itemId).intValue();
+ if (pos >= 0 && pos < 100) {
return items[pos] != null;
+ }
}
return false;
}
*/
public Property getContainerProperty(Object itemId, Object propertyId) {
if (itemId instanceof Integer) {
- int pos = ((Integer)itemId).intValue();
+ int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < 100) {
Item item = items[pos];
-
+
// The BeanItem provides the property objects for the items.
return item.getItemProperty(propertyId);
}
public Collection getContainerPropertyIds() {
// This container can contain only BeanItems bound to MyBeans.
Item item = new BeanItem(new MyBean());
-
+
// The BeanItem knows how to get the property names from the bean.
return item.getItemPropertyIds();
}
public Item getItem(Object itemId) {
if (itemId instanceof Integer) {
- int pos = ((Integer)itemId).intValue();
- if (pos >= 0 && pos < 100)
+ int pos = ((Integer) itemId).intValue();
+ if (pos >= 0 && pos < 100) {
return items[pos];
+ }
}
return null;
}
public Collection getItemIds() {
Vector ids = new Vector();
- for (int i=0; i<100; i++)
+ for (int i = 0; i < 100; i++) {
ids.add(Integer.valueOf(i));
+ }
return ids;
}
public int size() {
return current;
}
-
- }
+
+ }
TableEditableBean() {
/* A layout needed for the example. */
- OrderedLayout layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
+ OrderedLayout layout = new OrderedLayout(
+ OrderedLayout.ORIENTATION_VERTICAL);
setCompositionRoot(layout);
// Create a table. It is by default not editable.
final Table table = new Table();
layout.addComponent(table);
table.setPageLength(8);
-
+
// Use the custom container as the data source
MyContainer myContainer = new MyContainer();
table.setContainerDataSource(myContainer);
-
+
// Add a few items in the table.
- for (int i=0; i<5; i++) {
+ for (int i = 0; i < 5; i++) {
// Create the bean
- MyBean item = new MyBean();
- item.setText("MyBean " + i);
-
- // Have an Item that is bound to the bean
- BeanItem bitem = new BeanItem(item);
-
- // Add the item directly to the container using the custom addItem()
+ MyBean item = new MyBean();
+ item.setText("MyBean " + i);
+
+ // Have an Item that is bound to the bean
+ BeanItem bitem = new BeanItem(item);
+
+ // Add the item directly to the container using the custom addItem()
// method. We could otherwise add it to the Table as well, but
// the Container interface of Table does not allow adding items
- // as such, just item IDs.
- myContainer.addItem(bitem);
+ // as such, just item IDs.
+ myContainer.addItem(bitem);
}
-
+
// Use custom field factory that sets the checkboxes in immediate mode.
// This is just for debugging purposes and is not normally necessary.
table.setFieldFactory(new MyFieldFactory());
- // Have a check box to switch the table between normal and editable mode.
+ // Have a check box to switch the table between normal and editable
+ // mode.
final CheckBox switchEditable = new CheckBox("Editable");
switchEditable.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- table.setEditable(((Boolean)event.getProperty().getValue()).booleanValue());
+ table.setEditable(((Boolean) event.getProperty().getValue())
+ .booleanValue());
}
});
switchEditable.setImmediate(true);
layout.addComponent(table);
/* Define the names, data types, and default values of columns. */
- table.addContainerProperty("First Name", String.class, "(no first name)");
- table.addContainerProperty("Last Name", String.class, "(no last name)");
- table.addContainerProperty("Year", Integer.class, null);
+ table.addContainerProperty("First Name", String.class,
+ "(no first name)");
+ table.addContainerProperty("Last Name", String.class, "(no last name)");
+ table.addContainerProperty("Year", Integer.class, null);
/* We use these entries to generate random items in a table. */
- final String[] firstnames = new String[] { "Donald", "Patty", "Sally", "Douglas" };
- final String[] lastnames = new String[] { "Smith", "Jones", "Adams", "Knuth" };
+ final String[] firstnames = new String[] { "Donald", "Patty", "Sally",
+ "Douglas" };
+ final String[] lastnames = new String[] { "Smith", "Jones", "Adams",
+ "Knuth" };
/* Add some items in the table and assign them an Item ID (IID). */
for (int i = 0; i < 1000; i++) {
/* Add a randomly generated item in the Table. */
- table.addItem(new Object[] {
- firstnames[(int) (Math.random() * (firstnames.length - 0.01))],
- lastnames[(int) (Math.random() * (lastnames.length - 0.01))],
- new Integer((int) (1900 + Math.random() * 100)) },
- new Integer(i));
+ table
+ .addItem(
+ new Object[] {
+ firstnames[(int) (Math.random() * (firstnames.length - 0.01))],
+ lastnames[(int) (Math.random() * (lastnames.length - 0.01))],
+ new Integer(
+ (int) (1900 + Math.random() * 100)) },
+ new Integer(i));
}
/* Set the number of items visible in the table. */
/* Allow selecting items from the table. */
table.setSelectable(true);
-
- /* When an item is selected, the selection is sent immediately to server. */
+
+ /*
+ * When an item is selected, the selection is sent immediately to
+ * server.
+ */
table.setImmediate(true);
-
+
/* Handle selection change. */
table.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
current.setValue("Selected: " + table.getValue().toString());
}
});
-
+
layout.addComponent(current);
}
}
/* Create the table with a caption. */
Table table = new Table("This is my Table");
-
- /* Define the names and data types of columns.
- * The "default value" parameter is meaningless here. */
- table.addContainerProperty("First Name", String.class, null);
- table.addContainerProperty("Last Name", String.class, null);
- table.addContainerProperty("Year", Integer.class, null);
+
+ /*
+ * Define the names and data types of columns. The "default value"
+ * parameter is meaningless here.
+ */
+ table.addContainerProperty("First Name", String.class, null);
+ table.addContainerProperty("Last Name", String.class, null);
+ table.addContainerProperty("Year", Integer.class, null);
/* Add a few items in the table. */
- table.addItem(new Object[] {"Nicolaus","Copernicus",new Integer(1473)}, new Integer(1));
- table.addItem(new Object[] {"Tycho", "Brahe", new Integer(1546)}, new Integer(2));
- table.addItem(new Object[] {"Giordano","Bruno", new Integer(1548)}, new Integer(3));
- table.addItem(new Object[] {"Galileo", "Galilei", new Integer(1564)}, new Integer(4));
- table.addItem(new Object[] {"Johannes","Kepler", new Integer(1571)}, new Integer(5));
- table.addItem(new Object[] {"Isaac", "Newton", new Integer(1643)}, new Integer(6));
-
+ table.addItem(new Object[] { "Nicolaus", "Copernicus",
+ new Integer(1473) }, new Integer(1));
+ table.addItem(new Object[] { "Tycho", "Brahe", new Integer(1546) },
+ new Integer(2));
+ table.addItem(new Object[] { "Giordano", "Bruno", new Integer(1548) },
+ new Integer(3));
+ table.addItem(new Object[] { "Galileo", "Galilei", new Integer(1564) },
+ new Integer(4));
+ table.addItem(new Object[] { "Johannes", "Kepler", new Integer(1571) },
+ new Integer(5));
+ table.addItem(new Object[] { "Isaac", "Newton", new Integer(1643) },
+ new Integer(6));
+
/* Set number of visible rows. */
table.setPageLength(5);
public class TableExample2 extends CustomComponent {
/* A layout needed for the example. */
OrderedLayout layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
-
+
TableExample2() {
setCompositionRoot(layout);
/* Create the table with a caption. */
final Table table = new Table();
-
- /* Define the names and data types of columns.
- * The "default value" parameter is meaningless here. */
- table.addContainerProperty("First Name", String.class, null);
- table.addContainerProperty("Last Name", String.class, null);
- table.addContainerProperty("Year", Integer.class, null);
+
+ /*
+ * Define the names and data types of columns. The "default value"
+ * parameter is meaningless here.
+ */
+ table.addContainerProperty("First Name", String.class, null);
+ table.addContainerProperty("Last Name", String.class, null);
+ table.addContainerProperty("Year", Integer.class, null);
/* Add a few items in the table. */
- table.addItem(new Object[] {"Nicolaus","Copernicus",new Integer(1473)}, new Integer(1));
- table.addItem(new Object[] {"Tycho", "Brahe", new Integer(1546)}, new Integer(2));
- table.addItem(new Object[] {"Giordano","Bruno", new Integer(1548)}, new Integer(3));
- table.addItem(new Object[] {"Galileo", "Galilei", new Integer(1564)}, new Integer(4));
- table.addItem(new Object[] {"Johannes","Kepler", new Integer(1571)}, new Integer(5));
- table.addItem(new Object[] {"Isaac", "Newton", new Integer(1643)}, new Integer(6));
-
+ table.addItem(new Object[] { "Nicolaus", "Copernicus",
+ new Integer(1473) }, new Integer(1));
+ table.addItem(new Object[] { "Tycho", "Brahe", new Integer(1546) },
+ new Integer(2));
+ table.addItem(new Object[] { "Giordano", "Bruno", new Integer(1548) },
+ new Integer(3));
+ table.addItem(new Object[] { "Galileo", "Galilei", new Integer(1564) },
+ new Integer(4));
+ table.addItem(new Object[] { "Johannes", "Kepler", new Integer(1571) },
+ new Integer(5));
+ table.addItem(new Object[] { "Isaac", "Newton", new Integer(1643) },
+ new Integer(6));
+
/* Set number of visible rows. */
table.setPageLength(5);
/* Allow selecting items from the table. */
table.setSelectable(true);
-
- /* When an item is selected, the selection is sent immediately to server. */
+
+ /*
+ * When an item is selected, the selection is sent immediately to
+ * server.
+ */
table.setImmediate(true);
/* Feedback from selection. */
package com.itmill.toolkit.tests.book;
-import com.itmill.toolkit.data.Property;
-import com.itmill.toolkit.data.Property.ValueChangeEvent;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.CheckBox;
import com.itmill.toolkit.ui.CustomComponent;
import com.itmill.toolkit.ui.Label;
import com.itmill.toolkit.ui.OrderedLayout;
-import com.itmill.toolkit.ui.RichTextArea;
import com.itmill.toolkit.ui.Table;
import com.itmill.toolkit.ui.TextField;
import com.itmill.toolkit.ui.Button.ClickEvent;
public class TableExample3 extends CustomComponent {
/* A layout needed for the example. */
OrderedLayout layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
-
+
TableExample3() {
setCompositionRoot(layout);
- // Create a table and add a style to allow setting the row height in theme.
+ // Create a table and add a style to allow setting the row height in
+ // theme.
final Table table = new Table();
table.addStyleName("components-inside");
-
- /* Define the names and data types of columns.
- * The "default value" parameter is meaningless here. */
- table.addContainerProperty("Sum", Label.class, null);
- table.addContainerProperty("Is Transferred", CheckBox.class, null);
- table.addContainerProperty("Comments", TextField.class, null);
- table.addContainerProperty("Details", Button.class, null);
-
+
+ /*
+ * Define the names and data types of columns. The "default value"
+ * parameter is meaningless here.
+ */
+ table.addContainerProperty("Sum", Label.class, null);
+ table.addContainerProperty("Is Transferred", CheckBox.class, null);
+ table.addContainerProperty("Comments", TextField.class, null);
+ table.addContainerProperty("Details", Button.class, null);
+
/* Add a few items in the table. */
- for (int i=0; i<100; i++) {
+ for (int i = 0; i < 100; i++) {
// Create the fields for the current table row
- Label sumField = new Label(String.format("Sum is <b>$%04.2f</b><br/><i>(VAT incl.)</i>",
- new Object[] {new Double(Math.random()*1000)}),
- Label.CONTENT_XHTML);
+ Label sumField = new Label(String.format(
+ "Sum is <b>$%04.2f</b><br/><i>(VAT incl.)</i>",
+ new Object[] { new Double(Math.random() * 1000) }),
+ Label.CONTENT_XHTML);
CheckBox transferredField = new CheckBox("is transferred");
-
+
// Multiline text field. This required modifying the height of the
// table row.
TextField commentsField = new TextField();
commentsField.setRows(3);
-
+
// The Table item identifier for the row.
Integer itemId = new Integer(i);
-
+
// Create a button and handle its click. A Button does not know
// the item it is contained in, so we have to store the item
// ID as user-defined data.
detailsField.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
// Get the item identifier from the user-defined data.
- Integer itemId = (Integer)event.getButton().getData();
- getWindow().showNotification("Link "+itemId.intValue()+" clicked.");
- }
+ Integer itemId = (Integer) event.getButton().getData();
+ getWindow().showNotification(
+ "Link " + itemId.intValue() + " clicked.");
+ }
});
detailsField.addStyleName("link");
-
+
// Create the table row.
- table.addItem(new Object[] {sumField, transferredField,
- commentsField, detailsField},
- itemId);
+ table.addItem(new Object[] { sumField, transferredField,
+ commentsField, detailsField }, itemId);
}
// Show just three rows because they are so high.
// Initially show the 50th item in the top of the table.
table.setCurrentPageFirstItemIndex(50);
- //table.setCurrentPageFirstItemId(initial);
-
+ // table.setCurrentPageFirstItemId(initial);
+
layout.addComponent(table);
}
}
* This is a virtual container that generates the items on the fly when
* requested.
*/
- public class HugeContainer implements Container,Indexed {
+ public class HugeContainer implements Container, Indexed {
int numberofitems;
-
+
public HugeContainer(int numberofitems) {
this.numberofitems = numberofitems;
}
public boolean containsId(Object itemId) {
if (itemId instanceof Integer) {
int pos = ((Integer) itemId).intValue();
- if (pos >= 0 && pos < numberofitems)
+ if (pos >= 0 && pos < numberofitems) {
return true;
+ }
}
return false;
}
if (itemId instanceof Integer) {
int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < numberofitems) {
- return new ObjectProperty("This is the item "+pos+" in the huge table");
+ return new ObjectProperty("This is the item " + pos
+ + " in the huge table");
}
}
return null;
public Item getItem(Object itemId) {
if (itemId instanceof Integer) {
- int pos = ((Integer)itemId).intValue();
+ int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < numberofitems) {
Item item = new PropertysetItem();
- item.addItemProperty("id", new ObjectProperty("This is the item "+pos+" in the huge table"));
+ item.addItemProperty("id", new ObjectProperty(
+ "This is the item " + pos + " in the huge table"));
return item;
}
}
}
public boolean isLastId(Object itemId) {
- return ((Integer) itemId).intValue() == (numberofitems-1);
+ return ((Integer) itemId).intValue() == (numberofitems - 1);
}
public Object lastItemId() {
- return new Integer(numberofitems-1);
+ return new Integer(numberofitems - 1);
}
public Object nextItemId(Object itemId) {
int pos = indexOfId(itemId);
- if (pos >= numberofitems-1)
+ if (pos >= numberofitems - 1) {
return null;
- return getIdByIndex(pos+1);
+ }
+ return getIdByIndex(pos + 1);
}
public Object prevItemId(Object itemId) {
int pos = indexOfId(itemId);
- if (pos <= 0)
+ if (pos <= 0) {
return null;
- return getIdByIndex(pos-1);
+ }
+ return getIdByIndex(pos - 1);
}
}
Table table = new Table("HUGE table, REALLY HUGE");
table.setContainerDataSource(new HugeContainer(500000));
table.setPageLength(20);
-
+
setCompositionRoot(table);
}
}
import com.itmill.toolkit.ui.Window.CloseEvent;
/** Component contains a button that allows opening a window. */
-public class WindowOpener extends CustomComponent
- implements Window.CloseListener {
- Window mainwindow; // Reference to main window
- Window mywindow; // The window to be opened
- Button openbutton; // Button for opening the window
+public class WindowOpener extends CustomComponent implements
+ Window.CloseListener {
+ Window mainwindow; // Reference to main window
+ Window mywindow; // The window to be opened
+ Button openbutton; // Button for opening the window
Button closebutton; // A button in the window
- Label explanation; // A descriptive text
+ Label explanation; // A descriptive text
public WindowOpener(String label, Window main) {
mainwindow = main;
/* The component consists of a button that opens the window. */
final VerticalLayout layout = new VerticalLayout();
-
+
openbutton = new Button("Open Window", this, "openButtonClick");
explanation = new Label("Explanation");
layout.addComponent(openbutton);
layout.addComponent(explanation);
-
+
setCompositionRoot(layout);
}
import com.itmill.toolkit.ui.Button.ClickEvent;
public class WindowTestApplication extends Application {
- Window anotherpage = null;
- HashMap windows = new HashMap();
+ Window anotherpage = null;
+ HashMap windows = new HashMap();
+ @Override
public void init() {
final Window main = new Window("Window Test Application");
setMainWindow(main);
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
// Open the window.
- main.open(new ExternalResource(mywindow.getURL()), "_new");
+ main.open(new ExternalResource(mywindow.getURL()),
+ "_new");
}
}));
/* Add a link to the second window. */
Link link = new Link("Click to open second window",
- new ExternalResource(mywindow.getURL()));
+ new ExternalResource(mywindow.getURL()));
link.setTargetName("_new");
main.addComponent(link);
// Add the link manually inside a Label.
- main.addComponent(new Label("Second window: <a href='" + mywindow.getURL()
- + "' target='_new'>click to open</a>",
- Label.CONTENT_XHTML));
- main.addComponent(new Label("The second window can be accessed through URL: "
- + mywindow.getURL()));
+ main.addComponent(new Label("Second window: <a href='"
+ + mywindow.getURL() + "' target='_new'>click to open</a>",
+ Label.CONTENT_XHTML));
+ main.addComponent(new Label(
+ "The second window can be accessed through URL: "
+ + mywindow.getURL()));
// Add links to windows that do not yet exist, but are created
// dynamically when the URL is called.
main.addComponent(new Label("URLs to open item windows:"));
final String[] items = new String[] { "mercury", "venus", "earth",
"mars", "jupiter", "saturn", "uranus", "neptune" };
-
+
for (int inx = 0; inx < items.length; inx++) {
String item = items[inx];
- // We do not create window objects here, but just links to the windows
+ // We do not create window objects here, but just links to the
+ // windows
String windowUrl = getURL() + "planet-" + item;
- main.addComponent(new Label("A window about '" + item + "': <a href='" +
- windowUrl + "' target='_new'>" + windowUrl +
- "</a>", Label.CONTENT_XHTML));
+ main.addComponent(new Label("A window about '" + item
+ + "': <a href='" + windowUrl + "' target='_new'>"
+ + windowUrl + "</a>", Label.CONTENT_XHTML));
}
}
+ @Override
public Window getWindow(String name) {
if (name.startsWith("planet-")) {
String planetName = name.substring("planet-".length());
if (!windows.containsKey(planetName)) {
// Create the window object on the fly.
Window newWindow = new Window("Yet Another Page");
- newWindow.addComponent(new Label("This window contains details about " +
- planetName + "."));
+ newWindow.addComponent(new Label(
+ "This window contains details about " + planetName
+ + "."));
windows.put(planetName, newWindow);
// We must add the window to the application, it is not done
* Feature component initialization is lazily done when the feature is
* attached to application
*/
+ @Override
public void attach() {
super.attach();
}
// Fix for #512
+ @Override
public String getDescription() {
if (description != null && description.getValue() != null) {
return description.getValue().toString();
private final Select themeSelector = new Select();
+ @Override
public void attach() {
if (initialized) {
}
+ @Override
public void addComponent(Component c) {
// TODO Auto-generated method stub
}
+ @Override
public void addListener(ComponentAttachListener listener) {
// TODO Auto-generated method stub
}
+ @Override
public void addListener(ComponentDetachListener listener) {
// TODO Auto-generated method stub
}
+ @Override
public Iterator getComponentIterator() {
// TODO Auto-generated method stub
return null;
}
+ @Override
public void moveComponentsFrom(ComponentContainer source) {
// TODO Auto-generated method stub
}
+ @Override
public void removeAllComponents() {
// TODO Auto-generated method stub
}
+ @Override
public void removeComponent(Component c) {
// TODO Auto-generated method stub
}
+ @Override
public void removeListener(ComponentAttachListener listener) {
// TODO Auto-generated method stub
}
+ @Override
public void removeListener(ComponentDetachListener listener) {
// TODO Auto-generated method stub
}
+ @Override
public void replaceComponent(Component oldComponent, Component newComponent) {
// TODO Auto-generated method stub
}
+ @Override
public float getHeight() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public int getHeightUnits() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public float getWidth() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public int getWidthUnits() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public void setHeight(float height) {
// TODO Auto-generated method stub
}
+ @Override
public void setHeightUnits(int units) {
// TODO Auto-generated method stub
}
+ @Override
public void setSizeFull() {
// TODO Auto-generated method stub
}
+ @Override
public void setSizeUndefined() {
// TODO Auto-generated method stub
}
+ @Override
public void setWidth(float width) {
// TODO Auto-generated method stub
}
+ @Override
public void setWidthUnits(int units) {
// TODO Auto-generated method stub
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "Button b = new Button(\"Caption\");\n";
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
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/>"
+ "the presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Button";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
+ "<br /><br />The default theme handles the styles that are not defined by just drawing "
+ "the subcomponents with flowlayout.";
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getExampleSrc() {
return "CustomLayout c = new CustomLayout(\"mystyle\");\n"
+ "c.addComponent(new Label(\"Example description\"),\"label1-location\");\n"
+ "c.addComponent(new Button(\"Example action\"),\"example-action-location\");\n";
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return "Custom Layout";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "DateField df = new DateField(\"Caption\");\n"
+ "df.setValue(new java.util.Date());\n";
}
+ @Override
protected String getDescriptionXHTML() {
return "Representing Dates and times and providing a way to select "
+ "or enter some specific date and/or time is an typical need in "
+ "presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "DateField";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "// Load image from jpg-file, that is in the same package with the application\n"
+ "Embedded e = new Embedded(\"Image title\",\n"
+ " new ClassResource(\"image.jpg\", getApplication()));";
}
+ @Override
protected String getDescriptionXHTML() {
return "The embedding feature allows for adding images, multimedia and other non-specified "
+ "content to your application. "
+ "Actual support for embedded media types is left to the terminal.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Embedded";
}
Select resetLayout = new Select("Restart");
+ @Override
protected Component getDemoComponent() {
if (demo == null) {
}
}
+ @Override
protected String getDescriptionXHTML() {
return "Form is a flexible, yet simple container for fields. "
+ " It provides support for any layouts and provides buffering interface for"
+ " all the Property-panels in demos are composed of Form-components.";
}
+ @Override
protected String getTitle() {
return "Form";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "GridLayout gl = new GridLayout(2,2);\n"
+ "gl.addComponent(new Label(\"Label 1 in GridLayout\"));\n"
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "This feature provides a container that lays out components "
+ "into a grid of given width and height."
+ "properties affect the presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "GridLayout";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Introduction of Data Model Item";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "Label l = new Label(\"Caption\");\n";
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "Labels components are for captions and plain text. "
+ "By default, it is a light-weight component for presenting "
+ "the presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Label";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "Link link = new Link(\"Link caption\",new ExternalResource(\"http://www.itmill.com\"));\n";
}
+ @Override
protected String getDescriptionXHTML() {
return "The link feature allows for making refences to both internal and external resources. "
+ "The link can open the new resource in a new window, allowing for control of the newly "
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Link";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_FLOW);\n"
+ "ol.addComponent(new TextField(\"Textfield caption\"));\n"
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "This feature provides a container for laying out components either "
+ "vertically, horizontally or flowingly. The orientation may be changed "
+ "affect the presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "OrderedLayout";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "Panel show = new Panel(\"Panel caption\");\n"
+ "show.addComponent(new Label(\"This is an example Label component that is added into Panel.\"));";
}
+ @Override
protected String getDescriptionXHTML() {
return "Panel is a container for other components, by default it draws a frame around it's "
+ "extremities and may have a caption to clarify the nature of the contained components' purpose."
+ "this layout may be switched on the fly.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Panel";
}
params.addContainerProperty("Values", String.class, "");
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getDescriptionXHTML() {
return "This is a demonstration of how URL parameters can be recieved and handled."
+ "Parameters and URL:s can be received trough the windows by registering "
+ "URIHandler and ParameterHandler classes window.";
}
+ @Override
protected String getImage() {
return "parameters.jpg";
}
+ @Override
protected String getTitle() {
return "Parameters";
}
*
* @see com.itmill.toolkit.ui.Component#attach()
*/
+ @Override
public void attach() {
super.attach();
getWindow().addURIHandler(this);
*
* @see com.itmill.toolkit.ui.Component#detach()
*/
+ @Override
public void detach() {
super.detach();
getWindow().removeURIHandler(this);
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "Select s = new Select(\"Select Car\");\n"
+ "s.addItem(\"Audi\");\n" + "s.addItem(\"BMW\");\n"
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "The select component combines two different modes of item selection. "
+ "Firstly it presents the single selection mode, which is usually represented as "
+ " presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Select";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "TabSheet ts = new TabSheet();\n"
+ "ts.addTab(new Label(\"This is an example Label component that is added into Tab 1.\"),\"Tab 1 caption\",null);\n"
+ "ts.addTab(new Label(\"This is an example Label component that is added into Tab 3.\"),\"Tab 3 caption\",null);";
}
+ @Override
protected String getDescriptionXHTML() {
return "A multicomponent container with tabs for switching between them.<br/>"
+ "In the normal case, one would place a layout component on each tab.<br/><br />"
+ "the presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "TabSheet";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout(
return l;
}
+ @Override
protected String getExampleSrc() {
return "TextField tf = new TextField(\"Caption\");\n"
+ "tf.setValue(\"Contents\");";
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "TextField combines the logic of both the single line text-entry field and the multi-line "
+ "text-area into one component. "
+ "presentation of the component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "TextField";
}
}
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "// Create tree\n"
+ "t = new Tree(\"Organization Structure\");\n"
+ " t.setChildrenAllowed(names[i], false);\n";
}
+ @Override
protected String getDescriptionXHTML() {
return "A tree is a natural way to represent datasets that have"
+ " hierarchical relationships, such as filesystems, message "
+ "affect the presentation of the tree component.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Tree";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return "Upload u = new Upload(\"Upload a file:\", uploadReceiver);\n\n"
+ "public class uploadReceiver \n"
}
+ @Override
protected String getDescriptionXHTML() {
return "This demonstrates the use of the Upload component together with the Link component. "
+ "This implementation does not actually store the file to disk, it only keeps it in a buffer. "
+ "The example given on the <em>Code Sample</em>-tab on the other hand stores the file to disk and binds the link to that file.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Upload";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout layoutRoot = new OrderedLayout();
return layoutRoot;
}
+ @Override
protected String getExampleSrc() {
return "Window win = new Window();\n"
+ "getApplication().addWindow(win);\n";
}
+ @Override
protected String getDescriptionXHTML() {
return "The window support in IT Mill Toolkit allows for opening and closing windows, "
+ "refreshing one window from another (for asynchronous terminals), "
+ "this feature.";
}
+ @Override
protected String getImage() {
return "icon_demo.png";
}
+ @Override
protected String getTitle() {
return "Window";
}
public class FeaturesApplication extends com.itmill.toolkit.Application {
+ @Override
public void init() {
if (getProperty("statistics") != null) {
FeatureUtil.setStatistics(true);
/**
* ErrorEvents are printed to default error stream and not in GUI.
*/
+ @Override
public void terminalError(
com.itmill.toolkit.terminal.Terminal.ErrorEvent event) {
final Throwable e = event.getThrowable();
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return "Introduction of basic UI components";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "Please select <em>Embedded Objects</em> or <em>Upload</em>"
+ " from the menu for more information.";
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return null;
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return null;
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return null;
}
/**
* @see com.itmill.toolkit.tests.featurebrowser.Feature#getDescriptionXHTML()
*/
+ @Override
protected String getDescriptionXHTML() {
return "";
}
+ @Override
protected String getImage() {
return null;
}
+ @Override
protected String getTitle() {
return "Introduction for terminals (TODO)";
}
super();
}
+ @Override
protected Component getDemoComponent() {
final OrderedLayout l = new OrderedLayout();
return l;
}
+ @Override
protected String getExampleSrc() {
return ""
+ "package com.itmill.toolkit.demo;\n"
}
// not ready yet to give description, see paint instead
+ @Override
protected String getDescriptionXHTML() {
return description;
}
+ @Override
protected String getImage() {
return "icon_intro.png";
}
+ @Override
protected String getTitle() {
return "Welcome";
}
*
* @see com.itmill.toolkit.ui.Component#attach()
*/
+ @Override
public void attach() {
super.attach();
getWindow().addURIHandler(this);
*
* @see com.itmill.toolkit.ui.Component#detach()
*/
+ @Override
public void detach() {
super.detach();
getWindow().removeURIHandler(this);
RandomComponents randomComponents = new RandomComponents();
+ @Override
public void init() {
createNewView();
}
}
public void buttonClick(ClickEvent event) {
- if (event.getButton() == create)
+ if (event.getButton() == create) {
create();
- else if (event.getButton() == remove) {
+ } else if (event.getButton() == remove) {
main.removeAllComponents();
close.removeListener(this);
remove.removeListener(this);
public class RobustnessSimple extends Robustness implements
Button.ClickListener {
+ @Override
public void create() {
count++;
// remove old stressLayout, all dependant components should be now
// allowed for garbage collection.
- if (stressLayout != null)
+ if (stressLayout != null) {
main.removeComponent(stressLayout);
+ }
// create new stress layout
stressLayout = new OrderedLayout();
*/
public class Ticket1225 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window(
private Select selectWithoutNullItem;\r
private Select selectWithNullItem;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
private TextField tf;\r
private GridLayout gl;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window("#124: Insert & remove row for GridLayout");\r
setMainWindow(w);\r
\r
TextField f = new TextField();\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
setCompositionRoot(iframe);
}
+ @Override
public void attach() {
super.attach();
getApplication().addResource(loginPage);
iframe.setSource(loginPage);
}
+ @Override
public void detach() {
getApplication().removeResource(loginPage);
getWindow().removeParameterHandler(paramHandler);
private ExpandLayout el;
+ @Override
public void init() {
final Window mainWin = new Window(
\r
Label status = new Label("ENTER and CTRL-S fires shortcut action.");\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
private Table t;
+ @Override
public void init() {
final Window mainWin = new Window("Test app to #1368");
Window main;
+ @Override
public void init() {
setTheme("default");
main = new Window("PopupView test");
// Fifth test component
Table table = new Table("Table for testing purposes");
- for (int i = 0; i < 5; i++)
+ for (int i = 0; i < 5; i++) {
table.addContainerProperty("" + (i + 1), String.class, "");
+ }
table.addContainerProperty("" + 6, PopupView.class, null);
table.addContainerProperty("" + 7, PopupView.class, null);
table.setPageLength(20);
private static final boolean useWorkaround = true;
+ @Override
public void init() {
final Window mainWin = new Window("ButtonPanel containing a table test");
container.setHeight("100%");
}
+ @Override
public void setHeight(String height) {
root.setHeight(height);
lastHeight = root.getHeight();
container.setHeight("100%");
}
+ @Override
public void setWidth(String width) {
root.setWidth(width);
}
root.setWidth(width, unit);
}
+ @Override
public void setSizeFull() {
setWidth("100%");
setHeight("100%");
public class Ticket1444 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window(
public class Ticket1465ModalNotification extends Application {
+ @Override
public void init() {
final Window mainWin = new Window("ButtonPanel containing a table test");
String.class));\r
item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty("name 1",\r
String.class));\r
- this.items.put(ITEM_1_ID, item1);\r
+ items.put(ITEM_1_ID, item1);\r
\r
final PropertysetItem item2 = new PropertysetItem();\r
item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty("value 2",\r
String.class));\r
item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty("name 2",\r
String.class));\r
- this.items.put(ITEM_2_ID, item2);\r
+ items.put(ITEM_2_ID, item2);\r
}\r
\r
public Item getItem(Object itemId) {\r
"value " + i, String.class));\r
item.addItemProperty(PROPERTY_2_ID, new ObjectProperty("name " + i,\r
String.class));\r
- this.items.put(String.valueOf(i), item);\r
+ items.put(String.valueOf(i), item);\r
}\r
}\r
\r
public class Ticket1519 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window("Test app to #1368");
private GridLayout gl;\r
private Label spacingstate;\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window(getClass().getName().substring(\r
private ProgressIndicator poller;\r
private Thread thread;\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
\r
thread = new Thread() {\r
\r
+ @Override\r
public void run() {\r
super.run();\r
while (true) {\r
\r
public class Ticket1589 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
final MenuBar menuBar = new MenuBar();
+ @Override
public void init() {
setMainWindow(main);
setTheme("default");
MenuItem third = (MenuItem) menuBar.getItems().get(2);
third.setIcon(new ThemeResource("icons/16/document.png"));
- for (int i = 2; i <= 3; i++)
+ for (int i = 2; i <= 3; i++) {
((MenuItem) menuBar.getItems().get(i)).setCommand(new Command() {
public void menuSelected(MenuItem selectedItem) {
main.showNotification("Action " + selectedItem.getText());
}
});
+ }
final MenuItem fourth = (MenuItem) menuBar.getItems().get(3);
fourth.setText("Toggle animation");
private Table t;
+ @Override
public void init() {
final Window mainWin = new Window("Test app to #1368");
private Table t;
+ @Override
public void init() {
final Window mainWin = new Window("Test app");
public class Ticket1659 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window();
setMainWindow(mainWin);
\r
public class Ticket1663 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
Window main = new Window("#1663");\r
\r
public class Ticket1673 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window("#1673");\r
public class Ticket1737 extends Application {
Resource slowRes = new ClassResource(Calc.class, "m-bullet-blue.gif", this) {
+ @Override
public DownloadStream getStream() {
try {
Thread.sleep(4000);
}
};
+ @Override
public void init() {
final Window main = new Window(getClass().getName().substring(
\r
public class Ticket1767 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window(getClass().getName().substring(\r
\r
public class Ticket1772 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window(getClass().getName().substring(\r
\r
public class Ticket1775 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window("#1775");\r
\r
LinkedList listOfAllFields = new LinkedList();\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window("#1804");\r
\r
public class Ticket1805 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
\r
public class Ticket1806 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
\r
LinkedList listOfAllFields = new LinkedList();\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window("#1811");\r
\r
LinkedList listOfAllFields = new LinkedList();\r
\r
+ @Override\r
public void init() {\r
\r
final Window main = new Window("#1819");\r
\r
private Panel p;\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
public class Ticket1857 extends Application implements Handler {
+ @Override
public void init() {
setTheme("tests-tickets");
\r
public class Ticket1868 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
\r
setMainWindow(new Window("#1868"));\r
\r
LinkedList listOfAllFields = new LinkedList();\r
\r
+ @Override\r
public void init() {\r
\r
GridLayout lo = new GridLayout(2, 1);\r
private Button switchToOrderedButton;\r
private Button switchToFormsButton;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
public class Ticket1902 extends Application {
+ @Override
public void init() {
// Main layout and main window
public class Ticket1904 extends Application {
+ @Override
public void init() {
setMainWindow(new Window("#1904"));
setTheme("tests-tickets");
public class Ticket1916 extends Application {
+ @Override
public void init() {
OrderedLayout test = new OrderedLayout(
private GridLayout lo;\r
private boolean on = true;\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
Button button;
OrderedLayout outer, inner;
+ @Override
public void init() {
outer = new OrderedLayout();
\r
private Panel p;\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
@SuppressWarnings("unused")\r
private Panel p;\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
\r
public class Ticket1925 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window mainWindow = new Window("Test åäö");\r
setMainWindow(mainWindow);\r
public class Ticket1934 extends Application {
+ @Override
public void init() {
Window w = new Window(
"#1934 : Horizontal ExpandLayout completely broken");
public class Ticket1939 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getName());
setMainWindow(w);
public class Ticket1940 extends Application {
+ @Override
public void init() {
final Window w = new Window(getClass().getName());
setMainWindow(w);
public static final String spacerStyle = "test-spacer";
public static final String pageButtonStyle = "test-page-change";
+ @Override
public void init() {
final Window main = new Window(getClass().getName().substring(
names.put(new Integer(TOP), "Top");\r
}\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
names.put(new Integer(TOP), "Top");\r
}\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
\r
public class Ticket1966_3 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket1969 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
public class Ticket1970 extends Application {
+ @Override
public void init() {
setMainWindow(createWindow());
}
+ @Override
public Window getWindow(String name) {
// If we already have the requested window, use it
\r
public class Ticket1972 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
Window main = new Window();\r
Table table = new Table();\r
\r
+ @Override\r
public void init() {\r
setMainWindow(main);\r
\r
Window main = new Window();
Table table = new Table();
+ @Override
public void init() {
setMainWindow(main);
private CustomLayout cl1;\r
private CustomLayout cl2;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
private List components = new ArrayList();
+ @Override
public void init() {
Window main = new Window();
setMainWindow(main);
*/
public class Ticket1983 extends Application {
+ @Override
public void init() {
Window main = new Window("Test for ticket 1983");
main.setLayout(new TestLayout());
\r
public class Ticket1986 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
\r
public class Ticket1991 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
private static final Object PROPERTY_1 = "Test";\r
private Table table;\r
\r
+ @Override\r
public void init() {\r
final Window mainWin = new Window(getClass().getName());\r
setMainWindow(mainWin);\r
public class Ticket20 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window("Test app for #20");
public class Ticket2001 extends Application {
+ @Override
public void init() {
final Window w = new Window(getClass().getName());
setMainWindow(w);
this.long2 = long2;\r
}\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
\r
TextField f = new TextField();\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
\r
public class Ticket2011 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
private Button b1;\r
private Panel panel;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getName());\r
setMainWindow(w);\r
\r
private OrderedLayout orderedLayout;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
w.setLayout(new GridLayout(2, 2));\r
\r
public class Ticket2022 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
AbstractComponent c = new Button();
+ @Override
public void init() {
Window main = new Window();
setMainWindow(main);
\r
public class Ticket2024 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket2026 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
int DIM1, DIM2;\r
Random r = new Random();\r
\r
+ @Override\r
public void init() {\r
COMPONENTS = 5;\r
DIM1 = 504;\r
\r
public class Ticket2032 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket2033 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket2037 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
Window main = new Window();\r
setMainWindow(main);\r
public class Ticket2038 extends Application {
+ @Override
public void init() {
final Window w = new Window("Testing for #2038");
setMainWindow(w);
\r
TextField f = new TextField();\r
\r
+ @Override\r
public void init() {\r
Window main = new Window();\r
setMainWindow(main);\r
\r
public class Ticket2042 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket2043 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
private GridLayout gridLayout;\r
private OrderedLayout orderedLayout;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
private static final Object P1 = new Object();\r
private static final Object P2 = new Object();\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
private Button button2;\r
private Button button3;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
public class Ticket2062 extends Application {\r
private static final Object P1 = new Object();\r
\r
+ @Override\r
public void init() {\r
setMainWindow(new Window("Ticket2062"));\r
getMainWindow().setSizeFull();\r
\r
public class Ticket2083 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket2095 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
private static final String info = "First tab hidden, second should initially be selected";\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
private OrderedLayout ol1, ol2, ol3;\r
private Window popup;\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
public class Ticket2101 extends Application {\r
\r
+ @Override\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
public class Ticket2103 extends Application {
private Window mainWindow;
+ @Override
public void init() {
mainWindow = new Window(getClass().getSimpleName());
mainWindow.setLayout(new ExpandLayout());
Tree tree = new Tree();
Table table = new Table();
+ @Override
public void init() {
Window main = new Window();
setMainWindow(main);
return msgs;
}
+ @Override
public void init() {
setMainWindow(new Window("#2106"));
getMainWindow().addComponent(
public class Ticket2107 extends Application {
+ @Override
public void init() {
final Window w = new Window("Testing for #2107");
setMainWindow(w);
public class Ticket2117 extends Application {
+ @Override
public void init() {
setMainWindow(createWindow());
}
+ @Override
public Window getWindow(String name) {
// If we already have the requested window, use it
private ObjectProperty globalValue;
+ @Override
public void init() {
globalValue = new ObjectProperty(null, String.class);
Window main = createWindow();
public class Ticket2125 extends Application {
+ @Override
public void init() {
setMainWindow(new MainWindow("Ticket2125"));
Window main = new Window();\r
Table table = new Table();\r
\r
+ @Override\r
public void init() {\r
setMainWindow(main);\r
\r
private Label status;
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2157 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2178 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
icons.add("icons/64/arrow-up.png");
}
+ @Override
public void init() {
setMainWindow(main);
OrderedLayout ol;
public class Ticket2186 extends Application {
+ @Override
public void init() {
Window main = new Window("Quick test");
setMainWindow(main);
private final List<Class<? extends Component>> classes = new ArrayList<Class<? extends Component>>();
protected RichTextArea formTextArea;
+ @Override
public void init() {
classes.add(OrderedLayout.class);
classes.add(GridLayout.class);
public class Ticket2221 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2222 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2231 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2234 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2235 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
+ " (and state) between several browser windows (the latter is most useful"
+ " for read-only views).</p><br/><p>This is the end.</p>";
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
private String valueDataSource = "-";
private ObjectProperty prop;
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
Form form;
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
Label l = new Label("0");
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2271 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
}
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
private FormLayout layout1;
private FormLayout layout2;
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
\r
public class Ticket2287 extends Ticket2292 {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
TabSheet ts = null;
Accordion acc = null;
+ @Override
public void init() {
Window w = new Window();
public class Ticket2294 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2296 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
\r
public class Ticket2297 extends Ticket2292 {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(\r
getClass().getName().lastIndexOf(".") + 1));\r
public class Ticket2304 extends Application {
+ @Override
public void init() {
final Window main = new Window(getClass().getName().substring(
getClass().getName().lastIndexOf(".") + 1));
public class Ticket2310 extends Application {
+ @Override
public void init() {
final Window main = new Window(getClass().getName().substring(
getClass().getName().lastIndexOf(".") + 1));
public class Ticket2323 extends Application {
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2325 extends Application {
+ @Override
public void init() {
Window main = new Window("Testing....");
setMainWindow(main);
private Table table;
private VerticalLayout mainLo;
+ @Override
public void init() {
Window mainw = new Window();
setMainWindow(mainw);
GridLayout gl = new GridLayout(3, 1);
+ @Override
public void init() {
Window w = new Window();
setMainWindow(w);
public class Ticket2339 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window(getClass().getSimpleName());
import com.itmill.toolkit.ui.Window;
public class Ticket2341 extends com.itmill.toolkit.Application {
+ @Override
public void init() {
Window main = new Window();
setMainWindow(main);
private Panel p;
+ @Override
public void init() {
Window main = new Window("Quick test");
private Button b1;
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
public class Ticket2364 extends Application {
+ @Override
public void init() {
Window main = new Window("The Main Window!!!");
public class Ticket2365 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window(getClass().getSimpleName());
private Window w;
+ @Override
public void init() {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
l.addComponent(b);
for (int i = 0; i < 5; i++) {
- b = new Button("Button number "+(i+2));
+ b = new Button("Button number " + (i + 2));
b.setSizeFull();
l.addComponent(b);
}
package com.itmill.toolkit.tests.tickets;\r
\r
import com.itmill.toolkit.ui.Form;\r
-import com.itmill.toolkit.ui.Label;\r
import com.itmill.toolkit.ui.TextField;\r
import com.itmill.toolkit.ui.VerticalLayout;\r
import com.itmill.toolkit.ui.Window;\r
\r
public class Ticket2407 extends com.itmill.toolkit.Application {\r
\r
+ @Override\r
public void init() {\r
final Window main = new Window("Ticket2407");\r
setMainWindow(main);\r
public void init() {\r
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
- \r
-// VerticalLayout l = new VerticalLayout();\r
+\r
+ // VerticalLayout l = new VerticalLayout();\r
GridLayout l = new GridLayout();\r
w.setLayout(l);\r
- \r
+\r
l.setHeight("504px");\r
- \r
- for (int i=1; i <= 5; i++) {\r
- Button b = new Button("Button "+i+" should be 100px or 101px high");\r
+\r
+ for (int i = 1; i <= 5; i++) {\r
+ Button b = new Button("Button " + i\r
+ + " should be 100px or 101px high");\r
b.setHeight("100%");\r
l.addComponent(b);\r
}\r
Form form;\r
Table table;\r
\r
+ @Override\r
public void init() {\r
Window main = new Window();\r
setMainWindow(main);\r
form.setCaption("Enabled");\r
form.setFieldFactory(new BaseFieldFactory() {\r
\r
+ @Override\r
public Field createField(Item item, Object propertyId,\r
Component uiContext) {\r
Field f = super.createField(item, propertyId, uiContext);\r
\r
table.setFieldFactory(new BaseFieldFactory() {\r
\r
+ @Override\r
public Field createField(Container container, Object itemId,\r
Object propertyId, Component uiContext) {\r
Field f = super.createField(container, itemId, propertyId,\r
Address address = new Address();
+ @Override
public void init() {
final Window mainWin = new Window("Test app for #736");
this.country = country;
}
+ @Override
public String toString() {
return name + "; " + street + "; " + city + " " + zip
+ (state != null ? " " + state : "") + " " + country;
public class Ticket846 extends Application {
+ @Override
public void init() {
final Window mainWin = new Window("Test app for #846");
super(out);
}
+ @Override
public void print(String s) {
result.append(s);
super.print(s);
}
+ @Override
public void write(String s) {
result.append(s);
super.write(s);
}
public void setRandom(Random rand) {
- this.seededRandom = rand;
+ seededRandom = rand;
}
/**
*
* @see com.itmill.toolkit.ui.Component#attach()
*/
+ @Override
public void attach() {
super.attach();
*
* @see com.itmill.toolkit.ui.Component#detach()
*/
+ @Override
public void detach() {
super.detach();
}
}
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (getParent() != null && !getParent().isEnabled()) {
* Paints the field. Don't add a JavaDoc comment here, we use the default
* documentation from the implemented interface.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// The tab ordering number
* The abstract field is read only also if the data source is in read only
* mode.
*/
+ @Override
public boolean isReadOnly() {
return super.isReadOnly()
|| (dataSource != null && dataSource.isReadOnly());
*
* @see com.itmill.toolkit.ui.Component#setReadOnly(boolean)
*/
+ @Override
public void setReadOnly(boolean readOnly) {
super.setReadOnly(readOnly);
fireReadOnlyStatusChange();
*
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value == null) {
*
* @see com.itmill.toolkit.ui.AbstractComponent#getErrorMessage()
*/
+ @Override
public ErrorMessage getErrorMessage() {
// Check validation errors only if automatic validation is enabled.
}
}
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
*
* @see com.itmill.toolkit.ui.Component#attach()
*/
+ @Override
public void attach() {
super.attach();
if (delayedFocus) {
*
* @see com.itmill.toolkit.ui.AbstractComponent#getTag()
*/
+ @Override
public abstract String getTag();
/*
* com.itmill.toolkit.ui.AbstractComponent#paintContent(com.itmill.toolkit
* .terminal.PaintTarget)
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// Add margin info. Defaults to false.
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "orderedlayout";
}
* @param c
* the component to be added.
*/
+ @Override
public void addComponent(Component c) {
super.addComponent(c);
components.add(c);
* @param c
* the component to be removed.
*/
+ @Override
public void removeComponent(Component c) {
super.removeComponent(c);
components.remove(c);
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// Paints field properties
* @see com.itmill.toolkit.ui.AbstractComponent#changeVariables(java.lang.Object,
* java.util.Map)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "select";
}
*
* @return the Type of the property.
*/
+ @Override
public Class getType() {
if (isMultiSelect()) {
return Set.class;
*
* @see com.itmill.toolkit.ui.AbstractField#getValue()
*/
+ @Override
public Object getValue() {
final Object retValue = super.getValue();
* the New selected item or collection of selected items.
* @see com.itmill.toolkit.ui.AbstractField#setValue(java.lang.Object)
*/
+ @Override
public void setValue(Object newValue) throws Property.ReadOnlyException,
Property.ConversionException {
if (newValue == null) {
* @see com.itmill.toolkit.ui.AbstractField#setValue(java.lang.Object,
* java.lang.Boolean)
*/
+ @Override
protected void setValue(Object newValue, boolean repaintIsNotNeeded)
throws Property.ReadOnlyException, Property.ConversionException {
*
* @see com.itmill.toolkit.ui.AbstractField#attach()
*/
+ @Override
public void attach() {
super.attach();
}
*
* @see com.itmill.toolkit.ui.AbstractComponent#detach()
*/
+ @Override
public void detach() {
getCaptionChangeListener().clear();
super.detach();
public class Accordion extends TabSheet {
+ @Override
public String getTag() {
return "accordion";
}
/**
* Default implementation of the the following Field types are used by default:
* <p>
- * <b>Boolean</b>: Button(switchMode:true).<br/> <b>Date</b>:
- * DateField(resolution: day).<br/> <b>Item</b>: Form. <br/> <b>default field
- * type</b>: TextField.
+ * <b>Boolean</b>: Button(switchMode:true).<br/>
+ * <b>Date</b>: DateField(resolution: day).<br/>
+ * <b>Item</b>: Form. <br/>
+ * <b>default field type</b>: TextField.
* <p>
*
* @author IT Mill Ltd.
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "button";
}
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
* @param source
* @param variables
*/
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
*
* @see com.itmill.toolkit.ui.AbstractComponent#setImmediate(boolean)
*/
+ @Override
public void setImmediate(boolean immediate) {
// Push buttons are always immediate
super.setImmediate(!isSwitchMode() || immediate);
*
* @see com.itmill.toolkit.data.Property#getType()
*/
+ @Override
public Class getType() {
return Boolean.class;
}
super(caption, false);
}
+ @Override
public void setSwitchMode(boolean switchMode)
throws UnsupportedOperationException {
if (this.switchMode && !switchMode) {
setNewItemsAllowed(false);\r
}\r
\r
+ @Override\r
public void setMultiSelect(boolean multiSelect) {\r
if (multiSelect && !isMultiSelect()) {\r
throw new UnsupportedOperationException("Multiselect not supported");\r
/* Basic component features ------------------------------------------ */
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
if (root == null) {
throw new IllegalStateException("Composition root must be set to"
this.componentType = componentType;
}
+ @Override
public String getTag() {
return "customcomponent";
}
*
* @see com.itmill.toolkit.ui.AbstractComponentContainer#addComponent(com.itmill.toolkit.ui.Component)
*/
+ @Override
public void addComponent(Component c) {
throw new UnsupportedOperationException();
}
*
* @see com.itmill.toolkit.ui.AbstractComponentContainer#moveComponentsFrom(com.itmill.toolkit.ui.ComponentContainer)
*/
+ @Override
public void moveComponentsFrom(ComponentContainer source) {
throw new UnsupportedOperationException();
}
*
* @see com.itmill.toolkit.ui.AbstractComponentContainer#removeAllComponents()
*/
+ @Override
public void removeAllComponents() {
throw new UnsupportedOperationException();
}
*
* @see com.itmill.toolkit.ui.AbstractComponentContainer#removeComponent(com.itmill.toolkit.ui.Component)
*/
+ @Override
public void removeComponent(Component c) {
throw new UnsupportedOperationException();
}
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "customlayout";
}
* @param c
* the component to be added.
*/
+ @Override
public void addComponent(Component c) {
this.addComponent(c, "");
}
* @param c
* the component to be removed.
*/
+ @Override
public void removeComponent(Component c) {
if (c == null) {
return;
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
* @param name
* template name
*/
+ @Override
public void setStyle(String name) {
setTemplateName(name);
}
*
* @throws UnsupportedOperationException
*/
+ @Override
public void setMargin(boolean enabled) {
throw new UnsupportedOperationException(
"CustomLayout does not support margins.");
*
* @throws UnsupportedOperationException
*/
+ @Override
public void setMargin(boolean topEnabled, boolean rightEnabled,
boolean bottomEnabled, boolean leftEnabled) {
throw new UnsupportedOperationException(
* Paints this component. Don't add a JavaDoc comment here, we use the
* default documentation from implemented interface.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
* Gets the components UIDL tag string. Don't add a JavaDoc comment here, we
* use the default documentation from implemented interface.
*/
+ @Override
public String getTag() {
return "datefield";
}
* comment here, we use the default documentation from implemented
* interface.
*/
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
* Gets the edited property's type. Don't add a JavaDoc comment here, we use
* the default documentation from implemented interface.
*/
+ @Override
public Class getType() {
return Date.class;
}
* add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
+ @Override
public String toString() {
final Date value = (Date) getValue();
if (value != null) {
* Sets the value of the property. Don't add a JavaDoc comment here, we use
* the default documentation from implemented interface.
*/
+ @Override
public void setValue(Object newValue) throws Property.ReadOnlyException,
Property.ConversionException {
setValue(newValue, false);
}
+ @Override
public void setValue(Object newValue, boolean repaintIsNotNeeded)
throws Property.ReadOnlyException, Property.ConversionException {
*
* @see com.itmill.toolkit.data.Property.Viewer#setPropertyDataSource(Property)
*/
+ @Override
public void setPropertyDataSource(Property newDataSource) {
if (newDataSource == null
|| Date.class.isAssignableFrom(newDataSource.getType())) {
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "embedded";
}
/**
* Invoked when the component state should be painted.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
switch (type) {
}
/* Documented in interface */
+ @Override
public String getTag() {
return "form";
}
/* Documented in interface */
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
layout.paint(target);
* the calculation of the error message is separate from validation, because
* validation fails also on empty errors.
*/
+ @Override
public ErrorMessage getErrorMessage() {
// Reimplement the checking of validation error by using
* Commit changes to the data source Don't add a JavaDoc comment here, we
* use the default one from the interface.
*/
+ @Override
public void commit() throws Buffered.SourceException {
LinkedList problems = null;
* Discards local changes and refresh values from the data source Don't add
* a JavaDoc comment here, we use the default one from the interface.
*/
+ @Override
public void discard() throws Buffered.SourceException {
LinkedList problems = null;
* Is the object modified but not committed? Don't add a JavaDoc comment
* here, we use the default one from the interface.
*/
+ @Override
public boolean isModified() {
for (final Iterator i = propertyIds.iterator(); i.hasNext();) {
final Field f = (Field) fields.get(i.next());
* Is the editor in a read-through mode? Don't add a JavaDoc comment here,
* we use the default one from the interface.
*/
+ @Override
public boolean isReadThrough() {
return readThrough;
}
* Is the editor in a write-through mode? Don't add a JavaDoc comment here,
* we use the default one from the interface.
*/
+ @Override
public boolean isWriteThrough() {
return writeThrough;
}
* Sets the editor's read-through mode to the specified status. Don't add a
* JavaDoc comment here, we use the default one from the interface.
*/
+ @Override
public void setReadThrough(boolean readThrough) {
if (readThrough != this.readThrough) {
this.readThrough = readThrough;
* Sets the editor's read-through mode to the specified status. Don't add a
* JavaDoc comment here, we use the default one from the interface.
*/
+ @Override
public void setWriteThrough(boolean writeThrough) {
if (writeThrough != this.writeThrough) {
this.writeThrough = writeThrough;
*
* @see com.itmill.toolkit.ui.Component#attach()
*/
+ @Override
public void attach() {
super.attach();
layout.attach();
*
* @see com.itmill.toolkit.ui.Component#detach()
*/
+ @Override
public void detach() {
super.detach();
layout.detach();
*
* @see com.itmill.toolkit.data.Validatable#isValid()
*/
+ @Override
public boolean isValid() {
boolean valid = true;
for (final Iterator i = propertyIds.iterator(); i.hasNext();) {
*
* @see com.itmill.toolkit.data.Validatable#validate()
*/
+ @Override
public void validate() throws InvalidValueException {
super.validate();
for (final Iterator i = propertyIds.iterator(); i.hasNext();) {
*
* @see com.itmill.toolkit.data.Validatable#isInvalidAllowed()
*/
+ @Override
public boolean isInvalidAllowed() {
return true;
}
*
* @see com.itmill.toolkit.data.Validatable#setInvalidAllowed(boolean)
*/
+ @Override
public void setInvalidAllowed(boolean invalidValueAllowed)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
*
* @see com.itmill.toolkit.ui.Component#setReadOnly(boolean)
*/
+ @Override
public void setReadOnly(boolean readOnly) {
super.setReadOnly(readOnly);
for (final Iterator i = propertyIds.iterator(); i.hasNext();) {
*
* @see com.itmill.toolkit.ui.AbstractField#getType()
*/
+ @Override
public Class getType() {
if (getPropertyDataSource() != null) {
return getPropertyDataSource().getType();
*
* @see com.itmill.toolkit.ui.AbstractField#setInternalValue(java.lang.Object)
*/
+ @Override
protected void setInternalValue(Object newValue) {
// Stores the old value
final Object oldValue = propertyValue;
*
* @see com.itmill.toolkit.ui.Component.Focusable#focus()
*/
+ @Override
public void focus() {
final Field f = getFirstField();
if (f != null) {
*
* @see com.itmill.toolkit.ui.Component.Focusable#setTabIndex(int)
*/
+ @Override
public void setTabIndex(int tabIndex) {
super.setTabIndex(tabIndex);
for (final Iterator i = getItemPropertyIds().iterator(); i.hasNext();) {
* Setting the form to be immediate also sets all the fields of the form to
* the same state.
*/
+ @Override
public void setImmediate(boolean immediate) {
super.setImmediate(immediate);
for (Iterator i = fields.values().iterator(); i.hasNext();) {
}
/** Form is empty if all of its fields are empty. */
+ @Override
protected boolean isEmpty() {
for (Iterator i = fields.values().iterator(); i.hasNext();) {
*
* Add the validators to form fields instead.
*/
+ @Override
public void addValidator(Validator validator) {
throw new UnsupportedOperationException();
}
formFooter.setParent(this);
}
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (getParent() != null && !getParent().isEnabled()) {
setMargin(true, false, true, false);
}
+ @Override
public String getTag() {
return "formlayout";
}
// move one row down, or one row under the area
cursorY = (column1 == 0 ? row2 : row1) + 1;
} else {
- cursorY = row1;
+ cursorY = row1;
}
}
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "label";
}
* @param readOnly
* True to enable read-only mode, False to disable it.
*/
+ @Override
public void setReadOnly(boolean readOnly) {
if (dataSource == null) {
throw new IllegalStateException(DATASOURCE_MUST_BE_SET);
*
* @return <code>true</code> if the component is in read only mode.
*/
+ @Override
public boolean isReadOnly() {
if (dataSource == null) {
throw new IllegalStateException(DATASOURCE_MUST_BE_SET);
* @throws PaintException
* if the Paint Operation fails.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
if (contentMode != CONTENT_TEXT) {
target.addAttribute("mode", CONTENT_MODE_NAME[contentMode]);
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
if (dataSource == null) {
throw new IllegalStateException(DATASOURCE_MUST_BE_SET);
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "link";
}
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
if (resource != null) {
}
}
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
target.addAttribute("type", "list");
// Adds the number of columns
.getBytes();
}
+ @Override
public void attach() {
super.attach();
getApplication().addResource(loginPage);
iframe.setSource(loginPage);
}
+ @Override
public void detach() {
getApplication().removeResource(loginPage);
getWindow().removeParameterHandler(paramHandler);
private MenuItem moreItem;
/** Tag is the UIDL element name for client-server communications. */
+ @Override
public java.lang.String getTag() {
return "menubar";
}
/** Paint (serialize) the component for the client. */
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// Superclass writes any common attributes in the paint target.
}
/** Deserialize changes received from client. */
+ @Override
public void changeVariables(Object source, Map variables) {
Stack items = new Stack();
boolean found = false;
return columns;
}
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
target.addAttribute("type", "native");
// Adds the number of columns
super.paintContent(target);
}
+ @Override
public void setMultiSelect(boolean multiSelect)
throws UnsupportedOperationException {
if (multiSelect == true) {
}
}
+ @Override
public void setNewItemsAllowed(boolean allowNewOptions)
throws UnsupportedOperationException {
if (allowNewOptions == true) {
super(caption);
}
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
target.addAttribute("type", "optiongroup");
super.paintContent(target);
* @see com.itmill.toolkit.ui.AbstractComponentContainer#removeAllComponents()
* @throws UnsupportedOperationException
*/
+ @Override
public void removeAllComponents() {
throw new UnsupportedOperationException();
}
* @see com.itmill.toolkit.ui.AbstractComponentContainer#moveComponentsFrom(com.itmill.toolkit.ui.ComponentContainer)
* @throws UnsupportedOperationException
*/
+ @Override
public void moveComponentsFrom(ComponentContainer source)
throws UnsupportedOperationException {
* @see com.itmill.toolkit.ui.AbstractComponentContainer#addComponent(com.itmill.toolkit.ui.Component)
* @throws UnsupportedOperationException
*/
+ @Override
public void addComponent(Component c) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
*
* @see com.itmill.toolkit.ui.AbstractComponentContainer#removeComponent(com.itmill.toolkit.ui.Component)
*/
+ @Override
public void removeComponent(Component c)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
/**
* @see com.itmill.toolkit.ui.AbstractComponent#getTag()
*/
+ @Override
public java.lang.String getTag() {
return "popupview";
}
*
* @see com.itmill.toolkit.ui.AbstractComponent#paintContent(com.itmill.toolkit.terminal.PaintTarget)
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// Superclass writes any common attributes in the paint target.
super.paintContent(target);
* @see com.itmill.toolkit.ui.AbstractComponent#changeVariables(java.lang.Object,
* java.util.Map)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
if (variables.containsKey("popupVisibility")) {
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "progressindicator";
}
* @param readOnly
* True to enable read-only mode, False to disable it.
*/
+ @Override
public void setReadOnly(boolean readOnly) {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be se");
*
* @return True if the component is in read only mode.
*/
+ @Override
public boolean isReadOnly() {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be se");
* @throws PaintException
* if the Paint Operation fails.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
target.addAttribute("indeterminate", indeterminate);
target.addAttribute("pollinginterval", pollingInterval);
* @return the Value of the ProgressIndicator.
* @see com.itmill.toolkit.ui.AbstractField#getValue()
*/
+ @Override
public Object getValue() {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be se");
* the New value of the ProgressIndicator.
* @see com.itmill.toolkit.ui.AbstractField#setValue(java.lang.Object)
*/
+ @Override
public void setValue(Object newValue) {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be se");
/**
* @see com.itmill.toolkit.ui.AbstractField#toString()
*/
+ @Override
public String toString() {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be se");
/**
* @see com.itmill.toolkit.ui.AbstractField#getType()
*/
+ @Override
public Class getType() {
if (dataSource == null) {
throw new IllegalStateException("Datasource must be se");
* @return the datasource.
* @see com.itmill.toolkit.ui.AbstractField#getPropertyDataSource()
*/
+ @Override
public Property getPropertyDataSource() {
return dataSource;
}
* the new data source.
* @see com.itmill.toolkit.ui.AbstractField#setPropertyDataSource(com.itmill.toolkit.data.Property)
*/
+ @Override
public void setPropertyDataSource(Property newDataSource) {
// Stops listening the old data source changes
if (dataSource != null
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
if (isMultiSelect()) {
// background compatibility hack. This object shouldn't be used for
* @see com.itmill.toolkit.ui.AbstractComponent#changeVariables(java.lang.Object,
* java.util.Map)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
// Selection change
}
+ @Override
public void requestRepaint() {
super.requestRepaint();
optionRequest = false;
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "select";
}
* @param columns
* the number of columns to set.
*/
+ @Deprecated
public void setColumns(int columns) {
if (columns < 0) {
columns = 0;
* @deprecated see setter function
* @return
*/
+ @Deprecated
public int getColumns() {
return columns;
}
* \r
* @deprecated\r
*/\r
+ @Deprecated\r
private int size = -1;\r
\r
/**\r
* @return size in pixels or -1 for auto sizing.\r
* @deprecated use standard getWidth/getHeight instead\r
*/\r
+ @Deprecated\r
public int getSize() {\r
return size;\r
}\r
* in pixels, or -1 auto sizing.\r
* @deprecated use standard setWidth/setHeight instead\r
*/\r
+ @Deprecated\r
public void setSize(int size) {\r
this.size = size;\r
switch (orientation) {\r
* public boolean isArrowsVisible() { return arrows; }\r
*/\r
\r
+ @Override\r
public String getTag() {\r
return "slider";\r
}\r
\r
+ @Override\r
public void paintContent(PaintTarget target) throws PaintException {\r
super.paintContent(target);\r
\r
* @param source\r
* @param variables\r
*/\r
+ @Override\r
public void changeVariables(Object source, Map variables) {\r
super.changeVariables(source, variables);\r
if (variables.containsKey("value")) {\r
\r
}\r
\r
+ @Override\r
public Class getType() {\r
return Double.class;\r
}\r
* @param c
* the component to be removed.
*/
+ @Override
public void removeComponent(Component c) {
if (c != null && tabs.contains(c)) {
super.removeComponent(c);
* @param c
* the component to be added.
*/
+ @Override
public void addComponent(Component c) {
addTab(c);
}
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "tabsheet";
}
* @param source
* the container components are removed from.
*/
+ @Override
public void moveComponentsFrom(ComponentContainer source) {
for (final Iterator i = source.getComponentIterator(); i.hasNext();) {
final Component c = (Component) i.next();
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
if (areTabsHidden()) {
* @see com.itmill.toolkit.ui.AbstractComponent#changeVariables(java.lang.Object,
* java.util.Map)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
if (variables.containsKey("selected")) {
setSelectedTab((Component) keyMapper.get((String) variables
}
}
+ @Override
public void detach() {
super.detach();
paintedTabs.clear();
return true;
}
+ @Override
public void requestRepaint() {
super.requestRepaint();
partialUpdate = false;
*
* @see com.itmill.toolkit.ui.AbstractComponent#getTag()
*/
+ @Override
public String getTag() {
return "tree";
}
* @see com.itmill.toolkit.terminal.VariableOwner#changeVariables(Object
* source, Map variables)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
if (clickListenerCount > 0 && variables.containsKey("clickedKey")) {
*
* @see com.itmill.toolkit.ui.AbstractComponent#paintContent(PaintTarget)
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
initialPaint = false;
*
* @see com.itmill.toolkit.data.Container.Viewer#setContainerDataSource(Container)
*/
+ @Override
public void setContainerDataSource(Container newDataSource) {
if (newDataSource == null) {
// Note: using wrapped IndexedContainer to match constructor (super
*
* @see com.itmill.toolkit.ui.Select#getVisibleItemIds()
*/
+ @Override
public Collection getVisibleItemIds() {
final LinkedList visible = new LinkedList();
*
* @see com.itmill.toolkit.ui.AbstractSelect#setNullSelectionItemId(java.lang.Object)
*/
+ @Override
public void setNullSelectionItemId(Object nullSelectionItemId)
throws UnsupportedOperationException {
if (nullSelectionItemId != null) {
* if set to true.
* @see com.itmill.toolkit.ui.Select#setNewItemsAllowed(boolean)
*/
+ @Override
public void setNewItemsAllowed(boolean allowNewOptions)
throws UnsupportedOperationException {
if (allowNewOptions) {
* if invoked.
* @see com.itmill.toolkit.ui.AbstractField#focus()
*/
+ @Override
public void focus() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
setMultiSelect(true);
}
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
target.addAttribute("type", "twincol");
// Adds the number of columns
*
* @return Component type as string.
*/
+ @Override
public String getTag() {
return "upload";
}
* @see com.itmill.toolkit.ui.AbstractComponent#changeVariables(java.lang.Object,
* java.util.Map)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
// NOP
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public void paintContent(PaintTarget target) throws PaintException {
// The field should be focused
if (focus) {
* @deprecated Use addListener(ProgressListener) instead.
* @param progressListener
*/
+ @Deprecated
public void setProgressListener(ProgressListener progressListener) {
this.progressListener = progressListener;
}
* @return listener
*
*/
+ @Deprecated
public ProgressListener getProgressListener() {
return progressListener;
}
*
* @see com.itmill.toolkit.ui.Component#attach()
*/
+ @Override
public void attach() {
super.attach();
if (delayedFocus) {
*
* @return the parent window of the component.
*/
+ @Override
public final Window getWindow() {
return this;
}
*
* @return the parent application of the component.
*/
+ @Override
public final Application getApplication() {
if (getParent() == null) {
return application;
*
* @return the Value of property parent.
*/
+ @Override
public final Component getParent() {
return super.getParent();
}
* @param parent
* the New value of property parent.
*/
+ @Override
public void setParent(Component parent) {
super.setParent(parent);
}
*
* @return the Component UIDL tag as string.
*/
+ @Override
public String getTag() {
return "window";
}
* @throws PaintException
* if the paint operation failed.
*/
+ @Override
public synchronized void paintContent(PaintTarget target)
throws PaintException {
* @see com.itmill.toolkit.terminal.VariableOwner#changeVariables(java.lang.Object,
* java.util.Map)
*/
+ @Override
public void changeVariables(Object source, Map variables) {
super.changeVariables(source, variables);
* @deprecated Use {@link #getDescription()} instead.
* @return
*/
+ @Deprecated
public String getMessage() {
return description;
}
* @deprecated Use {@link #setDescription(String)} instead.
* @param description
*/
+ @Deprecated
public void setMessage(String description) {
this.description = description;
}