if (currentResolution <= RESOLUTION_MONTH) {\r
calendarPanel.setFocusChangeListener(new FocusChangeListener() {\r
public void focusChanged(Date date) {\r
- Date date2 = new Date();\r
- if (calendarPanel.getDate() != null) {\r
- date2.setTime(calendarPanel.getDate().getTime());\r
- }\r
+ Date date2 = new Date();\r
+ if (calendarPanel.getDate() != null) {\r
+ date2.setTime(calendarPanel.getDate().getTime());\r
+ }\r
/*\r
* Update the value of calendarPanel\r
*/\r
*
*/
@SuppressWarnings("unchecked")
-public class BasicRandomTest extends com.vaadin.Application implements Button.ClickListener {
+public class BasicRandomTest extends com.vaadin.Application implements
+ Button.ClickListener {
// Seed with fixed number to ensure predeterministic AUT behaviour
private Random rand;
private final TextField randomSeedValue = new TextField("Seed for random");
- private final Button seedShuffle = new Button("Shuffle with seed", this, "seedShuffle");
+ private final Button seedShuffle = new Button("Shuffle with seed", this,
+ "seedShuffle");
- private final Button randomShuffle = new Button("Seed randomly and shuffle", this, "randomShuffle");
+ private final Button randomShuffle = new Button(
+ "Seed randomly and shuffle", this, "randomShuffle");
private Label display = null;
// Setup contains restart button and deterministic component shuffler
// Test requirement: test cases must be reproducable (use seed)
- mainLayout.addComponent(new Label("<H3>ATFTest with randomized Calculator functionality</H3>" + "Buttons with X captions contain calculator number, " + "minus, add, multiply, divisor or clear " + "button functionalities.<br />Layouts, \"noise\" " + "components and component placing is randomized " + "after each application restart.<br />" + "Test cases should exercise calculator functions " + "through X buttons and ensure that Result label " + "contains correct value.", Label.CONTENT_XHTML));
+ mainLayout.addComponent(new Label(
+ "<H3>ATFTest with randomized Calculator functionality</H3>"
+ + "Buttons with X captions contain calculator number, "
+ + "minus, add, multiply, divisor or clear "
+ + "button functionalities.<br />Layouts, \"noise\" "
+ + "components and component placing is randomized "
+ + "after each application restart.<br />"
+ + "Test cases should exercise calculator functions "
+ + "through X buttons and ensure that Result label "
+ + "contains correct value.", Label.CONTENT_XHTML));
final HorizontalLayout setupLayout = new HorizontalLayout();
final Panel statusPanel = new Panel("Status");
}
try {
// randomize using user given value
- rand = new Random(Long.parseLong((String) randomSeedValue.getValue()));
+ rand = new Random(Long.parseLong((String) randomSeedValue
+ .getValue()));
} catch (final Exception e) {
randomize();
}
addComponents(testingLayout);
eventCounter = 0;
- statusLabel.setValue("#" + eventCounter + ": button <none>" + ", value " + Double.toString(current));
+ statusLabel.setValue("#" + eventCounter + ": button <none>"
+ + ", value " + Double.toString(current));
}
// initialize random with random seed and shuffle
components.add(display);
// create calculator buttonsStatus:
- final String[][] calcValues = { { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "-", "*", "/", "=", "C" }, { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "plus", "minus", "multiple", "divisor", "equals", "clear" } };
+ final String[][] calcValues = {
+ { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "-",
+ "*", "/", "=", "C" },
+ { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "plus",
+ "minus", "multiple", "divisor", "equals", "clear" } };
// final String[] randomizedCaptions = { "a", "b", "c", "y", "8", "3" };
// String[] randomizedCaptions = { "X" };
buttonValues = new HashMap<Button, String>();
private void addComponents(Layout layout) {
while (components.size() > 0) {
// Get random container
- final ComponentContainer container = randomComponents.getRandomComponentContainer("" + captionCounter++);
+ final ComponentContainer container = randomComponents
+ .getRandomComponentContainer("" + captionCounter++);
layout.addComponent(container);
// Get random amount of components for above container
final int groupsize = rand.nextInt(COMPONENT_MAX_GROUPED_NUMBER) + 1;
final Component c = getComponent();
if (c != null) {
if (container instanceof TabSheet) {
- final ComponentContainer tab = (ComponentContainer) ((TabSheet) container).getSelectedTab();
+ final ComponentContainer tab = (ComponentContainer) ((TabSheet) container)
+ .getSelectedTab();
tab.addComponent(c);
} else if (container instanceof GridLayout) {
final GridLayout gl = (GridLayout) container;
// Number button pressed
current = current * 10 + Double.parseDouble(value);
display.setValue(Double.toString(current));
- statusLabel.setValue("#" + eventCounter + ": button " + value + ", value " + Double.toString(current));
- System.out.println("#" + eventCounter + ": button " + value + ", value " + Double.toString(current));
+ statusLabel.setValue("#" + eventCounter + ": button " + value
+ + ", value " + Double.toString(current));
+ System.out.println("#" + eventCounter + ": button " + value
+ + ", value " + Double.toString(current));
} catch (final java.lang.NumberFormatException e) {
// Operation button pressed
if (operation.equals("+")) {
operation = value;
current = 0.0;
display.setValue(Double.toString(stored));
- statusLabel.setValue("#" + eventCounter + ": button " + value + ", value " + Double.toString(stored));
- System.out.println("#" + eventCounter + ": button " + value + ", value " + Double.toString(stored));
+ statusLabel.setValue("#" + eventCounter + ": button " + value
+ + ", value " + Double.toString(stored));
+ System.out.println("#" + eventCounter + ": button " + value
+ + ", value " + Double.toString(stored));
}
}
@Override
public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) {
final Throwable e = event.getThrowable();
- System.err.println(getUser().toString() + " terminalError: " + e.toString());
+ System.err.println(getUser().toString() + " terminalError: "
+ + e.toString());
e.printStackTrace();
}
}
* @since 4.0.0
*
*/
-public class CustomLayoutDemo extends com.vaadin.Application implements Listener {
+public class CustomLayoutDemo extends com.vaadin.Application implements
+ Listener {
private CustomLayout mainLayout = null;
// Create custom layout, themes/example/layout/mainLayout.html
mainLayout = new CustomLayout("mainLayout");
// wrap custom layout inside a panel
- final Panel customLayoutPanel = new Panel("Panel containing custom layout (mainLayout.html)");
+ final Panel customLayoutPanel = new Panel(
+ "Panel containing custom layout (mainLayout.html)");
customLayoutPanel.addComponent(mainLayout);
// Login components
setBody("Welcome");
// Add heading label and custom layout panel to main window
- mainWindow.addComponent(new Label("<h3>Custom layout demo</h3>", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label("<h3>Custom layout demo</h3>",
+ Label.CONTENT_XHTML));
mainWindow.addComponent(customLayoutPanel);
}
if (username.getValue().toString().length() < 1) {
username.setValue("Anonymous");
}
- mainLayout.replaceComponent(loginButton, new Label("Welcome user <em>" + username.getValue() + "</em>", Label.CONTENT_XHTML));
+ mainLayout.replaceComponent(loginButton, new Label("Welcome user <em>"
+ + username.getValue() + "</em>", Label.CONTENT_XHTML));
}
/**
//
// Add demo layouts to main window
//
- mainWindow.addComponent(new Label("<h3>Horizontal ordered layout</h3>Added four components.", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label(
+ "<h3>Horizontal ordered layout</h3>Added four components.",
+ Label.CONTENT_XHTML));
mainWindow.addComponent(layoutA);
- mainWindow.addComponent(new Label("<br /><h3>Vertical ordered layout</h3>Added four components.", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label(
+ "<br /><h3>Vertical ordered layout</h3>Added four components.",
+ Label.CONTENT_XHTML));
mainWindow.addComponent(layoutB);
- mainWindow.addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>Added 16 components.", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label(
+ "<br /><h3>Grid Layout (4 x 4)</h3>Added 16 components.",
+ Label.CONTENT_XHTML));
mainWindow.addComponent(layoutG);
- mainWindow.addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>" + "Added four panels and four embedded components " + "diagonally with absolute coordinates.", Label.CONTENT_XHTML));
+ mainWindow
+ .addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>"
+ + "Added four panels and four embedded components "
+ + "diagonally with absolute coordinates.",
+ Label.CONTENT_XHTML));
mainWindow.addComponent(layoutG2);
- mainWindow.addComponent(new Label("<br /><h3>TabSheet</h3>Added above layouts as tabs.", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label(
+ "<br /><h3>TabSheet</h3>Added above layouts as tabs.",
+ Label.CONTENT_XHTML));
mainWindow.addComponent(tabsheet);
}
private Component getExampleComponent(String caption) {
final Panel panel = new Panel();
panel.setCaption("Panel component " + caption);
- panel.addComponent(new Label("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." + " Panel contains an layout where the actual contained components are added, " + "this layout may be switched on the fly.", Label.CONTENT_XHTML));
+ panel.addComponent(new Label(
+ "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."
+ + " Panel contains an layout where the actual contained components are added, "
+ + "this layout may be switched on the fly.",
+ Label.CONTENT_XHTML));
panel.setWidth(222);
return panel;
}
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
-public class ListenerOrder extends com.vaadin.Application implements Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener, ValueChangeListener {
+public class ListenerOrder extends com.vaadin.Application implements
+ Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener,
+ ValueChangeListener {
Button b1;
}
public void buttonClick(ClickEvent event) {
- String msg = "ClickEvent from MyClickListener " + name + ", id=" + count;
+ String msg = "ClickEvent from MyClickListener " + name + ", id="
+ + count;
System.out.println(msg);
getMainWindow().showNotification(msg);
}
* @see com.vaadin.ui.Window
* @see com.vaadin.ui.Label
*/
-public class ModalWindow extends com.vaadin.Application implements ClickListener {
+public class ModalWindow extends com.vaadin.Application implements
+ ClickListener {
private Window test;
private Button reopen;
if (event.getButton() == reopen) {
openSubWindow();
}
- getMainWindow().addComponent(new Label("Button click: " + event.getButton().getCaption()));
+ getMainWindow().addComponent(
+ new Label("Button click: " + event.getButton().getCaption()));
}
private void openSubWindow() {
test = new Window("Modal window");
test.setModal(true);
getMainWindow().addWindow(test);
- test.addComponent(new Label("You have to close this window before accessing others."));
+ test.addComponent(new Label(
+ "You have to close this window before accessing others."));
// Textfield for modal window
final TextField f = new TextField();
setMainWindow(main);
- main.addComponent(new Button("Add new subwindow", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final Window w = new Window("sw " + System.currentTimeMillis());
- main.addWindow(w);
- w.setPositionX(100);
- w.setPositionY(100);
- w.setWidth(200);
- w.setHeight(200);
-
- w.setWidth(100);
- w.setHeight(400);
-
- final Button closebutton = new Button("Close " + w.getCaption(), new Button.ClickListener() {
+ main.addComponent(new Button("Add new subwindow",
+ new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- main.removeWindow(w);
- }
-
- });
- w.addComponent(closebutton);
+ final Window w = new Window("sw "
+ + System.currentTimeMillis());
+ main.addWindow(w);
+ w.setPositionX(100);
+ w.setPositionY(100);
+ w.setWidth(200);
+ w.setHeight(200);
+
+ w.setWidth(100);
+ w.setHeight(400);
+
+ final Button closebutton = new Button("Close "
+ + w.getCaption(), new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ main.removeWindow(w);
+ }
+
+ });
+ w.addComponent(closebutton);
+
+ w.addComponent(new Label(
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>",
+ Label.CONTENT_XHTML));
- w.addComponent(new Label("<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>", Label.CONTENT_XHTML));
-
- }
- }));
+ }
+ }));
- main.addComponent(new Button("Open a currently uncreated application level window", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- try {
- main.open(new com.vaadin.terminal.ExternalResource(new URL(getURL(), "mainwin-" + System.currentTimeMillis() + "/")), null);
- } catch (final MalformedURLException e) {
- }
- }
- }));
+ main.addComponent(new Button(
+ "Open a currently uncreated application level window",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ try {
+ main.open(
+ new com.vaadin.terminal.ExternalResource(
+ new URL(
+ getURL(),
+ "mainwin-"
+ + System.currentTimeMillis()
+ + "/")), null);
+ } catch (final MalformedURLException e) {
+ }
+ }
+ }));
- main.addComponent(new Button("Commit (saves window state: size, place, scrollpos)"));
+ main.addComponent(new Button(
+ "Commit (saves window state: size, place, scrollpos)"));
}
@Override
final String postfix = name.substring("mainwin-".length());
final Window ww = new Window("Window: " + postfix);
ww.setName(name);
- ww.addComponent(new Label("This is a application-level window opened with name: " + name));
+ ww.addComponent(new Label(
+ "This is a application-level window opened with name: "
+ + name));
ww.addComponent(new Button("Click me", new Button.ClickListener() {
int state = 0;
public void buttonClick(ClickEvent event) {
- ww.addComponent(new Label("Button clicked " + (++state) + " times"));
+ ww.addComponent(new Label("Button clicked " + (++state)
+ + " times"));
}
}));
addWindow(ww);
*
* @since 3.1.1
*/
-public class Parameters extends com.vaadin.Application implements URIHandler, ParameterHandler {
+public class Parameters extends com.vaadin.Application implements URIHandler,
+ ParameterHandler {
private final Label context = new Label();
main.addParameterHandler(this);
final VerticalLayout layout = new VerticalLayout();
- final Label info = new Label("To test URI and Parameter Handlers, " + "add get parameters to URL. For example try examples below: ");
+ final Label info = new Label("To test URI and Parameter Handlers, "
+ + "add get parameters to URL. For example try examples below: ");
info.setCaption("Usage info");
layout.addComponent(info);
try {
final URL u1 = new URL(getURL(), "test/uri?test=1&test=2");
final URL u2 = new URL(getURL(), "foo/bar?mary=john&count=3");
- layout.addComponent(new Link(u1.toString(), new ExternalResource(u1)));
+ layout.addComponent(new Link(u1.toString(),
+ new ExternalResource(u1)));
layout.addComponent(new Label("Or this: "));
- layout.addComponent(new Link(u2.toString(), new ExternalResource(u2)));
+ layout.addComponent(new Link(u2.toString(),
+ new ExternalResource(u2)));
} catch (final Exception e) {
- System.out.println("Couldn't get hostname for this machine: " + e.toString());
+ System.out.println("Couldn't get hostname for this machine: "
+ + e.toString());
e.printStackTrace();
}
*/
public void handleParameters(Map<String, String[]> parameters) {
params.removeAllItems();
- for (final Iterator<String> i = parameters.keySet().iterator(); i.hasNext();) {
+ for (final Iterator<String> i = parameters.keySet().iterator(); i
+ .hasNext();) {
final String name = i.next();
final String[] values = parameters.get(name);
String v = "";
testContainer = new VerticalLayout();
- final Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(5, 200);
+ final Table t = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(5, 200);
Table t2 = new Table("Test Table with 199 rows rendered initially") {
@Override
- public void changeVariables(Object source, Map<String, Object> variables) {
+ public void changeVariables(Object source,
+ Map<String, Object> variables) {
super.changeVariables(source, variables);
// end timing on cache row request
endTest();
result = new Label();
main.addComponent(result);
- main.addComponent(new Button("click when rendered", new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- endTest();
- }
- }));
-
- main.addComponent(new Button("Click for layout repaint (cached components)", new ClickListener() {
- public void buttonClick(ClickEvent event) {
- testContainer.requestRepaint();
- }
- }));
+ main.addComponent(new Button("click when rendered",
+ new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ endTest();
+ }
+ }));
+
+ main.addComponent(new Button(
+ "Click for layout repaint (cached components)",
+ new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ testContainer.requestRepaint();
+ }
+ }));
testContainer = new VerticalLayout();
private final Label result;
- private static final String DESCRIPTION = "Hypothesis: Toolkit 4 has major architechtural problem when adding " + "small incrementall updates to a container which has either a lot or " + "some very slow components in it. Toolkit 5 has 'subtree caching' and a" + " small amount of logic in containers, so CommunicationManager can assure" + " that client do not need information about unchanged components it contains." + " Completing test ought to be much faster with Toolkit 5.";
+ private static final String DESCRIPTION = "Hypothesis: Toolkit 4 has major architechtural problem when adding "
+ + "small incrementall updates to a container which has either a lot or "
+ + "some very slow components in it. Toolkit 5 has 'subtree caching' and a"
+ + " small amount of logic in containers, so CommunicationManager can assure"
+ + " that client do not need information about unchanged components it contains."
+ + " Completing test ought to be much faster with Toolkit 5.";
private static final int INITIAL_COMPONENTS = 40;
private void populateContainer(VerticalLayout container, int n) {
for (int i = 0; i < n; i++) {
// array_type array_element = [i];
- final Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(5, 100);
+ final Table t = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(5, 100);
container.addComponent(t);
}
}
setMainWindow(mainWindow);
// Create horizontal ordered layout
- final Panel panelA = new Panel("Panel containing horizontal ordered layout");
+ final Panel panelA = new Panel(
+ "Panel containing horizontal ordered layout");
HorizontalLayout layoutA = new HorizontalLayout();
// Add 4 random components
fillLayout(layoutA, componentCountA);
panelA.addComponent(layoutA);
// Create vertical ordered layout
- final Panel panelB = new Panel("Panel containing vertical ordered layout");
+ final Panel panelB = new Panel(
+ "Panel containing vertical ordered layout");
VerticalLayout layoutB = new VerticalLayout();
// Add 4 random components
fillLayout(layoutB, componentCountB);
// Create grid layout
final int gridSize = (int) java.lang.Math.sqrt(componentCountC);
- final Panel panelG = new Panel("Panel containing grid layout (" + gridSize + " x " + gridSize + ")");
+ final Panel panelG = new Panel("Panel containing grid layout ("
+ + gridSize + " x " + gridSize + ")");
GridLayout layoutG = new GridLayout(gridSize, gridSize);
// Add 12 random components
fillLayout(layoutG, componentCountC);
// Link
result = new Panel();
result.setCaption("Panel component " + caption);
- ((Panel) result).addComponent(new Label("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." + " Panel contains an layout where the actual contained components are added, " + "this layout may be switched on the fly."));
+ ((Panel) result)
+ .addComponent(new Label(
+ "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."
+ + " Panel contains an layout where the actual contained components are added, "
+ + "this layout may be switched on the fly."));
((Panel) result).setWidth(250);
break;
case 6:
context.addItem("Accordion");
context.setValue("Main window");
- final OptionGroup testComponent = new OptionGroup("TestComponent 100%x100%");
+ final OptionGroup testComponent = new OptionGroup(
+ "TestComponent 100%x100%");
testComponent.addItem("Label");
testComponent.addItem("Table");
testComponent.setValue("Label");
private Component getTestComponent() {
if (getTable) {
- Table testTable = TestForTablesInitialColumnWidthLogicRendering.getTestTable(4, 50);
+ Table testTable = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(4, 50);
testTable.setSizeFull();
return testTable;
} else {
\r
public void buttonClick(ClickEvent event) {\r
Button b = event.getButton();\r
- System.out.println(b.getCaption() + " click: " + (new Date()).toGMTString());\r
+ System.out.println(b.getCaption() + " click: "\r
+ + (new Date()).toGMTString());\r
System.out.println(b.getApplication());\r
\r
}\r
return t;\r
}\r
\r
- static String[] testString = new String[] { "Jacob", "Michael", "Joshua", "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas", "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel", "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon", "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", "Cody", "Alejandro", "Caden", "Blake", "Carson" };\r
+ static String[] testString = new String[] { "Jacob", "Michael", "Joshua",\r
+ "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher",\r
+ "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas",\r
+ "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel",\r
+ "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon",\r
+ "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack",\r
+ "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke",\r
+ "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor",\r
+ "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan",\r
+ "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego",\r
+ "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel",\r
+ "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter",\r
+ "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase",\r
+ "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden",\r
+ "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin",\r
+ "Cody", "Alejandro", "Caden", "Blake", "Carson" };\r
\r
public static String rndString() {\r
return testString[(int) (Math.random() * testString.length)];\r
import com.vaadin.ui.Table;\r
import com.vaadin.ui.VerticalLayout;\r
\r
-public class TableChangingDatasource extends CustomComponent implements ClickListener {\r
+public class TableChangingDatasource extends CustomComponent implements\r
+ ClickListener {\r
Table t;\r
Table[] ta = new Table[4];\r
private int mode = 0;\r
public TableChangingDatasource() {\r
final VerticalLayout main = new VerticalLayout();\r
\r
- main.addComponent(new Label("Table should look sane after data source changes"));\r
+ main.addComponent(new Label(\r
+ "Table should look sane after data source changes"));\r
\r
t = new Table();\r
\r
t.setWidth(500);\r
t.setHeight(300);\r
\r
- ta[0] = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 0);\r
- ta[1] = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 7);\r
- ta[2] = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5);\r
- ta[3] = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 1);\r
+ ta[0] = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(3, 0);\r
+ ta[1] = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(3, 7);\r
+ ta[2] = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(3, 5);\r
+ ta[3] = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(3, 1);\r
\r
main.addComponent(t);\r
main.addComponent(new Button("switch DS", this));\r
import com.vaadin.ui.Table;\r
import com.vaadin.ui.VerticalLayout;\r
\r
-public class TableSelectTest extends CustomComponent implements Table.ValueChangeListener {\r
+public class TableSelectTest extends CustomComponent implements\r
+ Table.ValueChangeListener {\r
\r
public TableSelectTest() {\r
final VerticalLayout main = new VerticalLayout();\r
* @author IT Mill Ltd.
*
*/
-public class TestBench extends com.vaadin.Application implements Property.ValueChangeListener {
+public class TestBench extends com.vaadin.Application implements
+ Property.ValueChangeListener {
// Add here packages which are used for finding testable classes
- String[] testablePackages = { "com.vaadin.tests", "com.vaadin.demo", "com.vaadin.demo.colorpicker", "com.vaadin.demo.features", "com.vaadin.tests.tickets" };
+ String[] testablePackages = { "com.vaadin.tests", "com.vaadin.demo",
+ "com.vaadin.demo.colorpicker", "com.vaadin.demo.features",
+ "com.vaadin.tests.tickets" };
HierarchicalContainer testables = new HierarchicalContainer();
testables.addItem(testablePackages[p]);
try {
final List<Class<?>> testableClasses = getTestableClassesForPackage(testablePackages[p]);
- for (final Iterator<Class<?>> it = testableClasses.iterator(); it.hasNext();) {
+ for (final Iterator<Class<?>> it = testableClasses.iterator(); it
+ .hasNext();) {
final Class<?> t = it.next();
// ignore TestBench itself
if (t.equals(TestBench.class)) {
menu = new Tree("Testables", testables);
- for (final Iterator<Class<?>> i = itemCaptions.keySet().iterator(); i.hasNext();) {
+ for (final Iterator<Class<?>> i = itemCaptions.keySet().iterator(); i
+ .hasNext();) {
final Class<?> testable = i.next();
// simplify captions
- final String name = testable.getName().substring(testable.getName().lastIndexOf('.') + 1);
+ final String name = testable.getName().substring(
+ testable.getName().lastIndexOf('.') + 1);
menu.setItemCaption(testable, name);
}
// expand all root items
if (next instanceof Class) {
Class<?> c = (Class<?>) next;
String string = c.getSimpleName();
- if (string.toLowerCase().contains(fragment.toLowerCase())) {
+ if (string.toLowerCase().contains(
+ fragment.toLowerCase())) {
menu.setValue(c);
mainLayout.setSplitPosition(0);
return;
}
}
- getMainWindow().showNotification("No potential matc for #" + fragment);
+ getMainWindow().showNotification(
+ "No potential matc for #" + fragment);
}
} catch (final Exception e1) {
e1.printStackTrace();
VerticalLayout lo = new VerticalLayout();
- lo.addComponent(new Label("Cannot create application / custom component: " + e1.toString()));
+ lo.addComponent(new Label(
+ "Cannot create application / custom component: "
+ + e1.toString()));
- Link l = new Link("Try opening via app runner", new ExternalResource("../run/" + c.getName()));
+ Link l = new Link("Try opening via app runner",
+ new ExternalResource("../run/" + c.getName()));
lo.addComponent(l);
return lo;
* @return
* @throws ClassNotFoundException
*/
- public static List<Class<?>> getTestableClassesForPackage(String packageName) throws Exception {
+ public static List<Class<?>> getTestableClassesForPackage(String packageName)
+ throws Exception {
final ArrayList<File> directories = new ArrayList<File>();
try {
- final ClassLoader cld = Thread.currentThread().getContextClassLoader();
+ final ClassLoader cld = Thread.currentThread()
+ .getContextClassLoader();
if (cld == null) {
throw new ClassNotFoundException("Can't get class loader.");
}
directories.add(new File(url.getFile()));
}
} catch (final Exception x) {
- throw new Exception(packageName + " does not appear to be a valid package.");
+ throw new Exception(packageName
+ + " does not appear to be a valid package.");
}
final ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
// we are only interested in .class files
if (files[j].endsWith(".class")) {
// removes the .class extension
- final String p = packageName + '.' + files[j].substring(0, files[j].length() - 6);
+ final String p = packageName + '.'
+ + files[j].substring(0, files[j].length() - 6);
final Class<?> c = Class.forName(p);
if (c.getSuperclass() != null) {
- if ((c.getSuperclass().equals(com.vaadin.Application.class))) {
+ if ((c.getSuperclass()
+ .equals(com.vaadin.Application.class))) {
classes.add(c);
- } else if ((c.getSuperclass().equals(com.vaadin.ui.CustomComponent.class))) {
+ } else if ((c.getSuperclass()
+ .equals(com.vaadin.ui.CustomComponent.class))) {
classes.add(c);
}
}
}
}
} else {
- throw new ClassNotFoundException(packageName + " (" + directory.getPath() + ") does not appear to be a valid package");
+ throw new ClassNotFoundException(packageName + " ("
+ + directory.getPath()
+ + ") does not appear to be a valid package");
}
}
VerticalLayout main = new VerticalLayout();
final String eventListenerString = "Component.Listener feedback: ";
- Label eventListenerFeedback = new Label(eventListenerString + " <no events occured>");
+ Label eventListenerFeedback = new Label(eventListenerString
+ + " <no events occured>");
int count = 0;
public TestCaptionWrapper() {
public void createNewView() {
main.removeAllComponents();
- main.addComponent(new Label("Each Layout and their contained components should " + "have icon, caption, description, user error defined. " + "Eeach layout should contain similar components."));
+ main.addComponent(new Label(
+ "Each Layout and their contained components should "
+ + "have icon, caption, description, user error defined. "
+ + "Eeach layout should contain similar components."));
main.addComponent(eventListenerFeedback);
final VerticalLayout tab2 = new VerticalLayout();
test(tab2);
populateLayout(tab2);
- tabsheet.addTab(tab1, "TabSheet tab1", new ClassResource("m.gif", getApplication()));
- tabsheet.addTab(tab2, "TabSheet tab2", new ClassResource("m.gif", getApplication()));
+ tabsheet.addTab(tab1, "TabSheet tab1", new ClassResource("m.gif",
+ getApplication()));
+ tabsheet.addTab(tab2, "TabSheet tab2", new ClassResource("m.gif",
+ getApplication()));
final VerticalLayout expandLayout = new VerticalLayout();
test(expandLayout);
final Label label = new Label("Label " + count++);
test(layout, label);
- final Link link = new Link("Link " + count++, new ExternalResource("www.vaadin.com"));
+ final Link link = new Link("Link " + count++, new ExternalResource(
+ "www.vaadin.com"));
test(layout, link);
- final NativeSelect nativeSelect = new NativeSelect("NativeSelect " + count++);
+ final NativeSelect nativeSelect = new NativeSelect("NativeSelect "
+ + count++);
test(layout, nativeSelect);
- final OptionGroup optionGroup = new OptionGroup("OptionGroup " + count++);
+ final OptionGroup optionGroup = new OptionGroup("OptionGroup "
+ + count++);
test(layout, optionGroup);
final ProgressIndicator pi = new ProgressIndicator();
final Tree tree = new Tree("Tree " + count++);
test(layout, tree);
- final TwinColSelect twinColSelect = new TwinColSelect("TwinColSelect " + count++);
+ final TwinColSelect twinColSelect = new TwinColSelect("TwinColSelect "
+ + count++);
test(layout, twinColSelect);
final Upload upload = new Upload("Upload (non-functional)", null);
test(layout, upload);
// Custom components
- layout.addComponent(new Label("<B>Below are few custom components</B>", Label.CONTENT_XHTML));
+ layout.addComponent(new Label("<B>Below are few custom components</B>",
+ Label.CONTENT_XHTML));
final TestForUpload tfu = new TestForUpload();
layout.addComponent(tfu);
}
public void componentEvent(Event event) {
- final String feedback = eventListenerString + " source=" + event.getSource() + ", toString()=" + event.toString();
+ final String feedback = eventListenerString + " source="
+ + event.getSource() + ", toString()=" + event.toString();
System.out.println("eventListenerFeedback: " + feedback);
eventListenerFeedback.setValue(feedback);
}
public void buttonClick(ClickEvent event) {\r
try {\r
p3.addComponent(p2);\r
- getWindow().showNotification("ERROR", "This should have failed", Window.Notification.TYPE_ERROR_MESSAGE);\r
+ getWindow().showNotification("ERROR",\r
+ "This should have failed",\r
+ Window.Notification.TYPE_ERROR_MESSAGE);\r
} catch (Exception e) {\r
- getWindow().showNotification("OK", "threw, as expected", Window.Notification.TYPE_ERROR_MESSAGE);\r
+ getWindow().showNotification("OK", "threw, as expected",\r
+ Window.Notification.TYPE_ERROR_MESSAGE);\r
}\r
}\r
\r
p.addComponent(p2);\r
try {\r
p3.addComponent(p);\r
- getWindow().showNotification("ERROR", "This should have failed", Window.Notification.TYPE_ERROR_MESSAGE);\r
+ getWindow().showNotification("ERROR",\r
+ "This should have failed",\r
+ Window.Notification.TYPE_ERROR_MESSAGE);\r
} catch (Exception e) {\r
- getWindow().showNotification("OK", "threw, as expected", Window.Notification.TYPE_ERROR_MESSAGE);\r
+ getWindow().showNotification("OK", "threw, as expected",\r
+ Window.Notification.TYPE_ERROR_MESSAGE);\r
}\r
}\r
\r
VerticalLayout main = new VerticalLayout();\r
setCompositionRoot(main);\r
\r
- main.addComponent(new Label("The same IndexedContainer is wrapped in a ordered/hierarchical wrapper and is set as data source for all components . The buttons only affect the 'original' IndexedContainer."));\r
+ main.addComponent(new Label(\r
+ "The same IndexedContainer is wrapped in a ordered/hierarchical wrapper and is set as data source for all components . The buttons only affect the 'original' IndexedContainer."));\r
\r
HorizontalLayout h = new HorizontalLayout();\r
\r
tbl2.setImmediate(true);\r
tbl2.addListener(new Table.ValueChangeListener() {\r
public void valueChange(ValueChangeEvent event) {\r
- System.err.println("Value now " + event.getProperty().getValue());\r
+ System.err.println("Value now "\r
+ + event.getProperty().getValue());\r
\r
}\r
});\r
});\r
buttons.addComponent(b);\r
\r
- b = new Button("indexedcontainer.addItem()", new Button.ClickListener() {\r
+ b = new Button("indexedcontainer.addItem()",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- cont.addItem(new Integer(cnt++));\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ cont.addItem(new Integer(cnt++));\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
- b = new Button("indexedcontainer.addItem(null)", new Button.ClickListener() {\r
+ b = new Button("indexedcontainer.addItem(null)",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- cont.addItem(null);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ cont.addItem(null);\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
- b = new Button("indexedcontainer.removeItem(table.lastItemId()", new Button.ClickListener() {\r
+ b = new Button("indexedcontainer.removeItem(table.lastItemId()",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- cont.removeItem(tbl.lastItemId());\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ cont.removeItem(tbl.lastItemId());\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
\r
- b = new Button("indexedcontainer.addContainerProperty()", new Button.ClickListener() {\r
+ b = new Button("indexedcontainer.addContainerProperty()",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- cont.addContainerProperty("prop" + cnt, String.class, "#" + cnt++);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ cont.addContainerProperty("prop" + cnt, String.class,\r
+ "#" + cnt++);\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
\r
b = new Button("indexedcontainer.clear()", new Button.ClickListener() {\r
\r
});\r
buttons.addComponent(b);\r
- b = new Button("table.setContainerDataSource(indexedcontainer)", new Button.ClickListener() {\r
+ b = new Button("table.setContainerDataSource(indexedcontainer)",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- tbl.setContainerDataSource(cont);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ tbl.setContainerDataSource(cont);\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
- b = new Button("table.setContainerDataSource(orderedwrapper)", new Button.ClickListener() {\r
+ b = new Button("table.setContainerDataSource(orderedwrapper)",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- tbl.setContainerDataSource(ordered);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ tbl.setContainerDataSource(ordered);\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
- b = new Button("table.setContainerDataSource(hierarchicalwrapper)", new Button.ClickListener() {\r
+ b = new Button("table.setContainerDataSource(hierarchicalwrapper)",\r
+ new Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- tbl.setContainerDataSource(hierarchical);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ tbl.setContainerDataSource(hierarchical);\r
+ }\r
\r
- });\r
+ });\r
buttons.addComponent(b);\r
\r
Panel p = new Panel("Tree");\r
\r
@Override\r
public void attach() {\r
- final ClassResource res = new ClassResource("m.gif", super.getApplication());\r
+ final ClassResource res = new ClassResource("m.gif",\r
+ super.getApplication());\r
df.setIcon(res);\r
super.attach();\r
}\r
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends Application {
+public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends
+ Application {
Window main = new Window("Windowing test");
firstLevelSplit = new SplitPanel();
- final SplitPanel secondSplitPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
+ final SplitPanel secondSplitPanel = new SplitPanel(
+ SplitPanel.ORIENTATION_HORIZONTAL);
secondSplitPanel.setFirstComponent(new Label("left"));
final VerticalLayout topRight = new VerticalLayout();
topRight.addComponent(new Label("topright header"));
- final Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(4, 100);
+ final Table t = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(4, 100);
t.setSizeFull();
topRight.addComponent(t);
topRight.setExpandRatio(t, 1);
tab = new TabSheet();\r
tab.setSizeFull();\r
\r
- final Panel report = new Panel("Monthly Program Runs", new VerticalLayout());\r
+ final Panel report = new Panel("Monthly Program Runs",\r
+ new VerticalLayout());\r
final VerticalLayout controls = new VerticalLayout();\r
controls.setMargin(true);\r
controls.addComponent(new Label("Report tab"));\r
\r
sp2.setFirstComponent(report);\r
\r
- final Table table = TestForTablesInitialColumnWidthLogicRendering.getTestTable(5, 200);\r
+ final Table table = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(5, 200);\r
table.setPageLength(15);\r
table.setSelectable(true);\r
table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);\r
b = new Button("reorder view", this, "randomReorder");
main.addComponent(b);
- b = new Button("remove randomly one component", this, "removeRandomComponent");
+ b = new Button("remove randomly one component", this,
+ "removeRandomComponent");
main.addComponent(b);
}
VerticalLayout lo = new VerticalLayout();
IndexedContainer ic = new IndexedContainer();
Table t = new Table();
- private static String parts[] = { "Neo", "Sa", "rem", "the", "adi", "za", "tre", "day", "Ca", "re", "cen", "ter", "mi", "nal" };
+ private static String parts[] = { "Neo", "Sa", "rem", "the", "adi", "za",
+ "tre", "day", "Ca", "re", "cen", "ter", "mi", "nal" };
TextField fooFilter = new TextField("foo-filter");
TextField barFilter = new TextField("bar-filter");
Button filterButton = new Button("Filter");
filterPanel.addComponent(fooFilter);
filterPanel.addComponent(barFilter);
filterPanel.addComponent(filterButton);
- fooFilter.setDescription("Filters foo column in case-sensitive contains manner.");
- barFilter.setDescription("Filters bar column in case-insensitive prefix manner.");
+ fooFilter
+ .setDescription("Filters foo column in case-sensitive contains manner.");
+ barFilter
+ .setDescription("Filters bar column in case-insensitive prefix manner.");
filterPanel.addComponent(count);
// Table
public void buttonClick(ClickEvent event) {
ic.removeAllContainerFilters();
if (fooFilter.toString().length() > 0) {
- ic.addContainerFilter("foo", fooFilter.toString(), false, false);
+ ic.addContainerFilter("foo", fooFilter.toString(), false,
+ false);
}
if (barFilter.toString().length() > 0) {
- ic.addContainerFilter("bar", barFilter.toString(), true, true);
+ ic.addContainerFilter("bar", barFilter.toString(), true,
+ true);
}
count.setValue("Rows in table: " + ic.size());
}
});
// Resetbutton
- lo.addComponent(new Button("Rebind table datasource", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- t.setContainerDataSource(ic);
- }
- }));
+ lo.addComponent(new Button("Rebind table datasource",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ t.setContainerDataSource(ic);
+ }
+ }));
}
private String randomWord() {
b = new Button("reorder view", this, "randomReorder");
main.addComponent(b);
- b = new Button("remove randomly one component", this, "removeRandomComponent");
+ b = new Button("remove randomly one component", this,
+ "removeRandomComponent");
main.addComponent(b);
}
for (int i = components.size(); i > 0; i--) {
final int index = (int) (Math.random() * i);
if (i == colspanIndex) {
- main.addComponent(components.get(index), 0, (size - i) / 2, 1, (size - i) / 2);
+ main.addComponent(components.get(index), 0, (size - i) / 2, 1,
+ (size - i) / 2);
} else {
main.addComponent(components.get(index));
}
*
* @author IT Mill Ltd.
*/
-public class TestForMultipleStyleNames extends CustomComponent implements ValueChangeListener {
+public class TestForMultipleStyleNames extends CustomComponent implements
+ ValueChangeListener {
private final VerticalLayout main = new VerticalLayout();
public void createNewView() {
main.removeAllComponents();
- main.addComponent(new Label("TK5 supports multiple stylenames for components."));
- main.addComponent(new Label("Note you need to add Theme under" + " WebContent/VAADIN/Themes/mytheme" + " in order to see actual visible results" + " on the browser. Currently changes are" + " visible only by inspecting DOM."));
+ main.addComponent(new Label(
+ "TK5 supports multiple stylenames for components."));
+ main.addComponent(new Label("Note you need to add Theme under"
+ + " WebContent/VAADIN/Themes/mytheme"
+ + " in order to see actual visible results"
+ + " on the browser. Currently changes are"
+ + " visible only by inspecting DOM."));
styleNames2 = new ArrayList<String>();
l.addStyleName(styleName);
}
}
- for (final Iterator<String> iterator2 = curStyles.iterator(); iterator2.hasNext();) {
+ for (final Iterator<String> iterator2 = curStyles.iterator(); iterator2
+ .hasNext();) {
final String object = iterator2.next();
l.removeStyleName(object);
}
setMainWindow(main);
- main.addComponent(new Button("Add new subwindow", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final Window w = new Window("sw " + System.currentTimeMillis());
- main.addWindow(w);
- w.setPositionX(100);
- w.setPositionY(100);
- w.setWidth(200);
- w.setHeight(200);
-
- w.setWidth(100);
- w.setHeight(400);
-
- final Button closebutton = new Button("Close " + w.getCaption(), new Button.ClickListener() {
+ main.addComponent(new Button("Add new subwindow",
+ new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- main.removeWindow(w);
- }
-
- });
- w.addComponent(closebutton);
+ final Window w = new Window("sw "
+ + System.currentTimeMillis());
+ main.addWindow(w);
+ w.setPositionX(100);
+ w.setPositionY(100);
+ w.setWidth(200);
+ w.setHeight(200);
+
+ w.setWidth(100);
+ w.setHeight(400);
+
+ final Button closebutton = new Button("Close "
+ + w.getCaption(), new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ main.removeWindow(w);
+ }
+
+ });
+ w.addComponent(closebutton);
+
+ w.addComponent(new Label(
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>"
+ + "<p>Lorem ipsum dolor sit amet.</p>",
+ Label.CONTENT_XHTML));
- w.addComponent(new Label("<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>" + "<p>Lorem ipsum dolor sit amet.</p>", Label.CONTENT_XHTML));
-
- }
- }));
+ }
+ }));
- main.addComponent(new Button("Open a currently uncreated application level window", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- try {
- main.open(new com.vaadin.terminal.ExternalResource(new URL(getURL(), "mainwin-" + System.currentTimeMillis() + "/")), null);
- } catch (final MalformedURLException e) {
- }
- }
- }));
+ main.addComponent(new Button(
+ "Open a currently uncreated application level window",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ try {
+ main.open(
+ new com.vaadin.terminal.ExternalResource(
+ new URL(
+ getURL(),
+ "mainwin-"
+ + System.currentTimeMillis()
+ + "/")), null);
+ } catch (final MalformedURLException e) {
+ }
+ }
+ }));
- main.addComponent(new Button("Commit (saves window state: size, place, scrollpos)"));
+ main.addComponent(new Button(
+ "Commit (saves window state: size, place, scrollpos)"));
}
@Override
final String postfix = name.substring("mainwin-".length());
final Window ww = new Window("Window: " + postfix);
ww.setName(name);
- ww.addComponent(new Label("This is a application-level window opened with name: " + name));
+ ww.addComponent(new Label(
+ "This is a application-level window opened with name: "
+ + name));
ww.addComponent(new Button("Click me", new Button.ClickListener() {
int state = 0;
public void buttonClick(ClickEvent event) {
- ww.addComponent(new Label("Button clicked " + (++state) + " times"));
+ ww.addComponent(new Label("Button clicked " + (++state)
+ + " times"));
}
}));
addWindow(ww);
/**
* @author IT Mill Ltd.
*/
-public class TestForPreconfiguredComponents extends CustomComponent implements Handler {
+public class TestForPreconfiguredComponents extends CustomComponent implements
+ Handler {
- private static final String[] firstnames = new String[] { "John", "Mary", "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
+ private static final String[] firstnames = new String[] { "John", "Mary",
+ "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
- private static final String[] lastnames = new String[] { "Torvalds", "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", "Einstein" };
+ private static final String[] lastnames = new String[] { "Torvalds",
+ "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding",
+ "Einstein" };
private final VerticalLayout main = new VerticalLayout();
- private final Action[] actions = new Action[] { new Action("edit"), new Action("delete") };
+ private final Action[] actions = new Action[] { new Action("edit"),
+ new Action("delete") };
private Panel al;
public void createNewView() {
main.removeAllComponents();
- main.addComponent(new Label("In Toolkit 5 we introduce new components. Previously we" + " usually used setStyle or some other methods on possibly " + "multiple steps to configure component for ones needs. These new " + "server side components are mostly just classes that in constructor " + "set base class to state that programmer wants."));
+ main.addComponent(new Label(
+ "In Toolkit 5 we introduce new components. Previously we"
+ + " usually used setStyle or some other methods on possibly "
+ + "multiple steps to configure component for ones needs. These new "
+ + "server side components are mostly just classes that in constructor "
+ + "set base class to state that programmer wants."));
main.addComponent(new Button("commit"));
public static void fillSelect(AbstractSelect s, int items) {
for (int i = 0; i < items; i++) {
- final String name = firstnames[(int) (Math.random() * (firstnames.length - 1))] + " " + lastnames[(int) (Math.random() * (lastnames.length - 1))];
+ final String name = firstnames[(int) (Math.random() * (firstnames.length - 1))]
+ + " "
+ + lastnames[(int) (Math.random() * (lastnames.length - 1))];
s.addItem(name);
}
}
Tree t = new Tree("Tree");
final String[] names = new String[100];
for (int i = 0; i < names.length; i++) {
- names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))] + " " + lastnames[(int) (Math.random() * (lastnames.length - 1))];
+ names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))]
+ + " "
+ + lastnames[(int) (Math.random() * (lastnames.length - 1))];
}
// Create tree
t.addListener(new Listener() {
public void componentEvent(Event event) {
status.addComponent(new Label(event.getClass().getName()));
- status.addComponent(new Label("selected: " + event.getSource().toString()));
+ status.addComponent(new Label("selected: "
+ + event.getSource().toString()));
}
});
*
* @author IT Mill Ltd.
*/
-public class TestForRichTextEditor extends CustomComponent implements ValueChangeListener {
+public class TestForRichTextEditor extends CustomComponent implements
+ ValueChangeListener {
private final VerticalLayout main = new VerticalLayout();
public void createNewView() {
main.removeAllComponents();
- main.addComponent(new Label("RTE uses google richtextArea and their examples toolbar."));
+ main.addComponent(new Label(
+ "RTE uses google richtextArea and their examples toolbar."));
rte = new RichTextArea();
rte.addListener(this);
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class TestForStyledUpload extends Application implements Upload.FinishedListener, FailedListener, SucceededListener, StartedListener {
+public class TestForStyledUpload extends Application implements
+ Upload.FinishedListener, FailedListener, SucceededListener,
+ StartedListener {
Layout main = new VerticalLayout();
private final Label memoryStatus;
public TestForStyledUpload() {
- main.addComponent(new Label("Clicking on button b updates information about upload components status or same with garbage collector."));
+ main.addComponent(new Label(
+ "Clicking on button b updates information about upload components status or same with garbage collector."));
up = new Upload(null, buffer);
up.setButtonCaption("Select file");
refreshMemUsage();
- transferred.setValue("Transferred " + readBytes + " of " + contentLenght);
+ transferred.setValue("Transferred " + readBytes + " of "
+ + contentLenght);
}
});
sb.append("/");
sb.append(up.getUploadSize());
sb.append(" ");
- sb.append(Math.round(100 * up.getBytesRead() / (double) up.getUploadSize()));
+ sb.append(Math.round(100 * up.getBytesRead()
+ / (double) up.getUploadSize()));
sb.append("%");
} else {
sb.append("Idle");
status.removeAllComponents();
final InputStream stream = buffer.getStream();
if (stream == null) {
- status.addComponent(new Label("Upload finished, but output buffer is null!!"));
+ status.addComponent(new Label(
+ "Upload finished, but output buffer is null!!"));
} else {
- status.addComponent(new Label("<b>Name:</b> " + event.getFilename(), Label.CONTENT_XHTML));
- status.addComponent(new Label("<b>Mimetype:</b> " + event.getMIMEType(), Label.CONTENT_XHTML));
- status.addComponent(new Label("<b>Size:</b> " + event.getLength() + " bytes.", Label.CONTENT_XHTML));
+ status.addComponent(new Label(
+ "<b>Name:</b> " + event.getFilename(), Label.CONTENT_XHTML));
+ status.addComponent(new Label("<b>Mimetype:</b> "
+ + event.getMIMEType(), Label.CONTENT_XHTML));
+ status.addComponent(new Label("<b>Size:</b> " + event.getLength()
+ + " bytes.", Label.CONTENT_XHTML));
- status.addComponent(new Link("Download " + buffer.getFileName(), new StreamResource(buffer, buffer.getFileName(), this)));
+ status.addComponent(new Link("Download " + buffer.getFileName(),
+ new StreamResource(buffer, buffer.getFileName(), this)));
status.setVisible(true);
}
}
- public interface Buffer extends StreamResource.StreamSource, Upload.Receiver {
+ public interface Buffer extends StreamResource.StreamSource,
+ Upload.Receiver {
String getFileName();
}
private FileInputStream stream;
public TmpFileBuffer() {
- final String tempFileName = "upload_tmpfile_" + System.currentTimeMillis();
+ final String tempFileName = "upload_tmpfile_"
+ + System.currentTimeMillis();
try {
file = File.createTempFile(tempFileName, null);
} catch (final IOException e) {
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-public class TestForTabSheet extends CustomComponent implements Button.ClickListener, TabSheet.SelectedTabChangeListener {
+public class TestForTabSheet extends CustomComponent implements
+ Button.ClickListener, TabSheet.SelectedTabChangeListener {
TabSheet tabsheet = new TabSheet();
Button tab1_root = new Button("Push this button");
Label tab2_root = new Label("Contents of Second Tab");
}
public void buttonClick(ClickEvent event) {
- System.out.println("tab2=" + tab2_root.isEnabled() + " tab3=" + tab3_root.isEnabled());
+ System.out.println("tab2=" + tab2_root.isEnabled() + " tab3="
+ + tab3_root.isEnabled());
tab2_root.setEnabled(true);
tab3_root.setEnabled(true);
}
*
* @author IT Mill Ltd.
*/
-public class TestForTablesInitialColumnWidthLogicRendering extends CustomComponent {
+public class TestForTablesInitialColumnWidthLogicRendering extends
+ CustomComponent {
private final VerticalLayout main = new VerticalLayout();
public void createNewView() {
main.removeAllComponents();
- main.addComponent(new Label("Below are same tables that all should render somewhat nice. Also when testing, you might want to try resizing window."));
+ main.addComponent(new Label(
+ "Below are same tables that all should render somewhat nice. Also when testing, you might want to try resizing window."));
Table t;
return t;
}
- static String[] testString = new String[] { "Jacob", "Michael", "Joshua", "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas", "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel", "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon", "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", "Cody", "Alejandro", "Caden", "Blake", "Carson" };
+ static String[] testString = new String[] { "Jacob", "Michael", "Joshua",
+ "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher",
+ "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas",
+ "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel",
+ "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon",
+ "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack",
+ "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke",
+ "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor",
+ "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan",
+ "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego",
+ "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel",
+ "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter",
+ "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase",
+ "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden",
+ "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin",
+ "Cody", "Alejandro", "Caden", "Blake", "Carson" };
public static String rndString() {
return testString[(int) (Math.random() * testString.length)];
*/
public class TestForTrees extends CustomComponent implements Handler {
- private static final String[] firstnames = new String[] { "John", "Mary", "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
+ private static final String[] firstnames = new String[] { "John", "Mary",
+ "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
- private static final String[] lastnames = new String[] { "Torvalds", "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", "Einstein" };
+ private static final String[] lastnames = new String[] { "Torvalds",
+ "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding",
+ "Einstein" };
private final VerticalLayout main = new VerticalLayout();
- private final Action[] actions = new Action[] { new Action("edit"), new Action("delete") };
+ private final Action[] actions = new Action[] { new Action("edit"),
+ new Action("delete") };
private Panel al;
public void createNewView() {
main.removeAllComponents();
- main.addComponent(new Label("Some test cases for trees. Events panel logs events that happen server side."));
+ main.addComponent(new Label(
+ "Some test cases for trees. Events panel logs events that happen server side."));
main.addComponent(new Button("commit"));
Tree t = new Tree("Tree");
final String[] names = new String[100];
for (int i = 0; i < names.length; i++) {
- names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))] + " " + lastnames[(int) (Math.random() * (lastnames.length - 1))];
+ names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))]
+ + " "
+ + lastnames[(int) (Math.random() * (lastnames.length - 1))];
}
// Create tree
t.addListener(new Listener() {
public void componentEvent(Event event) {
status.addComponent(new Label(event.getClass().getName()));
- status.addComponent(new Label("selected: " + event.getSource().toString()));
+ status.addComponent(new Label("selected: "
+ + event.getSource().toString()));
}
});
import com.vaadin.ui.Upload.StartedListener;
import com.vaadin.ui.VerticalLayout;
-public class TestForUpload extends CustomComponent implements Upload.ProgressListener {
+public class TestForUpload extends CustomComponent implements
+ Upload.ProgressListener {
private static final long serialVersionUID = -3400119871764256575L;
private CheckBox beSluggish = new CheckBox("Be sluggish");
- private CheckBox throwExecption = new CheckBox("Throw exception in receiver");
+ private CheckBox throwExecption = new CheckBox(
+ "Throw exception in receiver");
private Button interrupt = new Button("Interrupt upload");
public TestForUpload() {
setCompositionRoot(main);
- main.addComponent(new Label("This is a simple test for upload application. " + "Upload should work with big files and concurrent " + "requests should not be blocked. Button 'b' reads " + "current state into label below it. Memory receiver " + "streams upload contents into memory. You may track" + "consumption." + "tempfile receiver writes upload to file and " + "should have low memory consumption."));
-
- main.addComponent(new Label("Clicking on button b updates information about upload components status or same with garbage collector."));
+ main.addComponent(new Label(
+ "This is a simple test for upload application. "
+ + "Upload should work with big files and concurrent "
+ + "requests should not be blocked. Button 'b' reads "
+ + "current state into label below it. Memory receiver "
+ + "streams upload contents into memory. You may track"
+ + "consumption."
+ + "tempfile receiver writes upload to file and "
+ + "should have low memory consumption."));
+
+ main.addComponent(new Label(
+ "Clicking on button b updates information about upload components status or same with garbage collector."));
textField = new TextField("Test field");
textFieldValue = new Label();
pi.setVisible(true);
pi2.setVisible(true);
l.setValue("Started uploading file " + event.getFilename());
- textFieldValue.setValue(" TestFields value at the upload start is:" + textField.getValue());
+ textFieldValue
+ .setValue(" TestFields value at the upload start is:"
+ + textField.getValue());
}
});
pi2.setVisible(false);
if (event instanceof Upload.FailedEvent) {
Exception reason = ((Upload.FailedEvent) event).getReason();
- l.setValue("Finished with failure ( " + reason + " ), idle");
+ l.setValue("Finished with failure ( " + reason
+ + " ), idle");
} else if (event instanceof Upload.SucceededEvent) {
l.setValue("Finished with succes, idle");
} else {
status.removeAllComponents();
final InputStream stream = buffer.getStream();
if (stream == null) {
- status.addComponent(new Label("Upload finished, but output buffer is null"));
+ status.addComponent(new Label(
+ "Upload finished, but output buffer is null"));
} else {
- status.addComponent(new Label("<b>Name:</b> " + event.getFilename(), Label.CONTENT_XHTML));
- status.addComponent(new Label("<b>Mimetype:</b> " + event.getMIMEType(), Label.CONTENT_XHTML));
- status.addComponent(new Label("<b>Size:</b> " + event.getLength() + " bytes.", Label.CONTENT_XHTML));
-
- status.addComponent(new Link("Download " + buffer.getFileName(), new StreamResource(buffer, buffer.getFileName(), getApplication())));
+ status.addComponent(new Label("<b>Name:</b> "
+ + event.getFilename(), Label.CONTENT_XHTML));
+ status.addComponent(new Label("<b>Mimetype:</b> "
+ + event.getMIMEType(), Label.CONTENT_XHTML));
+ status.addComponent(new Label("<b>Size:</b> "
+ + event.getLength() + " bytes.",
+ Label.CONTENT_XHTML));
+
+ status.addComponent(new Link("Download "
+ + buffer.getFileName(), new StreamResource(buffer,
+ buffer.getFileName(), getApplication())));
status.setVisible(true);
}
uploadBufferSelector.addItem("memory");
uploadBufferSelector.setValue("memory");
uploadBufferSelector.addItem("tempfile");
- uploadBufferSelector.addListener(new AbstractField.ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- setBuffer();
- }
- });
+ uploadBufferSelector
+ .addListener(new AbstractField.ValueChangeListener() {
+ public void valueChange(ValueChangeEvent event) {
+ setBuffer();
+ }
+ });
main.addComponent(uploadBufferSelector);
main.addComponent(up);
sb.append("/");
sb.append(up.getUploadSize());
sb.append(" ");
- sb.append(Math.round(100 * up.getBytesRead() / (double) up.getUploadSize()));
+ sb.append(Math.round(100 * up.getBytesRead()
+ / (double) up.getUploadSize()));
sb.append("%");
} else {
sb.append("Idle");
refreshMemUsage();
}
- public interface Buffer extends StreamResource.StreamSource, Upload.Receiver {
+ public interface Buffer extends StreamResource.StreamSource,
+ Upload.Receiver {
String getFileName();
}
private File file;
public TmpFileBuffer() {
- final String tempFileName = "upload_tmpfile_" + System.currentTimeMillis();
+ final String tempFileName = "upload_tmpfile_"
+ + System.currentTimeMillis();
try {
file = File.createTempFile(tempFileName, null);
} catch (final IOException e) {
return new FileOutputStream(file) {
@Override
- public void write(byte[] b, int off, int len) throws IOException {
+ public void write(byte[] b, int off, int len)
+ throws IOException {
beSluggish();
throwExecption();
super.write(b, off, len);
final VerticalLayout main = new VerticalLayout();
setCompositionRoot(main);
- main.addComponent(new Button("Open in this window", new Button.ClickListener() {
+ main.addComponent(new Button("Open in this window",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final ExternalResource r = new ExternalResource("http://www.google.com");
- getApplication().getMainWindow().open(r);
+ public void buttonClick(ClickEvent event) {
+ final ExternalResource r = new ExternalResource(
+ "http://www.google.com");
+ getApplication().getMainWindow().open(r);
- }
+ }
- }));
+ }));
- main.addComponent(new Button("Open in target \"mytarget\"", new Button.ClickListener() {
+ main.addComponent(new Button("Open in target \"mytarget\"",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final ExternalResource r = new ExternalResource("http://www.google.com");
- getApplication().getMainWindow().open(r, "mytarget");
+ public void buttonClick(ClickEvent event) {
+ final ExternalResource r = new ExternalResource(
+ "http://www.google.com");
+ getApplication().getMainWindow().open(r, "mytarget");
- }
+ }
- }));
+ }));
- main.addComponent(new Button("Open in target \"secondtarget\"", new Button.ClickListener() {
+ main.addComponent(new Button("Open in target \"secondtarget\"",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final ExternalResource r = new ExternalResource("http://www.google.com");
- getApplication().getMainWindow().open(r, "secondtarget");
+ public void buttonClick(ClickEvent event) {
+ final ExternalResource r = new ExternalResource(
+ "http://www.google.com");
+ getApplication().getMainWindow()
+ .open(r, "secondtarget");
- }
+ }
- }));
+ }));
}
final VerticalLayout main = new VerticalLayout();
- main.addComponent(new Label("Click the button to create a new inline window."));
+ main.addComponent(new Label(
+ "Click the button to create a new inline window."));
final CheckBox asModal = new CheckBox("As modal");
main.addComponent(asModal);
- final Button create = new Button("Create a new window", new ClickListener() {
+ final Button create = new Button("Create a new window",
+ new ClickListener() {
- public void buttonClick(ClickEvent event) {
- Window w = new Window("Testing Window");
+ public void buttonClick(ClickEvent event) {
+ Window w = new Window("Testing Window");
- if (((Boolean) asModal.getValue()).booleanValue()) {
- w.setModal(true);
- }
-
- AbstractSelect s1 = new OptionGroup();
- s1.setCaption("1. Select output format");
- s1.addItem("Excel sheet");
- s1.addItem("CSV plain text");
- s1.setValue("Excel sheet");
- s1.setImmediate(true);
-
- s2 = new Select();
- s2.addItem("Separate by comma (,)");
- s2.addItem("Separate by colon (:)");
- s2.addItem("Separate by semicolon (;)");
- s2.setEnabled(false);
+ if (((Boolean) asModal.getValue()).booleanValue()) {
+ w.setModal(true);
+ }
- s1.addListener(new ValueChangeListener() {
+ AbstractSelect s1 = new OptionGroup();
+ s1.setCaption("1. Select output format");
+ s1.addItem("Excel sheet");
+ s1.addItem("CSV plain text");
+ s1.setValue("Excel sheet");
+ s1.setImmediate(true);
+
+ s2 = new Select();
+ s2.addItem("Separate by comma (,)");
+ s2.addItem("Separate by colon (:)");
+ s2.addItem("Separate by semicolon (;)");
+ s2.setEnabled(false);
+
+ s1.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ String v = (String) event.getProperty()
+ .getValue();
+ if (v.equals("CSV plain text")) {
+ s2.setEnabled(true);
+ } else {
+ s2.setEnabled(false);
+ }
+ }
+
+ });
+
+ w.addComponent(s1);
+ w.addComponent(s2);
+
+ Slider s = new Slider();
+ s.setCaption("Volume");
+ s.setMax(13);
+ s.setMin(12);
+ s.setResolution(2);
+ s.setImmediate(true);
+ // s.setOrientation(Slider.ORIENTATION_VERTICAL);
+ // s.setArrows(false);
+
+ w.addComponent(s);
+
+ getApplication().getMainWindow().addWindow(w);
- public void valueChange(ValueChangeEvent event) {
- String v = (String) event.getProperty().getValue();
- if (v.equals("CSV plain text")) {
- s2.setEnabled(true);
- } else {
- s2.setEnabled(false);
- }
}
});
- w.addComponent(s1);
- w.addComponent(s2);
-
- Slider s = new Slider();
- s.setCaption("Volume");
- s.setMax(13);
- s.setMin(12);
- s.setResolution(2);
- s.setImmediate(true);
- // s.setOrientation(Slider.ORIENTATION_VERTICAL);
- // s.setArrows(false);
-
- w.addComponent(s);
-
- getApplication().getMainWindow().addWindow(w);
-
- }
-
- });
-
main.addComponent(create);
setCompositionRoot(main);
private Label createEmbedded(String URL) {
final int width = 600;
final int height = 250;
- final String iFrame = "<iframe height=\"" + height + "\" width=\"" + width + "\" src=\"" + URL + "\" />";
+ final String iFrame = "<iframe height=\"" + height + "\" width=\""
+ + width + "\" src=\"" + URL + "\" />";
return new Label(iFrame, Label.CONTENT_XHTML);
}
MyTest myTest = new MyTest();
- MethodProperty<Integer> methodProperty2 = new MethodProperty<Integer>(Integer.TYPE, myTest, "getInt", "setInt", new Object[0], new Object[] { null }, 0);
+ MethodProperty<Integer> methodProperty2 = new MethodProperty<Integer>(
+ Integer.TYPE, myTest, "getInt", "setInt", new Object[0],
+ new Object[] { null }, 0);
methodProperty2.setValue("3");
final Window mainWindow = new Window("TestSetVisibleAndCaching");
setMainWindow(mainWindow);
- panelA.addComponent(new Label("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
- panelB.addComponent(new Label("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"));
- panelC.addComponent(new Label("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"));
+ panelA.addComponent(new Label(
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
+ panelB.addComponent(new Label(
+ "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"));
+ panelC.addComponent(new Label(
+ "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"));
- mainWindow.addComponent(new Label("Inspect transfered data from server to " + "client using firebug (http request / response cycles)." + " See how widgets are re-used," + " after each panel is once shown in GUI then" + " their contents are not resend."));
+ mainWindow
+ .addComponent(new Label(
+ "Inspect transfered data from server to "
+ + "client using firebug (http request / response cycles)."
+ + " See how widgets are re-used,"
+ + " after each panel is once shown in GUI then"
+ + " their contents are not resend."));
mainWindow.addComponent(buttonNextPanel);
mainWindow.addComponent(panelA);
mainWindow.addComponent(panelB);
if (prev == null) {
getMainWindow().showNotification("No more test cases");
} else {
- getMainWindow().showNotification("Selected test:" + prev.getTestableName());
+ getMainWindow().showNotification(
+ "Selected test:" + prev.getTestableName());
select.setValue(prev);
select.requestRepaint();
}
if (next == null) {
getMainWindow().showNotification("No more test cases");
} else {
- getMainWindow().showNotification("Selected test:" + next.getTestableName());
+ getMainWindow().showNotification(
+ "Selected test:" + next.getTestableName());
select.setValue(next);
select.requestRepaint();
}
String[] list2 = (new File(dir.getFile())).list();
for (int i = 0; i < list2.length; i++) {
String f = list2[i];
- if (f.endsWith(".class") && (f.indexOf("CustomComponent") == -1) && (f.indexOf("Window") == -1)) {
+ if (f.endsWith(".class") && (f.indexOf("CustomComponent") == -1)
+ && (f.indexOf("Window") == -1)) {
f = f.replaceAll(".class", "");
String className = "com.vaadin.ui." + f;
Class<?> c;
cont.addItem(t);
t = new Testable(c) {
@Override
- public Component getComponent() throws InstantiationException, IllegalAccessException {
+ public Component getComponent()
+ throws InstantiationException,
+ IllegalAccessException {
Component c = super.getComponent();
- Panel p = new Panel("Wrapper panel (400px*400px)");
+ Panel p = new Panel(
+ "Wrapper panel (400px*400px)");
p.setContent(new VerticalLayout());
p.setWidth("400px");
p.setHeight("400px");
StringBuffer sb = new StringBuffer();
sb.append(classToTest.getName().replaceAll("com.vaadin.ui.", ""));
sb.append("[");
- for (Iterator<Configuration> i = configurations.iterator(); i.hasNext();) {
+ for (Iterator<Configuration> i = configurations.iterator(); i
+ .hasNext();) {
sb.append((i.next()).getDescription());
if (i.hasNext()) {
sb.append(",");
* @throws InstantiationException
* @throws IllegalAccessException
*/
- public Component getComponent() throws InstantiationException, IllegalAccessException {
+ public Component getComponent() throws InstantiationException,
+ IllegalAccessException {
Component c = (Component) classToTest.newInstance();
if (c instanceof Button) {
if (AbstractSelect.class.isAssignableFrom(c.getClass())) {
if (c instanceof Table) {
Table new_name = (Table) c;
- new_name.setContainerDataSource(TestForTablesInitialColumnWidthLogicRendering.getTestTable(5, 100).getContainerDataSource());
+ new_name.setContainerDataSource(TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(5, 100).getContainerDataSource());
} else {
AbstractSelect new_name = (AbstractSelect) c;
- Container cont = TestForTablesInitialColumnWidthLogicRendering.getTestTable(2, 8).getContainerDataSource();
+ Container cont = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(2, 8).getContainerDataSource();
new_name.setContainerDataSource(cont);
- new_name.setItemCaptionPropertyId(cont.getContainerPropertyIds().iterator().next());
+ new_name.setItemCaptionPropertyId(cont
+ .getContainerPropertyIds().iterator().next());
}
} else if (c instanceof ComponentContainer) {
((Label) c).setValue("Test label");
}
- for (Iterator<Configuration> i = configurations.iterator(); i.hasNext();) {
+ for (Iterator<Configuration> i = configurations.iterator(); i
+ .hasNext();) {
Configuration conf = i.next();
conf.configure(c);
}
* @since 4.0.0
*
*/
-public class TreeFilesystem extends com.vaadin.Application implements Tree.ExpandListener {
+public class TreeFilesystem extends com.vaadin.Application implements
+ Tree.ExpandListener {
// Filesystem explorer panel and it's components
private final Panel explorerPanel = new Panel("Filesystem explorer");
* @since 4.0.0
*
*/
-public class TreeFilesystemContainer extends com.vaadin.Application implements Listener {
+public class TreeFilesystemContainer extends com.vaadin.Application implements
+ Listener {
// Filesystem explorer panel and it's components
private final Panel explorerPanel = new Panel("Filesystem explorer");
// Check if event is about changing value
if (event.getClass() == Field.ValueChangeEvent.class) {
// Update property panel contents
- final FileItem fileItem = (FileItem) filesystem.getItem(filesystem.getValue());
+ final FileItem fileItem = (FileItem) filesystem
+ .getItem(filesystem.getValue());
fileProperties.setIcon(fileItem.getIcon());
- fileProperties.setCaption(fileItem.getName() + ", size " + fileItem.getSize() + " bytes.");
+ fileProperties.setCaption(fileItem.getName() + ", size "
+ + fileItem.getSize() + " bytes.");
propertyPanel.setEnabled(true);
}
// here we could check for other type of events for filesystem
* @since 3.1.1
* @author IT Mill Ltd.
*/
-public class UpgradingSample extends Application implements Property.ValueChangeListener {
+public class UpgradingSample extends Application implements
+ Property.ValueChangeListener {
/* Menu for navigating inside the application. */
private final Tree menu = new Tree();
/* Contents of the website */
- private final String[][] pages = { { "Welcome", "Welcome to our website..." }, { "Products", "Public product information." }, { "Contact", "Public contact information." }, { "CRM", "CRM Database requiring login." }, { "Intranet", "Internal information database." } };
+ private final String[][] pages = {
+ { "Welcome", "Welcome to our website..." },
+ { "Products", "Public product information." },
+ { "Contact", "Public contact information." },
+ { "CRM", "CRM Database requiring login." },
+ { "Intranet", "Internal information database." } };
/* Application layout */
private final GridLayout layout = new GridLayout(2, 1);
}
// Simple loginbox component for the application
- public class LoginBox extends CustomComponent implements Application.UserChangeListener {
+ public class LoginBox extends CustomComponent implements
+ Application.UserChangeListener {
// The components this loginbox is composed of
private final TextField loginName = new TextField("Name");
private final Panel statusPanel = new Panel();
- private final Button logoutButton = new Button("Logout", UpgradingSample.this, "close");
+ private final Button logoutButton = new Button("Logout",
+ UpgradingSample.this, "close");
private final Label statusLabel = new Label();
}
public void populateSelect() {
- final String[] names = new String[] { "John", "Mary", "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
+ final String[] names = new String[] { "John", "Mary", "Joe", "Sarah",
+ "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
for (int j = 0; j < 4; j++) {
Integer id = new Integer(sequence++);
Item item = select.addItem(id);
- item.getItemProperty("CAPTION").setValue(id.toString() + ": " + names[random.nextInt() % names.length]);
+ item.getItemProperty("CAPTION").setValue(
+ id.toString() + ": "
+ + names[random.nextInt() % names.length]);
}
}
// here could be db insert or other backend operation
Integer id = new Integer(sequence++);
Item item = select.addItem(id);
- item.getItemProperty("CAPTION").setValue(id.toString() + ": " + newItemCaption);
+ item.getItemProperty("CAPTION").setValue(
+ id.toString() + ": " + newItemCaption);
select.setValue(id);
}
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
-public class UsingObjectsInSelect extends com.vaadin.Application implements ValueChangeListener {
+public class UsingObjectsInSelect extends com.vaadin.Application implements
+ ValueChangeListener {
private final Select select = new Select();
- private final Label selectedTask = new Label("Selected task", Label.CONTENT_XHTML);
+ private final Label selectedTask = new Label("Selected task",
+ Label.CONTENT_XHTML);
public LinkedList<?> exampleTasks = new LinkedList<Object>();
}
public void createExampleTasks() {
- final String[] assignedTo = new String[] { "John", "Mary", "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
- final String[] type = new String[] { "Enhancement", "Bugfix", "Testing", "Task" };
+ final String[] assignedTo = new String[] { "John", "Mary", "Joe",
+ "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
+ final String[] type = new String[] { "Enhancement", "Bugfix",
+ "Testing", "Task" };
for (int j = 0; j < 100; j++) {
- final Task task = new Task(type[(int) (random.nextDouble() * (type.length - 1))], assignedTo[(int) (random.nextDouble() * (assignedTo.length - 1))], random.nextInt(100));
+ final Task task = new Task(
+ type[(int) (random.nextDouble() * (type.length - 1))],
+ assignedTo[(int) (random.nextDouble() * (assignedTo.length - 1))],
+ random.nextInt(100));
select.addItem(task);
}
}
public void valueChange(ValueChangeEvent event) {
final Task task = (Task) select.getValue();
- selectedTask.setValue("<b>Type:</b> " + task.getType() + "<br /><b>Assigned to:</b> " + task.getAssignedTo() + "<br /><b>Estimated hours: </b>" + task.getEstimatedHours());
+ selectedTask.setValue("<b>Type:</b> " + task.getType()
+ + "<br /><b>Assigned to:</b> " + task.getAssignedTo()
+ + "<br /><b>Estimated hours: </b>" + task.getEstimatedHours());
}
/**
@SuppressWarnings("serial")
public class NewItemsESCPress extends TestBase {
- @Override
- protected void setup() {
- final TextField addedItems = new TextField("Last added items:");
- addedItems.setRows(10);
- addComponent(addedItems);
-
- final ComboBox box = new ComboBox("New items are allowed");
- box.setNewItemsAllowed(true);
- box.setNewItemHandler(new NewItemHandler() {
- public void addNewItem(String newItemCaption) {
- String value = (String) addedItems.getValue();
- addedItems.setValue(value + newItemCaption + "\n" );
- box.addItem(newItemCaption);
- }
- });
- box.setImmediate(true);
- addComponent(box);
- }
+ @Override
+ protected void setup() {
+ final TextField addedItems = new TextField("Last added items:");
+ addedItems.setRows(10);
+ addComponent(addedItems);
- @Override
- protected String getDescription() {
- return "Firefox flashes the previously entered value when holding the ESC-key.";
- }
+ final ComboBox box = new ComboBox("New items are allowed");
+ box.setNewItemsAllowed(true);
+ box.setNewItemHandler(new NewItemHandler() {
+ public void addNewItem(String newItemCaption) {
+ String value = (String) addedItems.getValue();
+ addedItems.setValue(value + newItemCaption + "\n");
+ box.addItem(newItemCaption);
+ }
+ });
+ box.setImmediate(true);
+ addComponent(box);
+ }
- @Override
- protected Integer getTicketNumber() {
- return 5694;
- }
+ @Override
+ protected String getDescription() {
+ return "Firefox flashes the previously entered value when holding the ESC-key.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5694;
+ }
}
f.setWidth("100%");
f.setHeight("100%");
- Label l = new Label("This green label should consume all available space, pushing ok button to bottom of the view");
+ Label l = new Label(
+ "This green label should consume all available space, pushing ok button to bottom of the view");
l.setSizeFull();
CssLayout lo = new CssLayout() {
@Override
protected String getDescription() {
- return "Size changes from windows (both sub " + "and browsers level) should get back to server." + " If size changes, a separate server side event should occur.";
+ return "Size changes from windows (both sub "
+ + "and browsers level) should get back to server."
+ + " If size changes, a separate server side event should occur.";
}
@Override
getMainWindow().addListener(new ResizeListener() {
public void windowResized(ResizeEvent e) {
- l.setValue("Current main window size: " + getMainWindow().getWidth() + " x " + getMainWindow().getHeight());
+ l.setValue("Current main window size: "
+ + getMainWindow().getWidth() + " x "
+ + getMainWindow().getHeight());
}
});
}
public void updateLabel() {
- sizeLabel.setValue(getWidth() + Sizeable.UNIT_SYMBOLS[getWidthUnits()] + " x " + getHeight() + Sizeable.UNIT_SYMBOLS[getHeightUnits()]);
+ sizeLabel
+ .setValue(getWidth() + Sizeable.UNIT_SYMBOLS[getWidthUnits()]
+ + " x " + getHeight()
+ + Sizeable.UNIT_SYMBOLS[getHeightUnits()]);
}
}
public abstract class Feature extends CustomComponent {
- private static final String PROP_REMINDER_TEXT = "" + "<br /><br />Note: Use <b>Properties</b> panel located at the top" + " right corner to try out how different properties affect" + " the presentation or functionality of currently selected component.";
+ private static final String PROP_REMINDER_TEXT = ""
+ + "<br /><br />Note: Use <b>Properties</b> panel located at the top"
+ + " right corner to try out how different properties affect"
+ + " the presentation or functionality of currently selected component.";
private boolean propsReminder = true;
* @param url
*/
public void setJavadocURL(String url) {
- javadoc.setValue("<iframe width=\"100%\" src=\"http://www.vaadin.com/api/com/vaadin/" + url + "\"></iframe>");
+ javadoc.setValue("<iframe width=\"100%\" src=\"http://www.vaadin.com/api/com/vaadin/"
+ + url + "\"></iframe>");
}
/**
final HorizontalLayout layout = new HorizontalLayout();
mainLayout.addComponent(layout);
if (getImage() != null) {
- layout.addComponent(new Embedded("", new ClassResource(getImage(), getApplication())));
+ layout.addComponent(new Embedded("", new ClassResource(
+ getImage(), getApplication())));
}
String label = "";
label += getDescriptionXHTML();
label += PROP_REMINDER_TEXT;
}
if (title != null) {
- layout.addComponent(new Label("<h3>" + title + "</h3>", Label.CONTENT_XHTML));
+ layout.addComponent(new Label("<h3>" + title + "</h3>",
+ Label.CONTENT_XHTML));
}
description = new Label(label, Label.CONTENT_XHTML);
mainLayout.addComponent(description);
if (example != null) {
final VerticalLayout l = new VerticalLayout();
if (getTitle() != null) {
- l.addComponent(new Label("<b>// " + getTitle() + " example</b>", Label.CONTENT_XHTML));
+ l.addComponent(new Label(
+ "<b>// " + getTitle() + " example</b>",
+ Label.CONTENT_XHTML));
}
l.addComponent(new Label(example, Label.CONTENT_PREFORMATTED));
ts.addTab(l, "Code Sample", null);
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-public class FeatureForm extends Feature implements Property.ValueChangeListener {
+public class FeatureForm extends Feature implements
+ Property.ValueChangeListener {
VerticalLayout 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" + " easy connection of commit- and discard buttons. All the form" + " fields can be customized by adding validators, setting captions and icons, " + " setting immediateness, etc. Also direct mechanism for replacing existing" + " fields with selections is given." + " <br /><br />Form provides customizable editor for classes implementing" + " Item-interface. Also the form itself" + " implements this interface for easier connectivity to other items." + " To use the form as editor for an item, just connect the item to" + " form.After the item has been connected to the form," + " the automatically created fields can be customized and new fields can" + " be added. If you need to connect a class that does not implement" + " Item-interface, most properties of any" + " class following bean pattern, can be accessed trough" + " BeanItem." + " <br /><br />The best example of Form usage is the this feature browser itself; " + " all the Property-panels in demos are composed of Form-components.";
+ return "Form is a flexible, yet simple container for fields. "
+ + " It provides support for any layouts and provides buffering interface for"
+ + " easy connection of commit- and discard buttons. All the form"
+ + " fields can be customized by adding validators, setting captions and icons, "
+ + " setting immediateness, etc. Also direct mechanism for replacing existing"
+ + " fields with selections is given."
+ + " <br /><br />Form provides customizable editor for classes implementing"
+ + " Item-interface. Also the form itself"
+ + " implements this interface for easier connectivity to other items."
+ + " To use the form as editor for an item, just connect the item to"
+ + " form.After the item has been connected to the form,"
+ + " the automatically created fields can be customized and new fields can"
+ + " be added. If you need to connect a class that does not implement"
+ + " Item-interface, most properties of any"
+ + " class following bean pattern, can be accessed trough"
+ + " BeanItem."
+ + " <br /><br />The best example of Form usage is the this feature browser itself; "
+ + " all the Property-panels in demos are composed of Form-components.";
}
@Override
// Integer(AbstractOrderedLayout.ORIENTATION_VERTICAL) }, new Object[] {
// "Horizontal", "Vertical" });
final Select themes = (Select) propertyPanel.getField("style");
- themes.addItem("form").getItemProperty(themes.getItemCaptionPropertyId()).setValue("form");
+ themes.addItem("form")
+ .getItemProperty(themes.getItemCaptionPropertyId())
+ .setValue("form");
// propertyPanel.addProperties("OrderedLayout Properties", ap);
setJavadocURL("ui/OrderedLayout.html");
@Override
protected String getExampleSrc() {
- return "OrderedLayout ol = new OrderedLayout(AbstractOrderedLayout.ORIENTATION_FLOW);\n" + "ol.addComponent(new TextField(\"Textfield caption\"));\n" + "ol.addComponent(new Label(\"Label\"));\n";
+ return "OrderedLayout ol = new OrderedLayout(AbstractOrderedLayout.ORIENTATION_FLOW);\n"
+ + "ol.addComponent(new TextField(\"Textfield caption\"));\n"
+ + "ol.addComponent(new Label(\"Label\"));\n";
}
*/
@Override
protected String getDescriptionXHTML() {
- return "This feature provides a container for laying out components either " + "vertically, horizontally or flowingly. The orientation may be changed " + "during runtime. It also defines a special style for themes to implement called \"form\"" + "that is used for input forms where the components are laid-out side-by-side " + "with their captions." + "<br /><br />" + "On the demo tab you can try out how the different properties " + "affect the presentation of the component.";
+ return "This feature provides a container for laying out components either "
+ + "vertically, horizontally or flowingly. The orientation may be changed "
+ + "during runtime. It also defines a special style for themes to implement called \"form\""
+ + "that is used for input forms where the components are laid-out side-by-side "
+ + "with their captions."
+ + "<br /><br />"
+ + "On the demo tab you can try out how the different properties "
+ + "affect the presentation of the component.";
}
@Override
// Properties
propertyPanel = new PropertyPanel(tf);
- final Form f = propertyPanel.createBeanPropertySet(new String[] { "columns", "rows", "wordwrap", "writeThrough", "readThrough", "nullRepresentation", "nullSettingAllowed", "secret" });
+ final Form f = propertyPanel.createBeanPropertySet(new String[] {
+ "columns", "rows", "wordwrap", "writeThrough", "readThrough",
+ "nullRepresentation", "nullSettingAllowed", "secret" });
propertyPanel.addProperties("Text field properties", f);
setJavadocURL("ui/TextField.html");
@Override
protected String getExampleSrc() {
- return "TextField tf = new TextField(\"Caption\");\n" + "tf.setValue(\"Contents\");";
+ return "TextField tf = new TextField(\"Caption\");\n"
+ + "tf.setValue(\"Contents\");";
}
/**
*/
@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. " + "As with all Data-components of Vaadin, the TextField can also be bound to an " + "underlying data source, both directly or in a buffered (asynchronous) " + "mode. In buffered mode its background color will change to indicate " + "that the value has changed but is not committed." + "<br /><br />Furthermore a validators may be bound to the component to " + "check and validate the given input before it is actually committed." + "<br /><br />On the demo tab you can try out how the different properties affect the " + "presentation of the component.";
+ return "TextField combines the logic of both the single line text-entry field and the multi-line "
+ + "text-area into one component. "
+ + "As with all Data-components of Vaadin, the TextField can also be bound to an "
+ + "underlying data source, both directly or in a buffered (asynchronous) "
+ + "mode. In buffered mode its background color will change to indicate "
+ + "that the value has changed but is not committed."
+ + "<br /><br />Furthermore a validators may be bound to the component to "
+ + "check and validate the given input before it is actually committed."
+ + "<br /><br />On the demo tab you can try out how the different properties affect the "
+ + "presentation of the component.";
}
@Override
import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
-public class PropertyPanel extends Panel implements Button.ClickListener, Property.ValueChangeListener {
+public class PropertyPanel extends Panel implements Button.ClickListener,
+ Property.ValueChangeListener {
private Select addComponent;
if (objectToConfigure instanceof Select) {
addSelectProperties();
}
- if (objectToConfigure instanceof AbstractField && !(objectToConfigure instanceof Table || objectToConfigure instanceof Tree)) {
+ if (objectToConfigure instanceof AbstractField
+ && !(objectToConfigure instanceof Table || objectToConfigure instanceof Tree)) {
addFieldProperties();
}
if ((objectToConfigure instanceof AbstractComponentContainer)) {
allProperties.addContainerProperty("Type", String.class, "");
allProperties.addContainerProperty("R/W", String.class, "");
allProperties.addContainerProperty("Demo", String.class, "");
- allProperties.setColumnAlignments(new String[] { Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER });
+ allProperties.setColumnAlignments(new String[] { Table.ALIGN_LEFT,
+ Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER });
allProperties.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID);
allProperties.setPageLength(0);
allProperties.setSizeFull();
// Fill the table
for (int i = 0; i < pd.length; i++) {
- allProperties.addItem(new Object[] { pd[i].getName(), pd[i].getPropertyType().getName(), (pd[i].getWriteMethod() == null ? "R" : "R/W"), (listed.contains(pd[i].getName()) ? "x" : "") }, pd[i]);
+ allProperties.addItem(
+ new Object[] { pd[i].getName(),
+ pd[i].getPropertyType().getName(),
+ (pd[i].getWriteMethod() == null ? "R" : "R/W"),
+ (listed.contains(pd[i].getName()) ? "x" : "") },
+ pd[i]);
}
}
private void addBasicComponentProperties() {
// Set of properties
- final Form set = createBeanPropertySet(new String[] { "caption", "icon", "componentError", "description", "enabled", "visible", "style", "readOnly", "immediate" });
+ final Form set = createBeanPropertySet(new String[] { "caption",
+ "icon", "componentError", "description", "enabled", "visible",
+ "style", "readOnly", "immediate" });
// Icon
- set.replaceWithSelect("icon", new Object[] { null, new ThemeResource("icon/files/file.gif") }, new Object[] { "No icon", "Sample icon" });
+ set.replaceWithSelect("icon", new Object[] { null,
+ new ThemeResource("icon/files/file.gif") }, new Object[] {
+ "No icon", "Sample icon" });
// Component error
Throwable sampleException;
} catch (final NullPointerException e) {
sampleException = e;
}
- set.replaceWithSelect("componentError", new Object[] { null, new UserError("Sample text error message."), new UserError("<h3>Error message formatting</h3><p>Error messages can " + "contain any UIDL formatting, like: <ul><li><b>Bold" + "</b></li><li><i>Italic</i></li></ul></p>", UserError.CONTENT_UIDL, ErrorMessage.INFORMATION), new SystemError("This is an example of exception error reposting", sampleException) }, new Object[] { "No error", "Sample text error", "Sample Formatted error", "Sample System Error" });
+ set.replaceWithSelect(
+ "componentError",
+ new Object[] {
+ null,
+ new UserError("Sample text error message."),
+ new UserError(
+ "<h3>Error message formatting</h3><p>Error messages can "
+ + "contain any UIDL formatting, like: <ul><li><b>Bold"
+ + "</b></li><li><i>Italic</i></li></ul></p>",
+ UserError.CONTENT_UIDL,
+ ErrorMessage.INFORMATION),
+ new SystemError(
+ "This is an example of exception error reposting",
+ sampleException) }, new Object[] { "No error",
+ "Sample text error", "Sample Formatted error",
+ "Sample System Error" });
// Style
- final String currentStyle = ((Component) objectToConfigure).getStyleName();
+ final String currentStyle = ((Component) objectToConfigure)
+ .getStyleName();
if (currentStyle == null) {
- set.replaceWithSelect("style", new Object[] { null }, new Object[] { "Default" }).setNewItemsAllowed(true);
+ set.replaceWithSelect("style", new Object[] { null },
+ new Object[] { "Default" }).setNewItemsAllowed(true);
} else {
- set.replaceWithSelect("style", new Object[] { null, currentStyle }, new Object[] { "Default", currentStyle }).setNewItemsAllowed(true);
+ set.replaceWithSelect("style", new Object[] { null, currentStyle },
+ new Object[] { "Default", currentStyle })
+ .setNewItemsAllowed(true);
}
// Set up descriptions
- set.getField("caption").setDescription("Component caption is the title of the component. Usage of the caption is optional and the " + "exact behavior of the propery is defined by the component. Setting caption null " + "or empty disables the caption.");
- set.getField("enabled").setDescription("Enabled property controls the usage of the component. If the component is disabled (enabled=false)," + " it can not receive any events from the terminal. In most cases it makes the usage" + " of the component easier, if the component visually looks disbled (for example is grayed), " + "when it can not be used.");
- set.getField("icon").setDescription("Icon of the component selects the main icon of the component. The usage of the icon is identical " + "to caption and in most components caption and icon are kept together. Icons can be " + "loaded from any resources (see Terminal/Resources for more information). Some components " + "contain more than just the captions icon. Those icons are controlled through their " + "own properties.");
- set.getField("visible").setDescription("Visibility property says if the component is renreded or not. Invisible components are implicitly " + "disabled, as there is no visible user interface to send event.");
- set.getField("description").setDescription("Description is designed to allow easy addition of short tooltips, like this. Like the caption," + " setting description null or empty disables the description.");
- set.getField("readOnly").setDescription("Those components that have internal state that can be written are settable to readOnly-mode," + " where the object can only be read, not written.");
- set.getField("componentError").setDescription("Vaadin supports extensive error reporting. One part of the error reporting are component" + " errors that can be controlled by the programmer. This example only contains couple of " + "sample errors; to get the full picture, read browse ErrorMessage-interface implementors " + "API documentation.");
- set.getField("immediate").setDescription("Not all terminals can send the events immediately to server from all action. Web is the most " + "typical environment where many events (like textfield changed) are not sent to server, " + "before they are explicitly submitted. Setting immediate property true (by default this " + "is false for most components), the programmer can assure that the application is" + " notified as soon as possible about the value change in this component.");
- set.getField("style").setDescription("Themes specify the overall looks of the user interface. In addition component can have a set of " + "styles, that can be visually very different (like datefield calendar- and text-styles), " + "but contain the same logical functionality. As a rule of thumb, theme specifies if a " + "component is blue or yellow and style determines how the component is used.");
+ set.getField("caption")
+ .setDescription(
+ "Component caption is the title of the component. Usage of the caption is optional and the "
+ + "exact behavior of the propery is defined by the component. Setting caption null "
+ + "or empty disables the caption.");
+ set.getField("enabled")
+ .setDescription(
+ "Enabled property controls the usage of the component. If the component is disabled (enabled=false),"
+ + " it can not receive any events from the terminal. In most cases it makes the usage"
+ + " of the component easier, if the component visually looks disbled (for example is grayed), "
+ + "when it can not be used.");
+ set.getField("icon")
+ .setDescription(
+ "Icon of the component selects the main icon of the component. The usage of the icon is identical "
+ + "to caption and in most components caption and icon are kept together. Icons can be "
+ + "loaded from any resources (see Terminal/Resources for more information). Some components "
+ + "contain more than just the captions icon. Those icons are controlled through their "
+ + "own properties.");
+ set.getField("visible")
+ .setDescription(
+ "Visibility property says if the component is renreded or not. Invisible components are implicitly "
+ + "disabled, as there is no visible user interface to send event.");
+ set.getField("description")
+ .setDescription(
+ "Description is designed to allow easy addition of short tooltips, like this. Like the caption,"
+ + " setting description null or empty disables the description.");
+ set.getField("readOnly")
+ .setDescription(
+ "Those components that have internal state that can be written are settable to readOnly-mode,"
+ + " where the object can only be read, not written.");
+ set.getField("componentError")
+ .setDescription(
+ "Vaadin supports extensive error reporting. One part of the error reporting are component"
+ + " errors that can be controlled by the programmer. This example only contains couple of "
+ + "sample errors; to get the full picture, read browse ErrorMessage-interface implementors "
+ + "API documentation.");
+ set.getField("immediate")
+ .setDescription(
+ "Not all terminals can send the events immediately to server from all action. Web is the most "
+ + "typical environment where many events (like textfield changed) are not sent to server, "
+ + "before they are explicitly submitted. Setting immediate property true (by default this "
+ + "is false for most components), the programmer can assure that the application is"
+ + " notified as soon as possible about the value change in this component.");
+ set.getField("style")
+ .setDescription(
+ "Themes specify the overall looks of the user interface. In addition component can have a set of "
+ + "styles, that can be visually very different (like datefield calendar- and text-styles), "
+ + "but contain the same logical functionality. As a rule of thumb, theme specifies if a "
+ + "component is blue or yellow and style determines how the component is used.");
// Add created fields to property panel
addProperties("Component Basics", set);
/** Add properties for selecting */
private void addSelectProperties() {
- final Form set = createBeanPropertySet(new String[] { "newItemsAllowed", "lazyLoading", "multiSelect" });
+ final Form set = createBeanPropertySet(new String[] {
+ "newItemsAllowed", "lazyLoading", "multiSelect" });
addProperties("Select Properties", set);
- set.getField("multiSelect").setDescription("Specified if multiple items can be selected at once.");
- set.getField("newItemsAllowed").setDescription("Select component (but not Tree or Table) can allow the user to directly " + "add new items to set of options. The new items are constrained to be " + "strings and thus feature only applies to simple lists.");
+ set.getField("multiSelect").setDescription(
+ "Specified if multiple items can be selected at once.");
+ set.getField("newItemsAllowed")
+ .setDescription(
+ "Select component (but not Tree or Table) can allow the user to directly "
+ + "add new items to set of options. The new items are constrained to be "
+ + "strings and thus feature only applies to simple lists.");
/*
* Button ll = (Button) set.getField("lazyLoading"); ll
* .setDescription("In Ajax rendering mode select supports lazy loading
* set.getField("multiSelect").setVisible(false);
* set.getField("newItemsAllowed").setVisible(false); }
*/
- if (objectToConfigure instanceof Tree || objectToConfigure instanceof Table) {
+ if (objectToConfigure instanceof Tree
+ || objectToConfigure instanceof Table) {
set.removeItemProperty("newItemsAllowed");
set.removeItemProperty("lazyLoading");
}
final Form set = createBeanPropertySet(new String[] { "required" });
set.addField("focus", new Button("Focus", objectToConfigure, "focus"));
- set.getField("focus").setDescription("Focus the cursor to this field. Not all " + "components and/or terminals support this feature.");
+ set.getField("focus").setDescription(
+ "Focus the cursor to this field. Not all "
+ + "components and/or terminals support this feature.");
addProperties("Field Features", set);
addComponent.addListener(this);
set.addField("component adder", addComponent);
- set.addField("remove all components", new Button("Remove all components", objectToConfigure, "removeAllComponents"));
+ set.addField("remove all components", new Button(
+ "Remove all components", objectToConfigure,
+ "removeAllComponents"));
addProperties("ComponentContainer Features", set);
}
// FIXME: navigation statistics
try {
- FeatureUtil.debug(getApplication().getUser().toString(), "valueChange " + ((AbstractComponent) event.getProperty()).getTag() + ", " + event.getProperty());
+ FeatureUtil.debug(
+ getApplication().getUser().toString(),
+ "valueChange "
+ + ((AbstractComponent) event.getProperty())
+ .getTag() + ", " + event.getProperty());
} catch (final Exception e) {
// ignored, should never happen
}
if (value != null) {
// TextField component
if (value.equals("Text field")) {
- ((AbstractComponentContainer) objectToConfigure).addComponent(new TextField("Test field"));
+ ((AbstractComponentContainer) objectToConfigure)
+ .addComponent(new TextField("Test field"));
}
// DateField time style
d.setDescription("This is a DateField-component with text-style");
d.setResolution(DateField.RESOLUTION_MIN);
d.setStyleName("text");
- ((AbstractComponentContainer) objectToConfigure).addComponent(d);
+ ((AbstractComponentContainer) objectToConfigure)
+ .addComponent(d);
}
// Date field calendar style
c.setDescription("DateField-component with calendar-style and day-resolution");
c.setStyleName("calendar");
c.setResolution(DateField.RESOLUTION_DAY);
- ((AbstractComponentContainer) objectToConfigure).addComponent(c);
+ ((AbstractComponentContainer) objectToConfigure)
+ .addComponent(c);
}
// Select option group style
s.addItem("Solaris");
s.addItem("Symbian");
- ((AbstractComponentContainer) objectToConfigure).addComponent(s);
+ ((AbstractComponentContainer) objectToConfigure)
+ .addComponent(s);
}
addComponent.setValue(null);
}
} else if (event.getProperty() == getField("lazyLoading")) {
- final boolean newValue = ((Boolean) event.getProperty().getValue()).booleanValue();
+ final boolean newValue = ((Boolean) event.getProperty().getValue())
+ .booleanValue();
final Field multiselect = getField("multiSelect");
final Field newitems = getField("newItemsAllowed");
if (newValue) {
public void buttonClick(Button.ClickEvent event) {
// FIXME: navigation statistics
try {
- FeatureUtil.debug(getApplication().getUser().toString(), "buttonClick " + event.getButton().getTag() + ", " + event.getButton().getCaption() + ", " + event.getButton().getValue());
+ FeatureUtil.debug(getApplication().getUser().toString(),
+ "buttonClick " + event.getButton().getTag() + ", "
+ + event.getButton().getCaption() + ", "
+ + event.getButton().getValue());
} catch (final Exception e) {
// ignored, should never happen
}
{
GridLayout gl = new GridLayout(1, 1);
gl.setSizeUndefined();
- gl.addComponent(new Label("A label which defines the size of the GL"));
+ gl.addComponent(new Label(
+ "A label which defines the size of the GL"));
Panel p = new Panel("Panel 1");
((Layout) p.getContent()).setMargin(false);
{
GridLayout gl = new GridLayout(1, 1);
gl.setSizeUndefined();
- gl.addComponent(new Label("A label which defines the size of the GL"));
+ gl.addComponent(new Label(
+ "A label which defines the size of the GL"));
Panel p = new Panel("Panel 2", gl);
((Layout) p.getContent()).setMargin(false);
ol.setWidth("");\r
ol.setCaption("Fixed height (50px) and dynamic width");\r
\r
- TextField tf = new TextField("100px high TextField, valign: bottom, should be partly outside");\r
+ TextField tf = new TextField(\r
+ "100px high TextField, valign: bottom, should be partly outside");\r
tf.setHeight("100px");\r
tf.setWidth("");\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);\r
\r
- tf = new TextField("100% high, 50px wide TextField, valign: bottom, should fill full height");\r
+ tf = new TextField(\r
+ "100% high, 50px wide TextField, valign: bottom, should fill full height");\r
tf.setHeight("100%");\r
tf.setWidth("50px");\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);\r
\r
- Label l = new Label("100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");\r
+ Label l = new Label(\r
+ "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");\r
tf.setHeight("100%");\r
tf.setWidth("50px");\r
ol.addComponent(l);\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);\r
\r
- Label l = new Label("100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");\r
+ Label l = new Label(\r
+ "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");\r
tf.setHeight("100%");\r
tf.setWidth("50px");\r
ol.addComponent(l);\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);\r
\r
- Label l = new Label("100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");\r
+ Label l = new Label(\r
+ "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");\r
tf.setHeight("100%");\r
tf.setWidth("50px");\r
ol.addComponent(l);\r
int w = i * 100;\r
tf = new TextField("Field " + i);\r
tf.setRows(2);\r
- tf.setValue(w + "px high, " + w + "px wide TextField, valign: " + valignName[i % 3]);\r
+ tf.setValue(w + "px high, " + w + "px wide TextField, valign: "\r
+ + valignName[i % 3]);\r
tf.setWidth(w + "px");\r
tf.setHeight(w + "px");\r
ol.addComponent(tf);\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px) / layout_field_100pct_button_field");\r
+ ol.setCaption("Fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight()\r
+ + "px) / layout_field_100pct_button_field");\r
TextField tf;\r
\r
tf = new TextField("300px x 300px Field");\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px) / layout_basic_test");\r
+ ol.setCaption("Fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight()\r
+ + "px) / layout_basic_test");\r
TextField tf;\r
\r
tf = new TextField("300px x 300px Field");\r
ol.setSpacing(false);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px) / layout_symmetric_fields");\r
+ ol.setCaption("Fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight()\r
+ + "px) / layout_symmetric_fields");\r
TextField tf;\r
\r
tf = new TextField("300px x 300px Field");\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px) / layout_leftAndRight");\r
+ ol.setCaption("Fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight()\r
+ + "px) / layout_leftAndRight");\r
TextField tf;\r
\r
// tf = new TextField("100%x100% Field");\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Filled with fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px)");\r
+ ol.setCaption("Filled with fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight() + "px)");\r
TextField tf;\r
\r
tf = new TextField("60%x100% Field");\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("OverFilled with fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px)");\r
+ ol.setCaption("OverFilled with fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight() + "px)");\r
TextField tf;\r
\r
for (int i = 0; i < 5; i++) {\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("OverFilled with fixed width (" + ol.getWidth() + "px) and dynamic height");\r
+ ol.setCaption("OverFilled with fixed width (" + ol.getWidth()\r
+ + "px) and dynamic height");\r
TextField tf;\r
\r
for (int i = 0; i < 10; i++) {\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px) / layout_add_remove_components");\r
+ ol.setCaption("Fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight()\r
+ + "px) / layout_add_remove_components");\r
\r
for (int i = 0; i < 2; i++) {\r
AbstractOrderedLayout inner = createAddRemove(ol, "", "");\r
tf = new TextField("Short caption");\r
ol.addComponent(tf);\r
\r
- tf = new TextField("A very long caption which is probably much longer than the field");\r
+ tf = new TextField(\r
+ "A very long caption which is probably much longer than the field");\r
ol.addComponent(tf);\r
\r
- tf = new TextField("A very long caption which is probably much longer than the field and includes indicators");\r
+ tf = new TextField(\r
+ "A very long caption which is probably much longer than the field and includes indicators");\r
tf.setRequired(true);\r
tf.setComponentError(new UserError("abc123"));\r
ol.addComponent(tf);\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
\r
- tf = new TextField("A long caption which is probably much longer than the field");\r
+ tf = new TextField(\r
+ "A long caption which is probably much longer than the field");\r
tf.setValue("Undefined width");\r
tf.setRequired(true);\r
tf.setComponentError(new UserError("123"));\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
\r
- tf = new TextField("A very long caption which is probably much longer than the field and includes indicators");\r
+ tf = new TextField(\r
+ "A very long caption which is probably much longer than the field and includes indicators");\r
tf.setValue("Undefined width");\r
tf.setIcon(new ThemeResource("icons/16/document-add.png"));\r
tf.setRequired(true);\r
\r
}\r
\r
- private Layout layout_captions_fixed_size_and_relative_size(AbstractOrderedLayout ol) {\r
+ private Layout layout_captions_fixed_size_and_relative_size(\r
+ AbstractOrderedLayout ol) {\r
ol.setWidth("700px");\r
ol.setHeight("250px");\r
\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
ol.setExpandRatio(tf, 1);\r
\r
- tf = new TextField("A long caption which is probably much longer than the field");\r
+ tf = new TextField(\r
+ "A long caption which is probably much longer than the field");\r
tf.setValue("100% wide field, ratio 2");\r
tf.setSizeFull();\r
tf.setRequired(true);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
ol.setExpandRatio(tf, 2);\r
\r
- tf = new TextField("A very long caption which is probably much longer than the field and includes indicators");\r
+ tf = new TextField(\r
+ "A very long caption which is probably much longer than the field and includes indicators");\r
tf.setValue("100% wide field, ratio 3");\r
tf.setSizeFull();\r
tf.setIcon(new ThemeResource("icons/16/document-add.png"));\r
\r
}\r
\r
- private Layout layout_captions_fixed_size_and_fixed_size(AbstractOrderedLayout ol) {\r
+ private Layout layout_captions_fixed_size_and_fixed_size(\r
+ AbstractOrderedLayout ol) {\r
ol.setWidth("700px");\r
ol.setHeight("250px");\r
\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
\r
- tf = new TextField("A long caption which is probably much longer than the field");\r
+ tf = new TextField(\r
+ "A long caption which is probably much longer than the field");\r
tf.setWidth("250px");\r
tf.setValue("250px wide field");\r
tf.setRequired(true);\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
\r
- tf = new TextField("A very long caption which is probably much longer than the field and includes indicators");\r
+ tf = new TextField(\r
+ "A very long caption which is probably much longer than the field and includes indicators");\r
tf.setValue("200px wide field");\r
tf.setWidth("200px");\r
tf.setIcon(new ThemeResource("icons/16/document-add.png"));\r
ol.setCaption("Caption test with fixed width");\r
\r
Label l;\r
- l = new Label("This is a long text and should remain on one line as there is nothing forcing line breaks");\r
+ l = new Label(\r
+ "This is a long text and should remain on one line as there is nothing forcing line breaks");\r
ol.addComponent(l);\r
// ol.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT,\r
// AlignmentHandler.ALIGNMENT_BOTTOM);\r
\r
}\r
\r
- private AbstractOrderedLayout createAddRemove(AbstractOrderedLayout ol, String width, String buttonSuffix) {\r
+ private AbstractOrderedLayout createAddRemove(AbstractOrderedLayout ol,\r
+ String width, String buttonSuffix) {\r
Button b = createAddButton(ol);\r
Button wb = createWideAddButton(ol);\r
Button r = createRemoveButton(ol, buttonSuffix);\r
Button b = new Button("Add before", new ClickListener() {\r
\r
public void buttonClick(ClickEvent event) {\r
- addBefore((AbstractOrderedLayout) event.getButton().getData(), event.getButton().getParent(), "");\r
+ addBefore((AbstractOrderedLayout) event.getButton().getData(),\r
+ event.getButton().getParent(), "");\r
}\r
\r
});\r
Button b = new Button("Add 100% before", new ClickListener() {\r
\r
public void buttonClick(ClickEvent event) {\r
- addBefore((AbstractOrderedLayout) event.getButton().getData(), event.getButton().getParent(), "100%");\r
+ addBefore((AbstractOrderedLayout) event.getButton().getData(),\r
+ event.getButton().getParent(), "100%");\r
}\r
\r
});\r
Button b = new Button("Remove this " + suffix, new ClickListener() {\r
\r
public void buttonClick(ClickEvent event) {\r
- remove((AbstractOrderedLayout) event.getButton().getData(), event.getButton().getParent());\r
+ remove((AbstractOrderedLayout) event.getButton().getData(),\r
+ event.getButton().getParent());\r
}\r
\r
});\r
}\r
index++;\r
}\r
- AbstractOrderedLayout inner = createAddRemove(ol, width, String.valueOf(suffix++));\r
+ AbstractOrderedLayout inner = createAddRemove(ol, width,\r
+ String.valueOf(suffix++));\r
ol.addComponent(inner, index);\r
if (width.contains("%")) {\r
ol.setExpandRatio(inner, 1.0f);\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("100 % filled with fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px)");\r
+ ol.setCaption("100 % filled with fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight() + "px)");\r
TextField tf;\r
\r
tf = new TextField();\r
ol.setSpacing(false);\r
\r
// ol.setWidth("");\r
- ol.setCaption("100 % filled with fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px)");\r
+ ol.setCaption("100 % filled with fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight() + "px)");\r
TextField tf;\r
\r
tf = new TextField();\r
ol.setSpacing(true);\r
\r
// ol.setWidth("");\r
- ol.setCaption("Underfilled with fixed width (" + ol.getWidth() + "px) and fixed height (" + ol.getHeight() + "px)");\r
+ ol.setCaption("Underfilled with fixed width (" + ol.getWidth()\r
+ + "px) and fixed height (" + ol.getHeight() + "px)");\r
TextField tf;\r
\r
tf = new TextField("60%x100% Field");\r
@Override
public void init() {
- final Window mainWin = new Window("Test app to break layout fuction in IE7");
+ final Window mainWin = new Window(
+ "Test app to break layout fuction in IE7");
setMainWindow(mainWin);
SplitPanel sp = new SplitPanel();
el.addComponent(new Label("Top"));
- Table testTable = TestForTablesInitialColumnWidthLogicRendering.getTestTable(5, 50);
+ Table testTable = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(5, 50);
testTable.setSizeFull();
TabSheet ts = new TabSheet();
ts.setSizeFull();
- Label red = new Label("<div style='background:red;width:100%;height:100%;'>??</div>", Label.CONTENT_XHTML);
+ Label red = new Label(
+ "<div style='background:red;width:100%;height:100%;'>??</div>",
+ Label.CONTENT_XHTML);
// red.setCaption("cap");
// red.setSizeFull();
ts.addComponent(red);
ts.getTab(red).setCaption("REd tab");
- Label l = new Label("<div style='background:blue;'>sdf</div>", Label.CONTENT_XHTML);
+ Label l = new Label("<div style='background:blue;'>sdf</div>",
+ Label.CONTENT_XHTML);
el.addComponent(l);
el.setComponentAlignment(l, Alignment.MIDDLE_RIGHT);
}
- w.addComponent(new Button("print select values", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- printState();
- }
- }));
+ w.addComponent(new Button("print select values",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ printState();
+ }
+ }));
}
private Select createSelect() {
}
void printState() {
- System.out.println(" Select without null item " + selectWithoutNullItem.getValue());
- System.out.println(" Select with null item " + selectWithNullItem.getValue());
+ System.out.println(" Select without null item "
+ + selectWithoutNullItem.getValue());
+ System.out.println(" Select with null item "
+ + selectWithNullItem.getValue());
}
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
main.addComponent(new TreeExample());\r
ApplicationResource loginPage = new ApplicationResource() {
- private byte[] loginHTML = ("" + "<html>" + "<head><script type='text/javascript'>" + "var setTarget = function() {document.getElementById('loginf').action = top.location;};" + "</script></head>" + "<body onload='setTarget();'>" + "Iframe generated by LoginBox. PW managers can autofill form. Form handled by LoginBox " + "that will fire LoginEvents. Will post into another iframe, from where the script " + "will find Vaadin client that will be force synced. <form id='loginf' target='logintarget'>" + "Username : <input type='text' name='username'>" + "Password : <input type='password' name='password'>" + "<input type='submit' value='login'>" + "</form>" + "<iframe name='logintarget'></iframe>" + "</body>" + "</html>").getBytes();
+ private byte[] loginHTML = (""
+ + "<html>"
+ + "<head><script type='text/javascript'>"
+ + "var setTarget = function() {document.getElementById('loginf').action = top.location;};"
+ + "</script></head>"
+ + "<body onload='setTarget();'>"
+ + "Iframe generated by LoginBox. PW managers can autofill form. Form handled by LoginBox "
+ + "that will fire LoginEvents. Will post into another iframe, from where the script "
+ + "will find Vaadin client that will be force synced. <form id='loginf' target='logintarget'>"
+ + "Username : <input type='text' name='username'>"
+ + "Password : <input type='password' name='password'>"
+ + "<input type='submit' value='login'>" + "</form>"
+ + "<iframe name='logintarget'></iframe>" + "</body>"
+ + "</html>").getBytes();
public Application getApplication() {
return LoginBox.this.getApplication();
}
public DownloadStream getStream() {
- return new DownloadStream(new ByteArrayInputStream(loginHTML), getMIMEType(), getFilename());
+ return new DownloadStream(new ByteArrayInputStream(loginHTML),
+ getMIMEType(), getFilename());
}
public String getMIMEType() {
HashMap<String, String> params = new HashMap<String, String>();
// expecting single params
- for (Iterator<String> it = parameters.keySet().iterator(); it.hasNext();) {
+ for (Iterator<String> it = parameters.keySet().iterator(); it
+ .hasNext();) {
String key = it.next();
String value = (parameters.get(key))[0];
params.put(key, value);
}
LoginEvent event = new LoginEvent(params);
- for (Iterator<LoginListener> iterator = listeners.iterator(); iterator.hasNext();) {
+ for (Iterator<LoginListener> iterator = listeners
+ .iterator(); iterator.hasNext();) {
LoginListener listener = iterator.next();
listener.onLogin(event);
}
if (window != null) {
window.removeURIHandler(this);
}
- return new DownloadStream(new ByteArrayInputStream("<html><body>Login form handeled.<script type='text/javascript'>top.vaadin.forceSync();</script></body></html>".getBytes()), "text/html", "loginSuccesfull.html");
+ return new DownloadStream(
+ new ByteArrayInputStream(
+ "<html><body>Login form handeled.<script type='text/javascript'>top.vaadin.forceSync();</script></body></html>"
+ .getBytes()), "text/html",
+ "loginSuccesfull.html");
}
};
@Override
public void init() {
- final Window mainWin = new Window("Test app with password manager savvy login functionality");
+ final Window mainWin = new Window(
+ "Test app with password manager savvy login functionality");
el = new VerticalLayout();
if (pw.equals("1234")) {
setUser(username);
currentUser.setValue(username);
- currentUser.getWindow().showNotification("Logged in user: " + username);
- getMainWindow().getContent().replaceComponent(loginBox, mainPanel);
+ currentUser.getWindow().showNotification(
+ "Logged in user: " + username);
+ getMainWindow().getContent().replaceComponent(loginBox,
+ mainPanel);
el.setExpandRatio(mainPanel, 1);
} else {
- getMainWindow().showNotification("Wrong password. Hint, try '1234' ", Notification.TYPE_WARNING_MESSAGE);
+ getMainWindow().showNotification(
+ "Wrong password. Hint, try '1234' ",
+ Notification.TYPE_WARNING_MESSAGE);
}
}
});
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
main.addComponent(f);\r
\r
}\r
\r
- final static private Action[] actions = new Action[] { new ShortcutAction("Enter", ShortcutAction.KeyCode.ENTER, new int[] {}), new ShortcutAction("CTRL-S", ShortcutAction.KeyCode.S, new int[] { ShortcutAction.ModifierKey.CTRL }), };\r
+ final static private Action[] actions = new Action[] {\r
+ new ShortcutAction("Enter", ShortcutAction.KeyCode.ENTER,\r
+ new int[] {}),\r
+ new ShortcutAction("CTRL-S", ShortcutAction.KeyCode.S,\r
+ new int[] { ShortcutAction.ModifierKey.CTRL }), };\r
\r
public Action[] getActions(Object target, Object sender) {\r
return actions;\r
}\r
\r
public void handleAction(Action action, Object sender, Object target) {\r
- status.setValue("Pressed " + action.getCaption() + " to fire shortcut. Texfield value: " + f.getValue());\r
+ status.setValue("Pressed " + action.getCaption()\r
+ + " to fire shortcut. Texfield value: " + f.getValue());\r
f.focus();\r
}\r
\r
Panel panel = new Panel("PopupTest");
// First test component
- final ObjectProperty<String> prop = new ObjectProperty<String>("fooTextField");
+ final ObjectProperty<String> prop = new ObjectProperty<String>(
+ "fooTextField");
PopupView.Content content = new PopupView.Content() {
public String getMinimizedValueAsHTML() {
panel.addComponent(pe2);
// Third test component
- final ObjectProperty<StringBuffer> prop2 = new ObjectProperty<StringBuffer>(new StringBuffer("Text for button"));
+ final ObjectProperty<StringBuffer> prop2 = new ObjectProperty<StringBuffer>(
+ new StringBuffer("Text for button"));
class myButton extends Button {
public myButton() {
// Fourth test component
final Panel panel3 = new Panel("Editor popup for a property");
TextField tf2 = new TextField("TextField for editing a property");
- final ObjectProperty<String> op = new ObjectProperty<String>("This is property text.");
+ final ObjectProperty<String> op = new ObjectProperty<String>(
+ "This is property text.");
tf2.setPropertyDataSource(op);
panel3.addComponent(tf2);
PopupView.Content content3 = new PopupView.Content() {
TextField tf = new TextField("Editor for line " + lineNum,
- "Try to edit the contents for this textfield on line " + lineNum + " and see how the overview-version changes.");
+ "Try to edit the contents for this textfield on line "
+ + lineNum
+ + " and see how the overview-version changes.");
public String getMinimizedValueAsHTML() {
return "" + tf.toString().length() + " characters of info";
}
});
- table.addItem(new Object[] { "1 " + i, "2 " + i, "3 " + i, "4 " + i, "5 " + i, pp, pp2 }, new Integer(i));
+ table.addItem(new Object[] { "1 " + i, "2 " + i, "3 " + i,
+ "4 " + i, "5 " + i, pp, pp2 }, new Integer(i));
}
main.addComponent(table);
} else {
root.setHeight(lastHeight, lastHeightUnit);
}
- event.getButton().setCaption(visible ? "Expand" : "Collapse");
+ event.getButton().setCaption(
+ visible ? "Expand" : "Collapse");
}
}
});
for (int i = 0; i < 10; i++) {
String name = "Name " + i;
- table.addItem(new Object[] { new CheckBox(), name, "02-22-2007 13:37" }, new Integer(i));
+ table.addItem(new Object[] { new CheckBox(), name,
+ "02-22-2007 13:37" }, new Integer(i));
}
panel.setPanelComponent(table);
@Override
public void init() {
- final Window mainWin = new Window("Test app to break layout fuction in IE7");
+ final Window mainWin = new Window(
+ "Test app to break layout fuction in IE7");
setMainWindow(mainWin);
VerticalLayout ol = new VerticalLayout();
ol.setHeight("250px");
ol.setWidth("500px");
- Label red = new Label("<div style='background:red;width:100%;height:100%;'>??</div>", Label.CONTENT_XHTML);
+ Label red = new Label(
+ "<div style='background:red;width:100%;height:100%;'>??</div>",
+ Label.CONTENT_XHTML);
red.setSizeFull();
ol.addComponent(red);
final Window modal = new Window("Modal window");
modal.setModal(true);
- Button b = new Button("click to show notification", new Button.ClickListener() {
+ Button b = new Button("click to show notification",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- modal.showNotification("Try clicking the button in main window!", Window.Notification.TYPE_ERROR_MESSAGE);
+ public void buttonClick(ClickEvent event) {
+ modal.showNotification(
+ "Try clicking the button in main window!",
+ Window.Notification.TYPE_ERROR_MESSAGE);
- }
- });
+ }
+ });
modal.addComponent(b);
- b = new Button("click to warning notification", new Button.ClickListener() {
+ b = new Button("click to warning notification",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- modal.showNotification("Try clicking the button in main window!", Window.Notification.TYPE_WARNING_MESSAGE);
- }
- });
+ public void buttonClick(ClickEvent event) {
+ modal.showNotification(
+ "Try clicking the button in main window!",
+ Window.Notification.TYPE_WARNING_MESSAGE);
+ }
+ });
modal.addComponent(b);
- b = new Button("click to Humanized notification", new Button.ClickListener() {
+ b = new Button("click to Humanized notification",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- modal.showNotification("Try clicking the button in main window!", Window.Notification.TYPE_HUMANIZED_MESSAGE);
- }
- });
+ public void buttonClick(ClickEvent event) {
+ modal.showNotification(
+ "Try clicking the button in main window!",
+ Window.Notification.TYPE_HUMANIZED_MESSAGE);
+ }
+ });
modal.addComponent(b);
b = new Button("click to test modality!", new Button.ClickListener() {
public class Ticket1506_Panel extends Panel {\r
\r
public Ticket1506_Panel() {\r
- ObjectProperty<String> property1 = new ObjectProperty<String>(null, String.class);\r
- addComponent(initSelect(new Ticket1506_TestContainer(), "Test select", property1));\r
+ ObjectProperty<String> property1 = new ObjectProperty<String>(null,\r
+ String.class);\r
+ addComponent(initSelect(new Ticket1506_TestContainer(), "Test select",\r
+ property1));\r
addComponent(initButton(property1));\r
- addComponent(initSelect(new Ticket1506_TestContainer2(), "Test select 2", new ObjectProperty<String>(null, String.class)));\r
+ addComponent(initSelect(new Ticket1506_TestContainer2(),\r
+ "Test select 2", new ObjectProperty<String>(null, String.class)));\r
}\r
\r
private Component initButton(final ObjectProperty<?> property) {\r
return button;\r
}\r
\r
- private Component initSelect(Container containerDataSource, String caption, ObjectProperty<?> property) {\r
+ private Component initSelect(Container containerDataSource, String caption,\r
+ ObjectProperty<?> property) {\r
Select select = new Select(caption);\r
select.setFilteringMode(Select.FILTERINGMODE_CONTAINS);\r
select.setImmediate(true);\r
\r
private void loadItems() {\r
final PropertysetItem item1 = new PropertysetItem();\r
- item1.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>("value 1", String.class));\r
- item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>("name 1", String.class));\r
+ item1.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(\r
+ "value 1", String.class));\r
+ item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(\r
+ "name 1", String.class));\r
items.put(ITEM_1_ID, item1);\r
\r
final PropertysetItem item2 = new PropertysetItem();\r
- item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>("value 2", String.class));\r
- item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>("name 2", String.class));\r
+ item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(\r
+ "value 2", String.class));\r
+ item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(\r
+ "name 2", String.class));\r
items.put(ITEM_2_ID, item2);\r
}\r
\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
- public boolean removeItem(Object itemId) throws UnsupportedOperationException {\r
+ public boolean removeItem(Object itemId)\r
+ throws UnsupportedOperationException {\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
- public boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException {\r
+ public boolean addContainerProperty(Object propertyId, Class<?> type,\r
+ Object defaultValue) throws UnsupportedOperationException {\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
- public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException {\r
+ public boolean removeContainerProperty(Object propertyId)\r
+ throws UnsupportedOperationException {\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
private void loadItems() {\r
for (int i = 1; i < 15; i++) {\r
final PropertysetItem item = new PropertysetItem();\r
- item.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>("value " + i, String.class));\r
- item.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>("name " + i, String.class));\r
+ item.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(\r
+ "value " + i, String.class));\r
+ item.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(\r
+ "name " + i, String.class));\r
items.put(String.valueOf(i), item);\r
}\r
}\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
- public boolean removeItem(Object itemId) throws UnsupportedOperationException {\r
+ public boolean removeItem(Object itemId)\r
+ throws UnsupportedOperationException {\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
- public boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException {\r
+ public boolean addContainerProperty(Object propertyId, Class<?> type,\r
+ Object defaultValue) throws UnsupportedOperationException {\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
- public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException {\r
+ public boolean removeContainerProperty(Object propertyId)\r
+ throws UnsupportedOperationException {\r
throw new UnsupportedOperationException("Not implemented");\r
}\r
\r
@Override\r
public void init() {\r
\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
Panel p = new Panel("Test wrapper for gridlayout margin/spacing");\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
main.addComponent(new Label("Test the second issue in ticket #1581"));\r
\r
w.addURIHandler(res);\r
\r
- w.addComponent(new Link("Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)", new ExternalResource("myresource")));\r
+ w.addComponent(new Link(\r
+ "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)",\r
+ new ExternalResource("myresource")));\r
\r
- w.addComponent(new Link("Test (with Content-Disposition, should popup download dialog that suggests filename downloadedPNG.png)", new ExternalResource("myresource_download")));\r
+ w.addComponent(new Link(\r
+ "Test (with Content-Disposition, should popup download dialog that suggests filename downloadedPNG.png)",\r
+ new ExternalResource("myresource_download")));\r
}\r
}\r
\r
}\r
\r
// Create an image and draw some background on it.\r
- BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);\r
+ BufferedImage image = new BufferedImage(200, 200,\r
+ BufferedImage.TYPE_INT_RGB);\r
Graphics drawable = image.getGraphics();\r
drawable.setColor(Color.lightGray);\r
drawable.fillRect(0, 0, 200, 200);\r
ImageIO.write(image, "png", imagebuffer);\r
\r
// Return a stream from the buffer.\r
- ByteArrayInputStream istream = new ByteArrayInputStream(imagebuffer.toByteArray());\r
- DownloadStream downloadStream = new DownloadStream(istream, "image/png", "generatedFile.png");\r
+ ByteArrayInputStream istream = new ByteArrayInputStream(\r
+ imagebuffer.toByteArray());\r
+ DownloadStream downloadStream = new DownloadStream(istream,\r
+ "image/png", "generatedFile.png");\r
\r
if (relativeUri.startsWith("myresource_download")) {\r
- downloadStream.setParameter("Content-Disposition", "attachment; filename=\"downloadedPNG.png\"");\r
+ downloadStream.setParameter("Content-Disposition",\r
+ "attachment; filename=\"downloadedPNG.png\"");\r
}\r
return downloadStream;\r
} catch (IOException e) {\r
MenuItem firstSubItem1 = first.getChildren().get(1);
for (int i = 0; i < 3; i++) {
- firstSubItem1.addItem(new String("Subsubmenu item" + i), null, new Command() {
-
- public void menuSelected(MenuItem selected) {
- main.showNotification("Action " + selected.getText());
- }
- });
+ firstSubItem1.addItem(new String("Subsubmenu item" + i), null,
+ new Command() {
+
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action "
+ + selected.getText());
+ }
+ });
}
MenuItem firstSubItem2 = first.getChildren().get(3);
for (int i = 0; i < 3; i++) {
- firstSubItem2.addItem(new String("Subsubmenu item" + i), null, new Command() {
-
- public void menuSelected(MenuItem selected) {
- main.showNotification("Action " + selected.getText());
- }
- });
+ firstSubItem2.addItem(new String("Subsubmenu item" + i), null,
+ new Command() {
+
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action "
+ + selected.getText());
+ }
+ });
}
MenuItem second = menuBar.getItems().get(1);
for (int i = 0; i < 5; i++) {
- second.addItem(new String("Second submenu item" + i), null, new Command() {
-
- public void menuSelected(MenuItem selected) {
- main.showNotification("Action " + selected.getText());
- }
- });
+ second.addItem(new String("Second submenu item" + i), null,
+ new Command() {
+
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action "
+ + selected.getText());
+ }
+ });
}
MenuItem third = menuBar.getItems().get(2);
public void init() {
final Window mainWin = new Window();
setMainWindow(mainWin);
- mainWin.addComponent(new Button("Change URI using Application.getURL()", new Button.ClickListener() {
+ mainWin.addComponent(new Button(
+ "Change URI using Application.getURL()",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- mainWin.open(new ExternalResource(getURL() + "#" + System.currentTimeMillis()));
- }
- }));
- mainWin.addComponent(new Button("Change URI uring Window.getURL()", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ mainWin.open(new ExternalResource(getURL() + "#"
+ + System.currentTimeMillis()));
+ }
+ }));
+ mainWin.addComponent(new Button("Change URI uring Window.getURL()",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- mainWin.open(new ExternalResource(mainWin.getURL() + "#" + System.currentTimeMillis()));
- }
- }));
+ public void buttonClick(ClickEvent event) {
+ mainWin.open(new ExternalResource(mainWin.getURL()
+ + "#" + System.currentTimeMillis()));
+ }
+ }));
}
}
\r
TextField tf = new TextField("First name");\r
tf.setDescription("The first name is used for the administration user interfaces only.");\r
- tf.setComponentError(new SystemError("You must enter only one first name."));\r
+ tf.setComponentError(new SystemError(\r
+ "You must enter only one first name."));\r
\r
main.addComponent(tf);\r
}\r
\r
// OrderedLayout\r
final VerticalLayout orderedLayout = new VerticalLayout();\r
- LayoutTestingPanel oltp = new LayoutTestingPanel("OrderedLayout", orderedLayout);\r
- hidingControls.addComponent(new Button("OrderedLayout", new MethodProperty<Boolean>(oltp, "visible")));\r
+ LayoutTestingPanel oltp = new LayoutTestingPanel("OrderedLayout",\r
+ orderedLayout);\r
+ hidingControls.addComponent(new Button("OrderedLayout",\r
+ new MethodProperty<Boolean>(oltp, "visible")));\r
lo.addComponent(oltp);\r
orderedLayout.setSpacing(false);\r
addFields(orderedLayout);\r
// GridLayout\r
GridLayout grid = new GridLayout(1, 1);\r
Panel g1tp = new LayoutTestingPanel("Gridlayout with 1 column", grid);\r
- hidingControls.addComponent(new Button("GridLayout (1col)", new MethodProperty<Boolean>(g1tp, "visible")));\r
+ hidingControls.addComponent(new Button("GridLayout (1col)",\r
+ new MethodProperty<Boolean>(g1tp, "visible")));\r
g1tp.setVisible(false);\r
lo.addComponent(g1tp);\r
grid.setSpacing(true);\r
addFields(grid);\r
GridLayout grid2 = new GridLayout(2, 1);\r
Panel g2tp = new LayoutTestingPanel("Gridlayout with 2 columns", grid2);\r
- hidingControls.addComponent(new Button("GridLayout (2cols)", new MethodProperty<Boolean>(g2tp, "visible")));\r
+ hidingControls.addComponent(new Button("GridLayout (2cols)",\r
+ new MethodProperty<Boolean>(g2tp, "visible")));\r
g2tp.setVisible(false);\r
lo.addComponent(g2tp);\r
grid2.setSpacing(true);\r
\r
// ExpandLayout\r
VerticalLayout el = new VerticalLayout();\r
- Panel elp = new LayoutTestingPanel("ExpandLayout width first component expanded", el);\r
- hidingControls.addComponent(new Button("ExpandLayout (vertical)", new MethodProperty<Boolean>(elp, "visible")));\r
+ Panel elp = new LayoutTestingPanel(\r
+ "ExpandLayout width first component expanded", el);\r
+ hidingControls.addComponent(new Button("ExpandLayout (vertical)",\r
+ new MethodProperty<Boolean>(elp, "visible")));\r
elp.setVisible(false);\r
el.setHeight("700px");\r
addFields(el);\r
el.setExpandRatio(firstComponent, 1);\r
lo.addComponent(elp);\r
HorizontalLayout elh = new HorizontalLayout();\r
- Panel elhp = new LayoutTestingPanel("ExpandLayout width first component expanded; horizontal", elh);\r
- hidingControls.addComponent(new Button("ExpandLayout (horizontal)", new MethodProperty<Boolean>(elhp, "visible")));\r
+ Panel elhp = new LayoutTestingPanel(\r
+ "ExpandLayout width first component expanded; horizontal", elh);\r
+ hidingControls.addComponent(new Button("ExpandLayout (horizontal)",\r
+ new MethodProperty<Boolean>(elhp, "visible")));\r
elhp.setVisible(false);\r
elhp.setScrollable(true);\r
elh.setWidth("2000px");\r
// CustomLayout\r
VerticalLayout cl = new VerticalLayout();\r
Panel clp = new LayoutTestingPanel("CustomLayout", cl);\r
- hidingControls.addComponent(new Button("CustomLayout", new MethodProperty<Boolean>(clp, "visible")));\r
+ hidingControls.addComponent(new Button("CustomLayout",\r
+ new MethodProperty<Boolean>(clp, "visible")));\r
clp.setVisible(false);\r
lo.addComponent(clp);\r
cl.addComponent(new Label("<<< Add customlayout testcase here >>>"));\r
\r
// Form\r
Panel formPanel = new Panel("Form");\r
- hidingControls.addComponent(new Button("Form", new MethodProperty<Boolean>(formPanel, "visible")));\r
+ hidingControls.addComponent(new Button("Form",\r
+ new MethodProperty<Boolean>(formPanel, "visible")));\r
formPanel.setVisible(false);\r
formPanel.addComponent(getFormPanelExample());\r
lo.addComponent(formPanel);\r
\r
- for (Iterator<Component> i = hidingControls.getComponentIterator(); i.hasNext();) {\r
+ for (Iterator<Component> i = hidingControls.getComponentIterator(); i\r
+ .hasNext();) {\r
((AbstractComponent) i.next()).setImmediate(true);\r
}\r
\r
t7.setIcon(new ThemeResource("../runo/icons/16/ok.png"));\r
lo.addComponent(t7);\r
\r
- DateField d1 = new DateField("Datefield with caption and icon, next one without caption");\r
+ DateField d1 = new DateField(\r
+ "Datefield with caption and icon, next one without caption");\r
d1.setComponentError(new SystemError("Error"));\r
d1.setRequired(true);\r
d1.setIcon(new ThemeResource("../runo/icons/16/ok.png"));\r
controls.setSpacing(true);\r
controls.setMargin(false);\r
controls.addComponent(new Label("width"));\r
- controls.addComponent(new TextField(new MethodProperty<Float>(testedLayout, "width")));\r
- controls.addComponent(new Button("%", new MethodProperty<Boolean>(this, "widthPercents")));\r
+ controls.addComponent(new TextField(new MethodProperty<Float>(\r
+ testedLayout, "width")));\r
+ controls.addComponent(new Button("%", new MethodProperty<Boolean>(\r
+ this, "widthPercents")));\r
controls.addComponent(new Label("height"));\r
- controls.addComponent(new TextField(new MethodProperty<Float>(testedLayout, "height")));\r
- controls.addComponent(new Button("%", new MethodProperty<Boolean>(this, "heightPercents")));\r
+ controls.addComponent(new TextField(new MethodProperty<Float>(\r
+ testedLayout, "height")));\r
+ controls.addComponent(new Button("%", new MethodProperty<Boolean>(\r
+ this, "heightPercents")));\r
controls.addComponent(marginLeft);\r
controls.addComponent(marginRight);\r
controls.addComponent(marginTop);\r
testedLayout.setStyleName("tested-layout");\r
setStyleName("layout-testing-panel");\r
\r
- for (Iterator<Component> i = controls.getComponentIterator(); i.hasNext();) {\r
+ for (Iterator<Component> i = controls.getComponentIterator(); i\r
+ .hasNext();) {\r
((AbstractComponent) i.next()).setImmediate(true);\r
}\r
}\r
vAlign.setNullSelectionAllowed(false);\r
\r
vAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_TOP));\r
- vAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_TOP), "top");\r
- vAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER));\r
- vAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER), "center");\r
+ vAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_TOP), "top");\r
+ vAlign.addItem(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER));\r
+ vAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER),\r
+ "center");\r
vAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_BOTTOM));\r
- vAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_BOTTOM), "bottom");\r
+ vAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_BOTTOM), "bottom");\r
\r
hAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT));\r
- hAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT), "left");\r
- hAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER));\r
- hAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER), "center");\r
+ hAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_LEFT), "left");\r
+ hAlign.addItem(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER));\r
+ hAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER),\r
+ "center");\r
hAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_RIGHT));\r
- hAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right");\r
+ hAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right");\r
\r
Property.ValueChangeListener alignmentChangeListener = new Property.ValueChangeListener() {\r
public void valueChange(ValueChangeEvent event) {\r
- updateAlignments(((Integer) hAlign.getValue()).intValue(), ((Integer) vAlign.getValue()).intValue());\r
+ updateAlignments(((Integer) hAlign.getValue()).intValue(),\r
+ ((Integer) vAlign.getValue()).intValue());\r
}\r
\r
};\r
controls.addComponent(lAlign);\r
lAlign.setNullSelectionAllowed(false);\r
lAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT));\r
- lAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT), "left");\r
- lAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER));\r
- lAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER), "center");\r
+ lAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_LEFT), "left");\r
+ lAlign.addItem(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER));\r
+ lAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER),\r
+ "center");\r
lAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_RIGHT));\r
- lAlign.setItemCaption(new Integer(Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right");\r
+ lAlign.setItemCaption(new Integer(\r
+ Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right");\r
\r
lAlign.addListener(new Property.ValueChangeListener() {\r
public void valueChange(ValueChangeEvent event) {\r
- testPanelLayout.setComponentAlignment(testedLayout, ((Integer) lAlign.getValue()).intValue(), VerticalLayout.ALIGNMENT_TOP);\r
+ testPanelLayout.setComponentAlignment(testedLayout,\r
+ ((Integer) lAlign.getValue()).intValue(),\r
+ VerticalLayout.ALIGNMENT_TOP);\r
}\r
});\r
}\r
\r
@SuppressWarnings("deprecation")\r
private void updateAlignments(int h, int v) {\r
- for (Iterator<Component> i = testedLayout.getComponentIterator(); i.hasNext();) {\r
- ((Layout.AlignmentHandler) testedLayout).setComponentAlignment(i.next(), h, v);\r
+ for (Iterator<Component> i = testedLayout.getComponentIterator(); i\r
+ .hasNext();) {\r
+ ((Layout.AlignmentHandler) testedLayout).setComponentAlignment(\r
+ i.next(), h, v);\r
}\r
}\r
\r
private void updateMarginsAndSpacing() {\r
- testedLayout.setMargin(((Boolean) marginTop.getValue()).booleanValue(), ((Boolean) marginRight.getValue()).booleanValue(), ((Boolean) marginBottom.getValue()).booleanValue(), ((Boolean) marginLeft.getValue()).booleanValue());\r
+ testedLayout.setMargin(\r
+ ((Boolean) marginTop.getValue()).booleanValue(),\r
+ ((Boolean) marginRight.getValue()).booleanValue(),\r
+ ((Boolean) marginBottom.getValue()).booleanValue(),\r
+ ((Boolean) marginLeft.getValue()).booleanValue());\r
if (testedLayout instanceof Layout.SpacingHandler) {\r
- ((Layout.SpacingHandler) testedLayout).setSpacing(((Boolean) spacing.getValue()).booleanValue());\r
+ ((Layout.SpacingHandler) testedLayout)\r
+ .setSpacing(((Boolean) spacing.getValue())\r
+ .booleanValue());\r
}\r
}\r
\r
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));
+ final Window main = new Window(getClass().getName().substring(
+ getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
VerticalLayout el = new VerticalLayout();
Panel p = new Panel("Test panel");
p.setSizeFull();
- p.addComponent(new Label("Second component is embedded with a slow resource " + "and thus should break layout if Embedded cannot" + " request re-layout after load."));
+ p.addComponent(new Label(
+ "Second component is embedded with a slow resource "
+ + "and thus should break layout if Embedded cannot"
+ + " request re-layout after load."));
Embedded em = new Embedded("TestEmbedded", slowRes);
@Override\r
public void init() {\r
\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
ComboBox cb = new ComboBox(" '<' item is not seen in populist?");\r
@Override\r
public void init() {\r
\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
Button b = new Button("Add content");\r
\r
public void buttonClick(ClickEvent event) {\r
\r
- gridLayout.addComponent(new TextField("Content " + (++counter)));\r
+ gridLayout\r
+ .addComponent(new TextField("Content " + (++counter)));\r
\r
}\r
});\r
s = new Select("Testcase from the ticket #1804");\r
s.setNullSelectionAllowed(false);\r
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));\r
- s.addValidator(new EmptyStringValidator("Selection required for test-field"));\r
+ s.addValidator(new EmptyStringValidator(\r
+ "Selection required for test-field"));\r
s.setRequired(true);\r
listOfAllFields.add(s);\r
\r
s.setRequired(true);\r
listOfAllFields.add(s);\r
\r
- s = new Select("Testcase from the ticket #1804, but with required=false");\r
+ s = new Select(\r
+ "Testcase from the ticket #1804, but with required=false");\r
s.setNullSelectionAllowed(false);\r
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));\r
- s.addValidator(new EmptyStringValidator("Selection required for test-field"));\r
+ s.addValidator(new EmptyStringValidator(\r
+ "Selection required for test-field"));\r
listOfAllFields.add(s);\r
\r
- s = new Select("Testcase from the ticket #1804, but without validator and with required=false");\r
+ s = new Select(\r
+ "Testcase from the ticket #1804, but without validator and with required=false");\r
s.setNullSelectionAllowed(false);\r
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));\r
listOfAllFields.add(s);\r
\r
- s = new Select("Required=true, custom error message, null selection not allowed");\r
+ s = new Select(\r
+ "Required=true, custom error message, null selection not allowed");\r
s.setRequired(true);\r
s.setNullSelectionAllowed(false);\r
s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));\r
\r
public void buttonClick(ClickEvent event) {\r
StringBuffer msg = new StringBuffer();\r
- for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) {\r
+ for (Iterator<Select> i = listOfAllFields.iterator(); i\r
+ .hasNext();) {\r
AbstractField af = i.next();\r
msg.append("<h1>" + af.getCaption() + "</h1>\n");\r
msg.append("Value=" + af.getValue() + "<br/>\n");\r
if (af.isValid()) {\r
msg.append("VALID\n<hr/>");\r
} else {\r
- msg.append("INVALID<br/><i>" + af.getErrorMessage() + "</i><hr/>");\r
+ msg.append("INVALID<br/><i>" + af.getErrorMessage()\r
+ + "</i><hr/>");\r
}\r
}\r
Window w = new Window("Status of the fields");\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
((Layout) main.getContent()).setMargin(false);\r
\r
- Label description = new Label("GridLayout with 100% (no height), is wanted to " + "share all available width with columns " + "relatively to their natural width. And it " + "should still work with margins and spacings");\r
+ Label description = new Label(\r
+ "GridLayout with 100% (no height), is wanted to "\r
+ + "share all available width with columns "\r
+ + "relatively to their natural width. And it "\r
+ + "should still work with margins and spacings");\r
main.addComponent(description);\r
\r
final GridLayout grid = new GridLayout(4, 1);\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
final ObjectProperty<String> prop = new ObjectProperty<String>("");\r
- final TextField tf1 = new TextField("Buffered TextField bound to ObjectProperty");\r
+ final TextField tf1 = new TextField(\r
+ "Buffered TextField bound to ObjectProperty");\r
tf1.setWriteThrough(false);\r
tf1.setReadThrough(false);\r
tf1.setPropertyDataSource(prop);\r
main.addComponent(tf1);\r
- main.addComponent(new Button("This button does nothing (but flushes queued variable changes)"));\r
- main.addComponent(new Button("Commit the field to property", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- tf1.commit();\r
- }\r
- }));\r
- main.addComponent(new Button("Show property value", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- main.showNotification("'" + prop.getValue() + "'");\r
- }\r
- }));\r
- main.addComponent(new Button("Show field value", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- main.showNotification("'" + tf1.getValue() + "'");\r
- }\r
- }));\r
+ main.addComponent(new Button(\r
+ "This button does nothing (but flushes queued variable changes)"));\r
+ main.addComponent(new Button("Commit the field to property",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ tf1.commit();\r
+ }\r
+ }));\r
+ main.addComponent(new Button("Show property value",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ main.showNotification("'" + prop.getValue() + "'");\r
+ }\r
+ }));\r
+ main.addComponent(new Button("Show field value",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ main.showNotification("'" + tf1.getValue() + "'");\r
+ }\r
+ }));\r
}\r
}
\ No newline at end of file
final Window main = new Window("#1811");\r
setMainWindow(main);\r
\r
- Validator strLenValidator = new StringLengthValidator("String must be at least 3 chars long and non-null", 3, -1, false);\r
+ Validator strLenValidator = new StringLengthValidator(\r
+ "String must be at least 3 chars long and non-null", 3, -1,\r
+ false);\r
\r
- TextField tf1 = new TextField("Text field with default settings (required=false)");\r
+ TextField tf1 = new TextField(\r
+ "Text field with default settings (required=false)");\r
listOfAllFields.add(tf1);\r
\r
TextField tf2 = new TextField("Text field with required=true");\r
tf2.setRequired(true);\r
listOfAllFields.add(tf2);\r
\r
- TextField tf3 = new TextField("Text field with required=true and strlen >= 3");\r
+ TextField tf3 = new TextField(\r
+ "Text field with required=true and strlen >= 3");\r
tf3.setRequired(true);\r
tf3.addValidator(strLenValidator);\r
listOfAllFields.add(tf3);\r
\r
- TextField tf4 = new TextField("Text field with required=false (default) and strlen >= 3");\r
+ TextField tf4 = new TextField(\r
+ "Text field with required=false (default) and strlen >= 3");\r
tf4.addValidator(strLenValidator);\r
listOfAllFields.add(tf4);\r
\r
\r
public void buttonClick(ClickEvent event) {\r
StringBuffer msg = new StringBuffer();\r
- for (Iterator<TextField> i = listOfAllFields.iterator(); i.hasNext();) {\r
+ for (Iterator<TextField> i = listOfAllFields.iterator(); i\r
+ .hasNext();) {\r
TextField tf = i.next();\r
msg.append("<h1>" + tf.getCaption() + "</h1>\n");\r
if (tf.isValid()) {\r
msg.append("VALID\n<hr/>");\r
} else {\r
- msg.append("INVALID<br/><i>" + tf.getErrorMessage() + "</i><hr/>");\r
+ msg.append("INVALID<br/><i>" + tf.getErrorMessage()\r
+ + "</i><hr/>");\r
}\r
}\r
Window w = new Window("Status of the fields");\r
\r
public void buttonClick(ClickEvent event) {\r
StringBuffer msg = new StringBuffer();\r
- for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) {\r
+ for (Iterator<Select> i = listOfAllFields.iterator(); i\r
+ .hasNext();) {\r
AbstractField af = i.next();\r
msg.append("<h1>" + af.getCaption() + "</h1>\n");\r
msg.append("Value=" + af.getValue() + "<br/>\n");\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
HorizontalLayout currentState = new HorizontalLayout();\r
currentState.addComponent(b);\r
b.addListener(new ClickListener() {\r
public void buttonClick(ClickEvent event) {\r
- state.setValue("ScrollTop: " + p.getScrollTop() + " ScrollLeft: " + p.getScrollLeft());\r
+ state.setValue("ScrollTop: " + p.getScrollTop()\r
+ + " ScrollLeft: " + p.getScrollLeft());\r
}\r
});\r
main.addComponent(currentState);\r
public void buttonClick(ClickEvent event) {\r
p.setScrollLeft(p.getScrollLeft() + 50);\r
p.setScrollTop(p.getScrollTop() + 50);\r
- state.setValue("ScrollTop: " + p.getScrollTop() + " ScrollLeft: " + p.getScrollLeft());\r
+ state.setValue("ScrollTop: " + p.getScrollTop()\r
+ + " ScrollLeft: " + p.getScrollLeft());\r
}\r
});\r
\r
p.setScrollable(true);\r
\r
for (int i = 0; i < ROWS; i++) {\r
- p.addComponent(new Label("Label" + i + "................................................................................................................."));\r
+ p.addComponent(new Label(\r
+ "Label"\r
+ + i\r
+ + "................................................................................................................."));\r
}\r
\r
p.setHeight("300px");\r
final Table t = new Table();
el.addComponent(t);
- el.setExpandRatio(t,1);
+ el.setExpandRatio(t, 1);
t.setSizeFull();
addContentsToTable(t);
t.setStyleName("foo");
if (((Boolean) cellStylesEnabler.getValue()).booleanValue()) {
t.setCellStyleGenerator(new Table.CellStyleGenerator() {
public String getStyle(Object itemId, Object propertyId) {
- Object cell = t.getContainerProperty(itemId, propertyId).getValue();
+ Object cell = t.getContainerProperty(itemId,
+ propertyId).getValue();
if (!(cell instanceof Integer)) {
return null;
}
int age = ((Integer) cell).intValue();
- return age > 65 ? "old" : (age < 18 ? "young" : null);
+ return age > 65 ? "old" : (age < 18 ? "young"
+ : null);
}
});
} else {
t.addContainerProperty("Last name", String.class, "");
t.addContainerProperty("Age", Integer.class, "");
- String firstNames[] = { "Quentin", "Marc", "Peter", "David", "Mary", "Jani", "Jane", "Brita" };
- String lastNames[] = { "Heiskanen", "Bjorn", "Torwalds", "Autere", "Smith", "Lindström" };
+ String firstNames[] = { "Quentin", "Marc", "Peter", "David", "Mary",
+ "Jani", "Jane", "Brita" };
+ String lastNames[] = { "Heiskanen", "Bjorn", "Torwalds", "Autere",
+ "Smith", "Lindström" };
for (int i = 0; i < 1000; i++) {
- t.addItem(new Object[] { firstNames[((int) (Math.random() * firstNames.length))], lastNames[((int) (Math.random() * lastNames.length))], new Integer((int) (Math.random() * 100) + 10) }, new Integer(i));
+ t.addItem(new Object[] {
+ firstNames[((int) (Math.random() * firstNames.length))],
+ lastNames[((int) (Math.random() * lastNames.length))],
+ new Integer((int) (Math.random() * 100) + 10) },
+ new Integer(i));
}
}
\r
setMainWindow(new Window("#1868"));\r
\r
- Panel p = new Panel("This is a really long caption for the panel, too long in fact!");\r
+ Panel p = new Panel(\r
+ "This is a really long caption for the panel, too long in fact!");\r
p.setWidth(300);\r
p.setHeight(300);\r
\r
lo.setSpacing(true);\r
\r
VerticalLayout el = new VerticalLayout();\r
- Panel elp = new Panel("Vertical ExpandLayout /w first component expanded", el);\r
+ Panel elp = new Panel(\r
+ "Vertical ExpandLayout /w first component expanded", el);\r
el.setHeight(1000);\r
for (int i = 0; i < 3; i++) {\r
Button b = new Button("x");\r
el.addComponent(b);\r
if (i == 0) {\r
b.setSizeFull();\r
- el.setExpandRatio(b,1);\r
+ el.setExpandRatio(b, 1);\r
}\r
}\r
lo.addComponent(elp);\r
elp.setScrollable(true);\r
\r
HorizontalLayout elh = new HorizontalLayout();\r
- Panel elph = new Panel("Horizontal ExpandLayout /w first component expanded", elh);\r
+ Panel elph = new Panel(\r
+ "Horizontal ExpandLayout /w first component expanded", elh);\r
elh.setWidth(1000);\r
for (int i = 0; i < 3; i++) {\r
Button b = new Button("x");\r
elh.addComponent(b);\r
if (i == 0) {\r
b.setSizeFull();\r
- elh.setExpandRatio(b,1);\r
+ elh.setExpandRatio(b, 1);\r
}\r
}\r
lo.addComponent(elph);\r
gridLayout = createGL();\r
formLayout = createForms();\r
\r
- switchToGridButton = new Button("Switch to GridLayout", new ClickListener() {\r
+ switchToGridButton = new Button("Switch to GridLayout",\r
+ new ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- changeLayout(switchToGridButton, gridLayout);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ changeLayout(switchToGridButton, gridLayout);\r
+ }\r
\r
- });\r
- switchToOrderedButton = new Button("Switch to OrderedLayout", new ClickListener() {\r
+ });\r
+ switchToOrderedButton = new Button("Switch to OrderedLayout",\r
+ new ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- changeLayout(switchToOrderedButton, orderedLayout);\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ changeLayout(switchToOrderedButton, orderedLayout);\r
+ }\r
\r
- });\r
+ });\r
switchToOrderedButton.setEnabled(false);\r
\r
switchToFormsButton = new Button("Switch to Form", new ClickListener() {\r
GridLayout layout = new GridLayout(1, 5);\r
\r
GridLayout l1 = new GridLayout(1, 3);\r
- createLayout(l1, new HorizontalLayout(), "1000px", "150px", "100%", null, true);\r
- createLayout(l1, new HorizontalLayout(), "1000px", "150px", "50px", null, false);\r
+ createLayout(l1, new HorizontalLayout(), "1000px", "150px", "100%",\r
+ null, true);\r
+ createLayout(l1, new HorizontalLayout(), "1000px", "150px", "50px",\r
+ null, false);\r
GridLayout l2 = new GridLayout(6, 1);\r
createLayout(l2, new VerticalLayout(), "200px", "500px", true);\r
- createLayout(l2, new VerticalLayout(), "200px", "500px", "100%", null, true);\r
+ createLayout(l2, new VerticalLayout(), "200px", "500px", "100%", null,\r
+ true);\r
createLayout(l2, new VerticalLayout(), "150px", "500px", true);\r
- createLayout(l2, new VerticalLayout(), "150px", "500px", "100%", null, true);\r
+ createLayout(l2, new VerticalLayout(), "150px", "500px", "100%", null,\r
+ true);\r
createLayout(l2, new VerticalLayout(), "100px", "500px", true);\r
- createLayout(l2, new VerticalLayout(), "100px", "500px", "100%", null, true);\r
+ createLayout(l2, new VerticalLayout(), "100px", "500px", "100%", null,\r
+ true);\r
layout.addComponent(l1);\r
layout.addComponent(l2);\r
\r
GridLayout layout = new GridLayout(1, 5);\r
\r
GridLayout l1 = new GridLayout(1, 3);\r
- createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "100%", null, true);\r
- createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "50px", null, false);\r
+ createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "100%", null,\r
+ true);\r
+ createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "50px", null,\r
+ false);\r
GridLayout l2 = new GridLayout(6, 1);\r
createLayout(l2, new GridLayout(1, 8), "200px", "500px", true);\r
- createLayout(l2, new GridLayout(1, 8), "200px", "500px", "100%", null, true);\r
+ createLayout(l2, new GridLayout(1, 8), "200px", "500px", "100%", null,\r
+ true);\r
createLayout(l2, new GridLayout(1, 8), "150px", "500px", true);\r
- createLayout(l2, new GridLayout(1, 8), "150px", "500px", "100%", null, true);\r
+ createLayout(l2, new GridLayout(1, 8), "150px", "500px", "100%", null,\r
+ true);\r
createLayout(l2, new GridLayout(1, 8), "100px", "500px", true);\r
- createLayout(l2, new GridLayout(1, 8), "100px", "500px", "100%", null, true);\r
+ createLayout(l2, new GridLayout(1, 8), "100px", "500px", "100%", null,\r
+ true);\r
layout.addComponent(l1);\r
layout.addComponent(l2);\r
\r
mainLayout.replaceComponent(l, newLayout);\r
}\r
\r
- private static void createLayout(GridLayout parentLayout, Layout newLayout, String w, String h, boolean align) {\r
+ private static void createLayout(GridLayout parentLayout, Layout newLayout,\r
+ String w, String h, boolean align) {\r
createLayout(parentLayout, newLayout, w, h, null, null, align);\r
}\r
\r
- private static void createLayout(GridLayout parentLayout, Layout newLayout, String w, String h, String componentWidth, String componentHeight, boolean align) {\r
+ private static void createLayout(GridLayout parentLayout, Layout newLayout,\r
+ String w, String h, String componentWidth, String componentHeight,\r
+ boolean align) {\r
String dirText = "V";\r
String type;\r
if (newLayout instanceof VerticalLayout) {\r
}\r
String alignText = align ? "-A" : "";\r
String cWidth = componentWidth == null ? "" : " - " + componentWidth;\r
- Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x" + h + cWidth, newLayout);\r
+ Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x"\r
+ + h + cWidth, newLayout);\r
\r
p.setWidth(w);\r
p.setHeight(h);\r
newLayout.setSizeFull();\r
\r
String captions[] = new String[] { "TextField with caption", null };\r
- Resource icons[] = new Resource[] { new ThemeResource("icons/16/document-delete.png"), null };\r
+ Resource icons[] = new Resource[] {\r
+ new ThemeResource("icons/16/document-delete.png"), null };\r
boolean required[] = new boolean[] { true, false };\r
TextField fields[][] = new TextField[captions.length][icons.length];\r
for (int caption = 0; caption < captions.length; caption++) {\r
for (int icon = 0; icon < icons.length; icon++) {\r
for (int req = 0; req < required.length; req++) {\r
- TextField tf = createTextFieldWithError(captions[caption], icons[icon], required[req]);\r
+ TextField tf = createTextFieldWithError(captions[caption],\r
+ icons[icon], required[req]);\r
\r
fields[caption][icon] = tf;\r
if (componentWidth != null) {\r
p.addComponent(tf);\r
\r
if (align) {\r
- ((AlignmentHandler) newLayout).setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);\r
+ ((AlignmentHandler) newLayout).setComponentAlignment(\r
+ tf, Alignment.BOTTOM_RIGHT);\r
}\r
}\r
}\r
//\r
// }\r
\r
- private static TextField createTextFieldWithError(String caption, Resource icon, boolean required) {\r
+ private static TextField createTextFieldWithError(String caption,\r
+ Resource icon, boolean required) {\r
TextField tf = new TextField();\r
tf.setCaption(caption);\r
tf.setIcon(icon);\r
main.addComponent(f[i]);
f[i].addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- main.showNotification("Validity test", "Testcase " + j + " is " + (f[j].isValid() ? "valid" : "invalid"));
+ main.showNotification("Validity test", "Testcase " + j
+ + " is " + (f[j].isValid() ? "valid" : "invalid"));
}
});
f[i].addValidator(new ContainsValidator("1"));
f[2].setDescription("Field is non-empty, validators do not give validation error: *");
f[2].setValue("valid 12");
- f[3].setDescription("Field is non-empty, requiredError(null), validators " + "give validation error: * ! (popup shows the validation error)");
+ f[3].setDescription("Field is non-empty, requiredError(null), validators "
+ + "give validation error: * ! (popup shows the validation error)");
f[3].setValue("invalid");
- f[4].setDescription("Field is non-empty, requiredError(\"foo\"), validators " + "give validation error: * ! (popup shows the validation error)");
+ f[4].setDescription("Field is non-empty, requiredError(\"foo\"), validators "
+ + "give validation error: * ! (popup shows the validation error)");
f[4].setValue("invalid");
f[4].setRequiredError("The field must not be empty");
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
main.setTheme("tests-tickets");\r
int rr = Integer.parseInt(v[0]);
int rs = Integer.parseInt(v[1]);
if (rr < round || (rr == round && rs < state)) {
- getMainWindow().showNotification("Already past requested " + s[0]);
+ getMainWindow().showNotification(
+ "Already past requested " + s[0]);
return;
}
while (round < rr || state < rs) {
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
p = new Panel("TestPanel 250x300");\r
p.setScrollable(true);\r
// p.setContent(new GridLayout(1, 100));\r
for (int i = 0; i < ROWS; i++) {\r
- p.addComponent(new Label("Label" + i + " 5067w09adsfasdjfahlsdfjhalfjhaldjfhalsjdfhlajdhflajhdfljahdslfjahldsjfhaljdfhaljfdhlajsdhflajshdflkajhsdlfkjahsldfkjahsldfhalskjfdhlksjfdh857idifhaljsdfhlajsdhflajhdflajhdfljahldfjhaljdfhalsjdfhalkjdhflkajhdfljahsdlfjahlsdjfhaldjfhaljfdhlajdhflajshdfljahsdlfjhalsjdfhalskjhfdlhusfglksuhdflgjshflgjhslfghslfjghsljfglsjhfglsjhfgljshfgljshflgjhslfghsljfgsljdfglsdjhfglsjhflgkjshfldjgh"));\r
+ p.addComponent(new Label(\r
+ "Label"\r
+ + i\r
+ + " 5067w09adsfasdjfahlsdfjhalfjhaldjfhalsjdfhlajdhflajhdfljahdslfjahldsjfhaljdfhaljfdhlajsdhflajshdflkajhsdlfkjahsldfkjahsldfhalskjfdhlksjfdh857idifhaljsdfhlajsdhflajhdflajhdfljahldfjhaljdfhalsjdfhalkjdhflkajhdfljahsdlfjahlsdjfhaldjfhaljfdhlajdhflajshdfljahsdlfjhalsjdfhalskjhfdlhusfglksuhdflgjshflgjhslfghslfjghsljfglsjhfglsjhfgljshfgljshflgjhslfghsljfgsljdfglsdjhfglsjhflgkjshfldjgh"));\r
}\r
// main.getLayout().setSizeFull();\r
\r
// p.getLayout().setSizeFull();\r
p.setWidth("50px");\r
p.setHeight("100px");\r
- p.addComponent(new Label("aasdfaasdfja dslkfj lakfdj lakjdf lkaj dflkaj ldfkj alsdfj laksdj flkajs dflkj sdfsadfasdfasd"));\r
+ p.addComponent(new Label(\r
+ "aasdfaasdfja dslkfj lakfdj lakjdf lkaj dflkaj ldfkj alsdfj laksdj flkajs dflkj sdfsadfasdfasd"));\r
ol.addComponent(p);\r
\r
main.addComponent(ol);\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
l.setStyleName("red");\r
l.addComponent(t);
w.addComponent(l);
- w.addComponent(new Button("show me the bug", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- l.setWidth(-1);
- }
- }));
+ w.addComponent(new Button("show me the bug",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ l.setWidth(-1);
+ }
+ }));
}
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));
+ final Window main = new Window(getClass().getName().substring(
+ getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.setTheme("tests-tickets");
}\r
\r
private Button getButton(Layout l, Alignment align) {\r
- Button b = new Button("Narrow Button - " + align.getHorizontalAlignment() + " - " + align.getVerticalAlignment());\r
+ Button b = new Button("Narrow Button - "\r
+ + align.getHorizontalAlignment() + " - "\r
+ + align.getVerticalAlignment());\r
b.setWidth("100px");\r
((AlignmentHandler) l).setComponentAlignment(b, align);\r
\r
}\r
\r
private Button getButton(Layout l, Alignment align) {\r
- Button b = new Button(align.getHorizontalAlignment() + " - " + align.getVerticalAlignment());\r
+ Button b = new Button(align.getHorizontalAlignment() + " - "\r
+ + align.getVerticalAlignment());\r
// b.setWidth("100");\r
((AlignmentHandler) l).setComponentAlignment(b, align);\r
\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
main.getContent().setSizeFull();\r
TabSheet ts = new TabSheet();\r
ts.setSizeFull();\r
\r
- final Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(7, 2000);\r
+ final Table t = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(7, 2000);\r
t.setSizeFull();\r
ts.addTab(t, "Table, scrollins should not flash", null);\r
\r
- final Label testContent = new Label("TabSheet by default uses caption, icon, errors etc. from Components. ");\r
+ final Label testContent = new Label(\r
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");\r
\r
testContent.setCaption("Introduction to test");\r
\r
\r
Button b;\r
\r
- b = new Button("change introduction caption (should add * to tab name)", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- testContent.setCaption(testContent.getCaption() + "*");\r
- }\r
- });\r
+ b = new Button(\r
+ "change introduction caption (should add * to tab name)",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ testContent.setCaption(testContent.getCaption() + "*");\r
+ }\r
+ });\r
actions.addComponent(b);\r
\r
- b = new Button("change tab caption (should add * to tab name)", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- actions.setCaption(actions.getCaption() + "*");\r
- }\r
- });\r
+ b = new Button("change tab caption (should add * to tab name)",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ actions.setCaption(actions.getCaption() + "*");\r
+ }\r
+ });\r
\r
actions.addComponent(b);\r
\r
final Window w = new Window("Extra window: " + name);
w.setName(name);
addWindow(w);
- w.addComponent(new Label("This window has been created on fly for name: " + name));
- w.addComponent(new Button("Show open windows", new Button.ClickListener() {
+ w.addComponent(new Label(
+ "This window has been created on fly for name: " + name));
+ w.addComponent(new Button("Show open windows",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- String openWindows = "";
- for (Iterator<Window> i = getWindows().iterator(); i.hasNext();) {
- Window t = i.next();
- openWindows += (openWindows.length() > 0 ? "," : "") + t.getName();
- }
- w.showNotification(openWindows);
- }
- }));
+ public void buttonClick(ClickEvent event) {
+ String openWindows = "";
+ for (Iterator<Window> i = getWindows().iterator(); i
+ .hasNext();) {
+ Window t = i.next();
+ openWindows += (openWindows.length() > 0 ? "," : "")
+ + t.getName();
+ }
+ w.showNotification(openWindows);
+ }
+ }));
w.addListener(new Window.CloseListener() {
public void windowClose(CloseEvent e) {
removeWindow(w);
private Window createWindow() {
final Window w = new Window();
- w.addComponent(new Button("Show the name of the application", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- w.showNotification("Name of this window = " + w.getName());
- }
- }));
- w.addComponent(new Label("<a href='" + getURL().toExternalForm() + "'>" + getURL().toExternalForm() + "</a>", Label.CONTENT_XHTML));
- w.addComponent(new Label("<h2>How to reproduce</h2>Open the above link in another browser" + " window and then press the Show-button on this window.", Label.CONTENT_XHTML));
+ w.addComponent(new Button("Show the name of the application",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ w.showNotification("Name of this window = "
+ + w.getName());
+ }
+ }));
+ w.addComponent(new Label("<a href='" + getURL().toExternalForm() + "'>"
+ + getURL().toExternalForm() + "</a>", Label.CONTENT_XHTML));
+ w.addComponent(new Label(
+ "<h2>How to reproduce</h2>Open the above link in another browser"
+ + " window and then press the Show-button on this window.",
+ Label.CONTENT_XHTML));
return w;
}
layout.addComponent(cl1);\r
WebApplicationContext wc = ((WebApplicationContext) getContext());\r
\r
- layout.addComponent(new Button("Disable/Enable", new ClickListener() {\r
+ layout.addComponent(new Button("Disable/Enable",\r
+ new ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- boolean e = cl1.isEnabled();\r
+ public void buttonClick(ClickEvent event) {\r
+ boolean e = cl1.isEnabled();\r
\r
- cl1.setEnabled(!e);\r
- cl2.setEnabled(!e);\r
- }\r
+ cl1.setEnabled(!e);\r
+ cl2.setEnabled(!e);\r
+ }\r
\r
- }));\r
- File f = new File(wc.getBaseDirectory().getAbsoluteFile() + "/VAADIN/themes/" + getTheme() + "/layouts/Ticket1975.html");\r
+ }));\r
+ File f = new File(wc.getBaseDirectory().getAbsoluteFile()\r
+ + "/VAADIN/themes/" + getTheme()\r
+ + "/layouts/Ticket1975.html");\r
\r
cl2 = new CustomLayout(new FileInputStream(f));\r
layout.addComponent(cl2);\r
min.setVisible(true);
max.setVisible(false);
TitleBar.this.layout.removeAllComponents();
- TitleBar.this.layout.addComponent(TitleBar.this, 0, 0, 1, 1);
+ TitleBar.this.layout
+ .addComponent(TitleBar.this, 0, 0, 1, 1);
}
});
min.addListener(new ClickListener() {
dataSource.addContainerProperty(propId, String.class, null);
dataSource.addContainerProperty(propId2, String.class, null);
final Object itemId = dataSource.addItem();
- dataSource.getItem(itemId).getItemProperty(propId).setValue("Very long value that makes a scrollbar appear for sure");
- dataSource.getItem(itemId).getItemProperty(propId2).setValue("Very long value that makes a scrollbar appear for sure");
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId2)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
for (int i = 0; i < 150; i++) {
Object id = dataSource.addItem();
- dataSource.getItem(id).getItemProperty(propId).setValue((i == 100 ? "Very long value that makes a scrollbar appear for sure" : "Short"));
- dataSource.getItem(id).getItemProperty(propId2).setValue("Short");
+ dataSource
+ .getItem(id)
+ .getItemProperty(propId)
+ .setValue(
+ (i == 100 ? "Very long value that makes a scrollbar appear for sure"
+ : "Short"));
+ dataSource.getItem(id).getItemProperty(propId2)
+ .setValue("Short");
}
table.setSizeFull();
// Change the column value to a short one --> Should remove
// the scrollbar
if (isLong) {
- dataSource.getItem(itemId).getItemProperty(propId).setValue("Short value");
- dataSource.getItem(itemId).getItemProperty(propId2).setValue("Short value");
+ dataSource.getItem(itemId).getItemProperty(propId)
+ .setValue("Short value");
+ dataSource.getItem(itemId).getItemProperty(propId2)
+ .setValue("Short value");
isLong = false;
} else {
- dataSource.getItem(itemId).getItemProperty(propId).setValue("Very long value that makes a scrollbar appear for sure");
- dataSource.getItem(itemId).getItemProperty(propId2).setValue("Very long value that makes a scrollbar appear for sure");
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId2)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
isLong = true;
}
// Works the same way with or without repaint request
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
Table t = new Table("Test table");\r
item = table.addItem("2");\r
item.getItemProperty(PROPERTY_1).setValue("Row 2");\r
\r
- Filterable filterable = (Container.Filterable) table.getContainerDataSource();\r
+ Filterable filterable = (Container.Filterable) table\r
+ .getContainerDataSource();\r
filterable.addContainerFilter(PROPERTY_1, "Row", true, false);\r
\r
table.setColumnHeader(PROPERTY_1, "Test (filter: Row)");\r
\r
mainWin.addComponent(table);\r
- mainWin.addComponent(new Button("Add item", new com.vaadin.ui.Button.ClickListener() {\r
+ mainWin.addComponent(new Button("Add item",\r
+ new com.vaadin.ui.Button.ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- addItem();\r
- }\r
- }));\r
+ public void buttonClick(ClickEvent event) {\r
+ addItem();\r
+ }\r
+ }));\r
}\r
\r
protected void addItem() {\r
- Filterable filterable = (Container.Filterable) table.getContainerDataSource();\r
+ Filterable filterable = (Container.Filterable) table\r
+ .getContainerDataSource();\r
\r
Item i = table.addItem("abc");\r
String res = "";\r
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
- throw new InvalidValueException(value + " is not a non-negative number");
+ throw new InvalidValueException(value
+ + " is not a non-negative number");
}
}
});
- CompositeValidator v2 = new CompositeValidator(CompositeValidator.MODE_OR, null);
+ CompositeValidator v2 = new CompositeValidator(
+ CompositeValidator.MODE_OR, null);
v2.addValidator(v);
v2.addValidator(new Validator() {
});
tx.addValidator(v2);
- final String[] visibleProps = { "required", "invalidAllowed", "readOnly", "readThrough", "invalidCommitted", "validationVisible" };
+ final String[] visibleProps = { "required", "invalidAllowed",
+ "readOnly", "readThrough", "invalidCommitted",
+ "validationVisible" };
for (int i = 0; i < visibleProps.length; i++) {
- Button b = new Button(visibleProps[i], new MethodProperty<Boolean>(tx, visibleProps[i]));
+ Button b = new Button(visibleProps[i], new MethodProperty<Boolean>(
+ tx, visibleProps[i]));
b.setImmediate(true);
mainWin.addComponent(b);
}
- mainWin.addComponent(new Button("Validate integer", new Button.ClickListener() {
- public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
- mainWin.showNotification("The field is " + (tx.isValid() ? "" : "not ") + "valid");
- };
- }));
+ mainWin.addComponent(new Button("Validate integer",
+ new Button.ClickListener() {
+ public void buttonClick(
+ com.vaadin.ui.Button.ClickEvent event) {
+ mainWin.showNotification("The field is "
+ + (tx.isValid() ? "" : "not ") + "valid");
+ };
+ }));
}
}
GridLayout layout = new GridLayout(2, 2);\r
layout.setSpacing(true);\r
\r
- TextField f1 = new TextField("Non-immediate/Long text field", new MethodProperty<Long>(this, "long1"));\r
+ TextField f1 = new TextField("Non-immediate/Long text field",\r
+ new MethodProperty<Long>(this, "long1"));\r
f1.setImmediate(false);\r
f1.setNullSettingAllowed(true);\r
- TextField f2 = new TextField("Immediate/Long text field", new MethodProperty<Long>(this, "long2"));\r
+ TextField f2 = new TextField("Immediate/Long text field",\r
+ new MethodProperty<Long>(this, "long2"));\r
f2.setImmediate(true);\r
f2.setNullSettingAllowed(true);\r
\r
final Window main = new Window("Main window for #2007");
setMainWindow(main);
- main.addComponent(new Button("Open another (non-main) window", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- Window c = new Window("Non-main browser window " + (++childs));
- addWindow(c);
- main.open(new ExternalResource(c.getURL()), "_new");
- }
- }));
+ main.addComponent(new Button("Open another (non-main) window",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Window c = new Window("Non-main browser window "
+ + (++childs));
+ addWindow(c);
+ main.open(new ExternalResource(c.getURL()), "_new");
+ }
+ }));
}
}
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
HorizontalLayout ol = new HorizontalLayout();\r
\r
t.addListener(new ItemClickEvent.ItemClickListener() {\r
public void itemClick(ItemClickEvent event) {\r
- events.addComponent(new Label(new Label("Click:" + (event.isDoubleClick() ? "double" : "single") + " button:" + event.getButton() + " propertyId:" + event.getPropertyId() + " itemID:" + event.getItemId() + " item:" + event.getItem())));\r
+ events.addComponent(new Label(new Label("Click:"\r
+ + (event.isDoubleClick() ? "double" : "single")\r
+ + " button:" + event.getButton() + " propertyId:"\r
+ + event.getPropertyId() + " itemID:"\r
+ + event.getItemId() + " item:" + event.getItem())));\r
\r
}\r
});\r
p2.setSizeFull();\r
\r
final VerticalLayout events2 = new VerticalLayout();\r
- Table table = TestForTablesInitialColumnWidthLogicRendering.getTestTable(5, 100);\r
+ Table table = TestForTablesInitialColumnWidthLogicRendering\r
+ .getTestTable(5, 100);\r
table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);\r
table.addListener(new ItemClickEvent.ItemClickListener() {\r
public void itemClick(ItemClickEvent event) {\r
- events2.addComponent(new Label("Click:" + (event.isDoubleClick() ? "double" : "single") + " button:" + event.getButton() + " propertyId:" + event.getPropertyId() + " itemID:" + event.getItemId() + " item:" + event.getItem()));\r
+ events2.addComponent(new Label("Click:"\r
+ + (event.isDoubleClick() ? "double" : "single")\r
+ + " button:" + event.getButton() + " propertyId:"\r
+ + event.getPropertyId() + " itemID:"\r
+ + event.getItemId() + " item:" + event.getItem()));\r
if (event.isDoubleClick()) {\r
new PropertyEditor(event);\r
}\r
\r
setCaption("Editing " + itemid + " : " + propertyid);\r
\r
- editor.setPropertyDataSource(c.getContainerProperty(itemid, propertyid));\r
+ editor.setPropertyDataSource(c.getContainerProperty(itemid,\r
+ propertyid));\r
addComponent(editor);\r
addComponent(done);\r
\r
private void createUI(GridLayout layout) {\r
createPanel(layout);\r
\r
- layout.addComponent(new Button("Change class name", new ClickListener() {\r
+ layout.addComponent(new Button("Change class name",\r
+ new ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- b1.setStyleName(UUID.randomUUID().toString());\r
- }\r
+ public void buttonClick(ClickEvent event) {\r
+ b1.setStyleName(UUID.randomUUID().toString());\r
+ }\r
\r
- }));\r
+ }));\r
\r
}\r
\r
\r
private TextField tf1, tf2, tf3;\r
\r
- private String contents = "This TextField SHOULD FILL the panel and NOT CAUSE any scrollbars to appear in the Panel. Scrollbars SHOULD appear in the TextField AND the whole scrollbars (includinc arrow down) SHOULD be visible.\n\n" + "" + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent quis justo. Vivamus nec mi eu libero convallis auctor. Mauris et arcu. Nunc luctus justo. Aenean convallis, odio in vehicula scelerisque, est magna condimentum pede, a aliquam elit eros vitae diam. Phasellus porttitor convallis tellus. Nullam elementum, ligula nec viverra malesuada, risus tortor bibendum dui, eget hendrerit sem enim at massa. Nam eu pede sed nulla congue fermentum. Vestibulum malesuada libero non nunc. Proin rutrum. Fusce erat pede, volutpat vitae, aliquam ut, sagittis vel, augue. Fusce dui pede, convallis nec, accumsan tincidunt, consectetuer ac, purus. Nulla facilisi. Ut nisi. Sed orci risus, lacinia eu, sodales molestie, gravida quis, neque. Vestibulum pharetra ornare elit. Nulla porttitor molestie mauris. Morbi fringilla tellus sed risus. Curabitur varius massa." + "Nulla nisi. Sed blandit, ante vitae sagittis volutpat, arcu mauris vehicula risus, vitae posuere felis lectus sit amet purus. Donec nec magna et leo eleifend scelerisque. Suspendisse condimentum pharetra ligula. Curabitur lorem. Pellentesque a augue sit amet enim fermentum placerat. Phasellus ante risus, molestie at, iaculis at, pellentesque non, tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non urna eget risus tempus imperdiet. Integer est diam, sagittis sit amet, posuere sit amet, bibendum sed, lacus. Aenean adipiscing cursus ipsum. Quisque at elit. Vestibulum vitae nunc. Praesent placerat metus viverra lorem. Cras nec elit congue nisi faucibus feugiat. Nam eget mi. Vestibulum condimentum. Nunc nisl ante, cursus in, dictum ac, lobortis rutrum, mi. Nulla eu nisi. In ultricies vehicula magna." + "Nunc eros dui, elementum at, ullamcorper eget, varius at, velit. Ut dictum. Cras ullamcorper ante vel tortor. Quisque viverra mauris vulputate quam. Nulla dui. Suspendisse non eros at ipsum faucibus hendrerit. Morbi dignissim pharetra tortor. Etiam malesuada. Mauris lacinia elementum erat. Duis mollis placerat metus. Nunc risus felis, cursus ac, cursus vel, convallis vel, metus. Ut vehicula nibh et nulla. Vivamus id pede. Quisque egestas arcu a ligula. Maecenas vehicula. Quisque sed ligula quis tellus tempus rutrum. Curabitur vel augue sed orci egestas pharetra. Duis pharetra.";\r
+ private String contents = "This TextField SHOULD FILL the panel and NOT CAUSE any scrollbars to appear in the Panel. Scrollbars SHOULD appear in the TextField AND the whole scrollbars (includinc arrow down) SHOULD be visible.\n\n"\r
+ + ""\r
+ + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent quis justo. Vivamus nec mi eu libero convallis auctor. Mauris et arcu. Nunc luctus justo. Aenean convallis, odio in vehicula scelerisque, est magna condimentum pede, a aliquam elit eros vitae diam. Phasellus porttitor convallis tellus. Nullam elementum, ligula nec viverra malesuada, risus tortor bibendum dui, eget hendrerit sem enim at massa. Nam eu pede sed nulla congue fermentum. Vestibulum malesuada libero non nunc. Proin rutrum. Fusce erat pede, volutpat vitae, aliquam ut, sagittis vel, augue. Fusce dui pede, convallis nec, accumsan tincidunt, consectetuer ac, purus. Nulla facilisi. Ut nisi. Sed orci risus, lacinia eu, sodales molestie, gravida quis, neque. Vestibulum pharetra ornare elit. Nulla porttitor molestie mauris. Morbi fringilla tellus sed risus. Curabitur varius massa."\r
+ + "Nulla nisi. Sed blandit, ante vitae sagittis volutpat, arcu mauris vehicula risus, vitae posuere felis lectus sit amet purus. Donec nec magna et leo eleifend scelerisque. Suspendisse condimentum pharetra ligula. Curabitur lorem. Pellentesque a augue sit amet enim fermentum placerat. Phasellus ante risus, molestie at, iaculis at, pellentesque non, tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non urna eget risus tempus imperdiet. Integer est diam, sagittis sit amet, posuere sit amet, bibendum sed, lacus. Aenean adipiscing cursus ipsum. Quisque at elit. Vestibulum vitae nunc. Praesent placerat metus viverra lorem. Cras nec elit congue nisi faucibus feugiat. Nam eget mi. Vestibulum condimentum. Nunc nisl ante, cursus in, dictum ac, lobortis rutrum, mi. Nulla eu nisi. In ultricies vehicula magna."\r
+ + "Nunc eros dui, elementum at, ullamcorper eget, varius at, velit. Ut dictum. Cras ullamcorper ante vel tortor. Quisque viverra mauris vulputate quam. Nulla dui. Suspendisse non eros at ipsum faucibus hendrerit. Morbi dignissim pharetra tortor. Etiam malesuada. Mauris lacinia elementum erat. Duis mollis placerat metus. Nunc risus felis, cursus ac, cursus vel, convallis vel, metus. Ut vehicula nibh et nulla. Vivamus id pede. Quisque egestas arcu a ligula. Maecenas vehicula. Quisque sed ligula quis tellus tempus rutrum. Curabitur vel augue sed orci egestas pharetra. Duis pharetra.";\r
\r
private AbstractOrderedLayout orderedLayout;\r
\r
@SuppressWarnings("unused")\r
private void createUI(Layout layout) {\r
Label l = new Label("Label");\r
- Button b = new Button("Enable/disable caption and watch button move", new ClickListener() {\r
-\r
- public void buttonClick(ClickEvent event) {\r
- System.out.println("Enable/disable caption");\r
- for (AbstractComponent l : new AbstractComponent[] { tf1, tf2, tf3 }) {\r
- // AbstractComponent l = tf2;\r
- // Layout l = (Layout) event.getButton().getData();\r
- if (l.getCaption() == null) {\r
- l.setCaption("Expand layout caption");\r
- } else {\r
- l.setCaption(null);\r
+ Button b = new Button("Enable/disable caption and watch button move",\r
+ new ClickListener() {\r
+\r
+ public void buttonClick(ClickEvent event) {\r
+ System.out.println("Enable/disable caption");\r
+ for (AbstractComponent l : new AbstractComponent[] {\r
+ tf1, tf2, tf3 }) {\r
+ // AbstractComponent l = tf2;\r
+ // Layout l = (Layout) event.getButton().getData();\r
+ if (l.getCaption() == null) {\r
+ l.setCaption("Expand layout caption");\r
+ } else {\r
+ l.setCaption(null);\r
+ }\r
+ }\r
}\r
- }\r
- }\r
\r
- });\r
+ });\r
b.setData(layout);\r
Label l2 = new Label("This should always be visible");\r
\r
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Window;
-public class Ticket2023 extends com.vaadin.Application implements Button.ClickListener {
+public class Ticket2023 extends com.vaadin.Application implements
+ Button.ClickListener {
AbstractComponent c = new Button();
setMainWindow(main);
String[] sizes = { "20", "100", "1", "0", "-1", "", "z" };
- String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc", "", "p", "zyx" };
+ String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc",
+ "", "p", "zyx" };
GridLayout gl = new GridLayout(units.length, sizes.length);
main.addComponent(gl);
w.getContent().setHeight("2000");\r
w.getContent().addComponent(layout);\r
\r
- layout.addComponent(new Label("This should NOT get stuck when scrolling down"));\r
+ layout.addComponent(new Label(\r
+ "This should NOT get stuck when scrolling down"));\r
layout.addComponent(new TextField("This should not get stuck either..."));\r
\r
VerticalLayout ol = new VerticalLayout();\r
Window main = new Window();\r
setMainWindow(main);\r
\r
- main.addComponent(new Label("Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks."));\r
+ main.addComponent(new Label(\r
+ "Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks."));\r
\r
final Layout lo = new VerticalLayout();\r
\r
final Window w = new Window("Testing for #2038");
setMainWindow(w);
- final TextField tf = new TextField("Test-field, enter someting and click outside the field to activate");
+ final TextField tf = new TextField(
+ "Test-field, enter someting and click outside the field to activate");
tf.setRequired(true);
tf.setImmediate(true);
tf.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- w.showNotification("TextField is " + (tf.isValid() ? "" : "in") + "valid, with error: " + tf.getErrorMessage(), Notification.TYPE_WARNING_MESSAGE);
+ w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
+ + "valid, with error: " + tf.getErrorMessage(),
+ Notification.TYPE_WARNING_MESSAGE);
}
});
w.addComponent(tf);
- final Button b = new Button("Field should use error message. (!) should be shown when invalid.", false);
+ final Button b = new Button(
+ "Field should use error message. (!) should be shown when invalid.",
+ false);
w.addComponent(b);
b.setImmediate(true);
b.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- tf.setRequiredError(b.booleanValue() ? "Field must not be empty" : null);
+ tf.setRequiredError(b.booleanValue() ? "Field must not be empty"
+ : null);
}
});
}
l.setSizeFull();\r
ts.addTab(l, "100% h component", null);\r
\r
- Label testContent = new Label("TabSheet by default uses caption, icon, errors etc. from Components. ");\r
+ Label testContent = new Label(\r
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");\r
\r
testContent.setCaption("Introduction to test");\r
\r
l.setSizeFull();\r
ts.addTab(l, "200px h component", null);\r
\r
- testContent = new Label("TabSheet by default uses caption, icon, errors etc. from Components. ");\r
+ testContent = new Label(\r
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");\r
\r
testContent.setCaption("Introduction to test");\r
\r
l.setSizeFull();\r
ts.addTab(l, "50% h component", null);\r
\r
- testContent = new Label("TabSheet by default uses caption, icon, errors etc. from Components. ");\r
+ testContent = new Label(\r
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");\r
\r
testContent.setCaption("Introduction to test");\r
\r
}\r
\r
private void createUI(GridLayout layout) {\r
- Link l = new Link("Vaadin home (new 200x200 window, no decor, icon)", new ExternalResource("http://www.vaadin.com"), "_blank", 200, 200, Link.TARGET_BORDER_NONE);\r
+ Link l = new Link("Vaadin home (new 200x200 window, no decor, icon)",\r
+ new ExternalResource("http://www.vaadin.com"), "_blank", 200,\r
+ 200, Link.TARGET_BORDER_NONE);\r
\r
layout.addComponent(l);\r
}\r
l.setHeight("400px");\r
p.addComponent(l);\r
\r
- embedded = new Embedded(null, new ThemeResource("icons/64/folder-add.png"));\r
+ embedded = new Embedded(null, new ThemeResource(\r
+ "icons/64/folder-add.png"));\r
layout.addComponent(embedded);\r
- Button b = new Button("Replace image with new embedded component (flashes)", new ClickListener() {\r
+ Button b = new Button(\r
+ "Replace image with new embedded component (flashes)",\r
+ new ClickListener() {\r
\r
- public void buttonClick(ClickEvent event) {\r
- Embedded newEmbedded = new Embedded(null, new ThemeResource("icons/64/folder-add.png"));\r
- getMainWindow().getContent().replaceComponent(embedded, newEmbedded);\r
- embedded = newEmbedded;\r
+ public void buttonClick(ClickEvent event) {\r
+ Embedded newEmbedded = new Embedded(null,\r
+ new ThemeResource("icons/64/folder-add.png"));\r
+ getMainWindow().getContent().replaceComponent(embedded,\r
+ newEmbedded);\r
+ embedded = newEmbedded;\r
\r
- }\r
+ }\r
\r
- });\r
+ });\r
p.addComponent(b);\r
\r
b = new Button("Change image source (is fine)", new ClickListener() {\r
\r
public void buttonClick(ClickEvent event) {\r
String img = "folder-add";\r
- if (((ThemeResource) embedded.getSource()).getResourceId().contains("folder-add")) {\r
+ if (((ThemeResource) embedded.getSource()).getResourceId()\r
+ .contains("folder-add")) {\r
img = "folder-delete";\r
}\r
embedded.setSource(new ThemeResource("icons/64/" + img + ".png"));\r
setMainWindow(main);
Button nothing = new Button("Do nothing");
main.addComponent(nothing);
- nothing.setDescription("Even though no action is taked, this window is refreshed to " + "draw changes not originating from this window. Such changes include changes " + "made by other browser-windows.");
+ nothing.setDescription("Even though no action is taked, this window is refreshed to "
+ + "draw changes not originating from this window. Such changes include changes "
+ + "made by other browser-windows.");
Button add = new Button("Add a window", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
final String name = "Child " + (++childs);
c.addComponent(tf);
tf.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- main.addComponent(new Label(name + " send text:" + tf.toString()));
+ main.addComponent(new Label(name + " send text:"
+ + tf.toString()));
}
});
for (int i = 0; i < 3; i++) {
final String caption = "Slow button " + i;
- c.addComponent(new Button(caption, new Button.ClickListener() {
- public synchronized void buttonClick(ClickEvent event) {
- try {
- this.wait(2000);
- } catch (InterruptedException e) {
- }
- main.addComponent(new Label(caption + " pressed"));
- }
- }));
+ c.addComponent(new Button(caption,
+ new Button.ClickListener() {
+ public synchronized void buttonClick(
+ ClickEvent event) {
+ try {
+ this.wait(2000);
+ } catch (InterruptedException e) {
+ }
+ main.addComponent(new Label(caption
+ + " pressed"));
+ }
+ }));
}
}
});
main.addComponent(add);
- add.setDescription("This button opens a new browser window. Closing the browser " + "window should do two things: 1) submit all unsubmitted state to server " + "(print any changes to textfield to main window) and 2) call window.close()" + " on the child window (print closed on the main window)");
+ add.setDescription("This button opens a new browser window. Closing the browser "
+ + "window should do two things: 1) submit all unsubmitted state to server "
+ + "(print any changes to textfield to main window) and 2) call window.close()"
+ + " on the child window (print closed on the main window)");
}
}
MyTable table3 = new MyTable(24, "table3");
table3.loadTable(1000);
- MyAccordion accordion = new MyAccordion(new Component[] { table1, table2 }, "Test");
+ MyAccordion accordion = new MyAccordion(new Component[] { table1,
+ table2 }, "Test");
Tabs tab = new Tabs(new Component[] { accordion, table3 });
Item rowItem = table.addItem(j);
if (rowItem != null) {
for (int i = 0; i < columns.length; i++) {
- rowItem.getItemProperty(columns[i]).setValue("Value" + j);
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
}
}
}
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2061b extends Application implements SelectedTabChangeListener {
+public class Ticket2061b extends Application implements
+ SelectedTabChangeListener {
private Window mainWindow;
private Panel p;
public void init() {
mainWindow = new Window("Ticket 2061b");
mainWindow.setSizeFull();
- AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow.getContent();
+ AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow
+ .getContent();
mainLayout.setSizeFull();
mainLayout.setMargin(false);
setMainWindow(mainWindow);
Item rowItem = table.addItem(j);
if (rowItem != null) {
for (int i = 0; i < columns.length; i++) {
- rowItem.getItemProperty(columns[i]).setValue("Value" + j);
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
}
}
}
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2061c extends Application implements SelectedTabChangeListener {
+public class Ticket2061c extends Application implements
+ SelectedTabChangeListener {
private Window mainWindow;
private Panel p;
Item rowItem = table.addItem(j);
if (rowItem != null) {
for (int i = 0; i < columns.length; i++) {
- rowItem.getItemProperty(columns[i]).setValue("Value" + j);
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
}
}
}
}\r
\r
private void createUI(GridLayout layout) {\r
- Panel p = new Panel("This is a panel with a longer caption than it should have");\r
+ Panel p = new Panel(\r
+ "This is a panel with a longer caption than it should have");\r
p.setWidth("100px");\r
p.getContent().addComponent(new Label("Contents"));\r
layout.addComponent(p);\r
}
private void updateLabel() {
- label.setValue("width: " + target.getWidth() + Sizeable.UNIT_SYMBOLS[target.getWidthUnits()] + ", height: " + target.getHeight() + Sizeable.UNIT_SYMBOLS[target.getHeightUnits()]);
+ label.setValue("width: " + target.getWidth()
+ + Sizeable.UNIT_SYMBOLS[target.getWidthUnits()] + ", height: "
+ + target.getHeight()
+ + Sizeable.UNIT_SYMBOLS[target.getHeightUnits()]);
}
}
Window w = new Window(getClass().getSimpleName());\r
setMainWindow(w);\r
\r
- Button b = new Button("Button with a long text which will not fit on 50 pixels");\r
+ Button b = new Button(\r
+ "Button with a long text which will not fit on 50 pixels");\r
b.setWidth("50px");\r
\r
w.getContent().addComponent(b);\r
MyTable table2 = new MyTable(4, "table2");
table2.loadTable(100);
- MyAccordion a = new MyAccordion(new Component[] { table1, table2 }, "FDSF");
+ MyAccordion a = new MyAccordion(new Component[] { table1, table2 },
+ "FDSF");
mainWindow.addComponent(a);
setMainWindow(mainWindow);
// mainWindow.addComponent(table1);
Item rowItem = table.addItem(j);
if (rowItem != null) {
for (int i = 0; i < columns.length; i++) {
- rowItem.getItemProperty(columns[i]).setValue("Value" + j);
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
}
}
}
public class Ticket2104 extends Application {
- private static final Label info = new Label("Click event should _always_ come trough. Switching features on/off should immediatly affect the tree (verify w/ debug window)", Label.CONTENT_RAW);
+ private static final Label info = new Label(
+ "Click event should _always_ come trough. Switching features on/off should immediatly affect the tree (verify w/ debug window)",
+ Label.CONTENT_RAW);
Tree tree = new Tree();
Table table = new Table();
HorizontalLayout ol = new HorizontalLayout();
main.addComponent(ol);
- Button b = new Button("immediate", new MethodProperty<Boolean>(tree, "immediate"));
+ Button b = new Button("immediate", new MethodProperty<Boolean>(tree,
+ "immediate"));
b.setImmediate(true);
ol.addComponent(b);
- b = new Button("selectable", new MethodProperty<Boolean>(tree, "selectable"));
+ b = new Button("selectable", new MethodProperty<Boolean>(tree,
+ "selectable"));
b.setImmediate(true);
ol.addComponent(b);
- b = new Button("nullsel", new MethodProperty<Boolean>(tree, "nullSelectionAllowed"));
+ b = new Button("nullsel", new MethodProperty<Boolean>(tree,
+ "nullSelectionAllowed"));
b.setImmediate(true);
ol.addComponent(b);
- b = new Button("multi", new MethodProperty<Boolean>(tree, "multiSelect"));
+ b = new Button("multi",
+ new MethodProperty<Boolean>(tree, "multiSelect"));
b.setImmediate(true);
ol.addComponent(b);
b = new Button("icon", new Button.ClickListener() {
tree.setParent("2. Child 1", "Root 2");
tree.addItem("2. Child 2");
tree.setParent("2. Child 2", "Root 2");
- tree.addContainerProperty("icon", ExternalResource.class, new ExternalResource("http://www.itmill.com/res/images/itmill_logo.gif"));
+ tree.addContainerProperty("icon", ExternalResource.class,
+ new ExternalResource(
+ "http://www.itmill.com/res/images/itmill_logo.gif"));
tree.addListener(new ItemClickListener() {
public void itemClick(ItemClickEvent event) {
- getMainWindow().addComponent(new Label(event.toString() + " // " + event.getItemId() + "//" + event.getSource()));
+ getMainWindow().addComponent(
+ new Label(event.toString() + " // " + event.getItemId()
+ + "//" + event.getSource()));
}
});
ol = new HorizontalLayout();
main.addComponent(ol);
- b = new Button("immediate", new MethodProperty<Boolean>(table, "immediate"));
+ b = new Button("immediate", new MethodProperty<Boolean>(table,
+ "immediate"));
b.setImmediate(true);
ol.addComponent(b);
- b = new Button("selectable", new MethodProperty<Boolean>(table, "selectable"));
+ b = new Button("selectable", new MethodProperty<Boolean>(table,
+ "selectable"));
b.setImmediate(true);
ol.addComponent(b);
- b = new Button("nullsel", new MethodProperty<Boolean>(table, "nullSelectionAllowed"));
+ b = new Button("nullsel", new MethodProperty<Boolean>(table,
+ "nullSelectionAllowed"));
b.setImmediate(true);
ol.addComponent(b);
- b = new Button("multi", new MethodProperty<Boolean>(table, "multiSelect"));
+ b = new Button("multi", new MethodProperty<Boolean>(table,
+ "multiSelect"));
b.setImmediate(true);
ol.addComponent(b);
main.addComponent(table);
}
table.addListener(new ItemClickListener() {
public void itemClick(ItemClickEvent event) {
- getMainWindow().addComponent(new Label(event.toString() + " // " + event.getItemId() + "//" + event.getSource()));
+ getMainWindow().addComponent(
+ new Label(event.toString() + " // " + event.getItemId()
+ + "//" + event.getSource()));
}
});
@Override
public void init() {
setMainWindow(new Window("#2106"));
- getMainWindow().addComponent(new Button("Do nothing", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- getMainWindow().addComponent(new Label("Last time did nothing: " + new Date()));
- }
- }));
+ getMainWindow().addComponent(
+ new Button("Do nothing", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ getMainWindow().addComponent(
+ new Label("Last time did nothing: "
+ + new Date()));
+ }
+ }));
}
}
final Window w = new Window("Testing for #2107");
setMainWindow(w);
- final TextField tf = new TextField("Required field that validated the input");
+ final TextField tf = new TextField(
+ "Required field that validated the input");
tf.setDescription("Enter someting and click outside the field to activate");
tf.setRequired(true);
tf.setImmediate(true);
tf.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- w.showNotification("TextField is " + (tf.isValid() ? "" : "in") + "valid, with error: " + tf.getErrorMessage(), Notification.TYPE_WARNING_MESSAGE);
+ w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
+ + "valid, with error: " + tf.getErrorMessage(),
+ Notification.TYPE_WARNING_MESSAGE);
}
});
tf.addValidator(new Validator() {
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
- throw new InvalidValueException("Text length must exceed 3 characters");
+ throw new InvalidValueException(
+ "Text length must exceed 3 characters");
}
}
});
w.addComponent(tf);
- final Button b = new Button("Field should use error message. (!) should be shown when empty.", false);
+ final Button b = new Button(
+ "Field should use error message. (!) should be shown when empty.",
+ false);
w.addComponent(b);
b.setImmediate(true);
b.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- tf.setRequiredError(b.booleanValue() ? "Field must not be empty" : null);
+ tf.setRequiredError(b.booleanValue() ? "Field must not be empty"
+ : null);
}
});
}
final Window w = new Window("Extra window: " + name);
w.setName(name);
addWindow(w);
- w.addComponent(new Label("This window has been created on fly for name: " + name));
- w.addComponent(new Label("It has also been redirected to " + w.getURL() + " to support reloading"));
+ w.addComponent(new Label(
+ "This window has been created on fly for name: " + name));
+ w.addComponent(new Label("It has also been redirected to " + w.getURL()
+ + " to support reloading"));
w.addComponent(new Button("button", new ClickListener() {
public void buttonClick(ClickEvent event) {
w.showNotification("Button clicked");
private Window createWindow() {
final Window w = new Window();
- w.addComponent(new Label("Click this link: <a target=\"_blank\" href='" + getURL().toExternalForm() + "'>" + getURL().toExternalForm() + "</a> which opens new windows to this uri. They should end up having a separate Window and URL.", Label.CONTENT_XHTML));
+ w.addComponent(new Label(
+ "Click this link: <a target=\"_blank\" href='"
+ + getURL().toExternalForm()
+ + "'>"
+ + getURL().toExternalForm()
+ + "</a> which opens new windows to this uri. They should end up having a separate Window and URL.",
+ Label.CONTENT_XHTML));
return w;
}
}
private Layout testLayout() {
final Layout layout = new VerticalLayout();
- final Label label = new Label("Instructions to reproduce:\n" + " - Open this application in two browser windows\n" + " - Click the Button in first Window\n" + " - Go to the second Window\n" + " - Click the arrow in the Select\n" + " --> The opened list correctly shows the new value but the old one is shown in the \"input\" part");
+ final Label label = new Label(
+ "Instructions to reproduce:\n"
+ + " - Open this application in two browser windows\n"
+ + " - Click the Button in first Window\n"
+ + " - Go to the second Window\n"
+ + " - Click the arrow in the Select\n"
+ + " --> The opened list correctly shows the new value but the old one is shown in the \"input\" part");
label.setContentMode(Label.CONTENT_PREFORMATTED);
layout.addComponent(label);
select.addItem("2");
select.addItem("3");
- final ObjectProperty<String> valueProperty = new ObjectProperty<String>("1", String.class);
+ final ObjectProperty<String> valueProperty = new ObjectProperty<String>(
+ "1", String.class);
select.setPropertyDataSource(valueProperty);
layout.addComponent(select);
MainWindow(String caption) {
super(caption);
- addComponent(new Label("Inspect w/ Firebug: row 5 should have a MYROW -style on the row, and MYCELL on all cells"));
+ addComponent(new Label(
+ "Inspect w/ Firebug: row 5 should have a MYROW -style on the row, and MYCELL on all cells"));
Table table = new Table();
table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);
table.addContainerProperty("String", String.class, "a string");
table.addContainerProperty("Boolean", Boolean.class, Boolean.TRUE);
table.addGeneratedColumn("Generated", new ColumnGenerator() {
- public Component generateCell(Table source, Object itemId, Object columnId) {
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
return new Label("Item " + itemId);
}
});
}
});
- Button b = new Button("editmode", new MethodProperty<Boolean>(table, "editable"));
+ Button b = new Button("editmode", new MethodProperty<Boolean>(
+ table, "editable"));
b.setImmediate(true);
addComponent(b);
}
}
if (ok) {
- status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + ": OK");
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": OK");
} else {
- status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + ": FAILED");
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": FAILED");
}
}
try {
b.setWriteThrough(true);
b.setReadThrough(true);
- ObjectProperty<String> prop = new ObjectProperty<String>("ABC 123");
+ ObjectProperty<String> prop = new ObjectProperty<String>(
+ "ABC 123");
/*
* This should throw an exception or somehow tell that the
* property was invalid (wrong type). See #2223.
}
if (ok) {
- status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + "/DB: OK");
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + "/DB: OK");
} else {
- status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + "/DB: FAILED");
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + "/DB: FAILED");
}
}
f.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- main.showNotification("Test field is " + (f.isValid() ? "valid" : "invalid"));
+ main.showNotification("Test field is "
+ + (f.isValid() ? "valid" : "invalid"));
}
});
button.setWidth("100%");
Label label1 = new Label("Lorem ipsum");
Label label2 = new Label("Lorem");
- Label label3 = new Label("Lorema jsdfhak sjdfh kajsdh fkajhd kfjah dkfjah ksfdjh kajsfh kj 1 2 3 4 5 6 7 8 9 10");
+ Label label3 = new Label(
+ "Lorema jsdfhak sjdfh kajsdh fkajhd kfjah dkfjah ksfdjh kajsfh kj 1 2 3 4 5 6 7 8 9 10");
label3.setWidth("800px");
tabSheet.addTab(label1, "Tab 1", null);
tf.setCaption(caption);
} else if (value.equals("Icon")) {
String timestamp = String.valueOf(new Date().getTime());
- tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons.size())) + "?" + timestamp));
+ tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons
+ .size())) + "?" + timestamp));
} else if (value.equals("Required")) {
tf.setRequired(true);
} else if (value.equals("Error")) {
return createField();
}
- public Field createField(Item item, Object propertyId, Component uiContext) {
+ public Field createField(Item item, Object propertyId,
+ Component uiContext) {
return createField();
}
return formTextArea;
}
- public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {
+ public Field createField(Container container, Object itemId,
+ Object propertyId, Component uiContext) {
return createField();
}
t.setHeight("150px");\r
t.addGeneratedColumn("col 3 (green)", new ColumnGenerator() {\r
\r
- public Component generateCell(Table source, Object itemId, Object columnId) {\r
+ public Component generateCell(Table source, Object itemId,\r
+ Object columnId) {\r
Item item = source.getItem(itemId);\r
- String col1 = (String) item.getItemProperty("col 1 (red)").getValue();\r
+ String col1 = (String) item.getItemProperty("col 1 (red)")\r
+ .getValue();\r
String col2 = (String) item.getItemProperty("col 2").getValue();\r
return new Label(col1 + "-" + col2);\r
}\r
}\r
});\r
\r
- t.addItem(new Object[] { "Col 1-1", "Col 2-1", "Col 4-1" }, new Object());\r
- t.addItem(new Object[] { "Col 1-2", "Col 2-2", "Col 4-2" }, new Object());\r
- t.addItem(new Object[] { "Col 1-3", "Col 2-3", "Col 4-3" }, new Object());\r
+ t.addItem(new Object[] { "Col 1-1", "Col 2-1", "Col 4-1" },\r
+ new Object());\r
+ t.addItem(new Object[] { "Col 1-2", "Col 2-2", "Col 4-2" },\r
+ new Object());\r
+ t.addItem(new Object[] { "Col 1-3", "Col 2-3", "Col 4-3" },\r
+ new Object());\r
\r
t.setColumnReorderingAllowed(true);\r
t.setColumnCollapsingAllowed(true);\r
getMainWindow().addComponent(gl);\r
setTheme("tests-tickets");\r
combo = new ComboBox("Combo caption");\r
- labelLong = new Label("A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");\r
+ labelLong = new Label(\r
+ "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");\r
gl.addComponent(combo);\r
gl.addComponent(labelLong);\r
\r
getMainWindow().addComponent(gl);\r
setTheme("tests-tickets");\r
combo = new ComboBox("Combo caption");\r
- labelLong = new Label("This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. " + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");\r
+ labelLong = new Label(\r
+ "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. "\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");\r
gl.addComponent(combo);\r
gl.addComponent(labelLong);\r
\r
getMainWindow().addComponent(gl);\r
setTheme("tests-tickets");\r
combo = new ComboBox("Combo caption");\r
- labelLong = new Label("This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. " + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");\r
+ labelLong = new Label(\r
+ "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. "\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"\r
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");\r
gl.addComponent(combo);\r
gl.addComponent(labelLong);\r
\r
setCompositionRoot(main);
main.setSizeFull();
- Button b = new Button("Switch textfield/panel", new ClickListener() {
+ Button b = new Button("Switch textfield/panel",
+ new ClickListener() {
- public void buttonClick(ClickEvent event) {
- Component visible = tf;
+ public void buttonClick(ClickEvent event) {
+ Component visible = tf;
- if (tf.isVisible()) {
- visible = outerPanel;
- }
+ if (tf.isVisible()) {
+ visible = outerPanel;
+ }
- outerPanel.setVisible(false);
- tf.setVisible(false);
+ outerPanel.setVisible(false);
+ tf.setVisible(false);
- visible.setVisible(true);
- }
+ visible.setVisible(true);
+ }
- });
+ });
main.addComponent(b);
tf = new TextField("TextField");
setMainWindow(new Window());\r
setTheme("tests-tickets");\r
\r
- getMainWindow().addComponent(new Label("Defining spacing must be possible also with pure CSS"));\r
+ getMainWindow()\r
+ .addComponent(\r
+ new Label(\r
+ "Defining spacing must be possible also with pure CSS"));\r
\r
Layout gl;\r
gl = new VerticalLayout();\r
gl.addComponent(b);\r
}\r
String caption = gl.getClass().getSimpleName();\r
- caption += " style: " + gl.getStyleName() + ", spacingFromServer:" + ((SpacingHandler) gl).isSpacingEnabled();\r
+ caption += " style: " + gl.getStyleName() + ", spacingFromServer:"\r
+ + ((SpacingHandler) gl).isSpacingEnabled();\r
gl.setCaption(caption);\r
getMainWindow().addComponent(gl);\r
}\r
public class Ticket2240 extends Application {
- public static final String txt = "<p>There are two main types of windows: application-level windows, and " + "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window" + " within the (native) browser window to which it was added. You can create" + " a sub window by creating a new Window and adding it to a application-level window, for instance" + " your main window. </p><p> In contrast, you create a application-level window by" + " creating a new Window and adding it to the Application. Application-level" + " windows are not shown by default - you need to open a browser window for" + " the url representing the window. You can think of the application-level" + " windows as separate views into your application - and a way to create a" + " \"native\" browser window.</p><p>Depending on your needs, it's also" + " possible to create a new window instance (with it's own internal state)" + " for each new (native) browser window, or you can share the same instance" + " (and state) between several browser windows (the latter is most useful" + " for read-only views).</p><br/><p>This is the end.</p>";
+ public static final String txt = "<p>There are two main types of windows: application-level windows, and "
+ + "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window"
+ + " within the (native) browser window to which it was added. You can create"
+ + " a sub window by creating a new Window and adding it to a application-level window, for instance"
+ + " your main window. </p><p> In contrast, you create a application-level window by"
+ + " creating a new Window and adding it to the Application. Application-level"
+ + " windows are not shown by default - you need to open a browser window for"
+ + " the url representing the window. You can think of the application-level"
+ + " windows as separate views into your application - and a way to create a"
+ + " \"native\" browser window.</p><p>Depending on your needs, it's also"
+ + " possible to create a new window instance (with it's own internal state)"
+ + " for each new (native) browser window, or you can share the same instance"
+ + " (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() {
}
private void createUI(AbstractOrderedLayout layout) {
- Button b = new Button("Change container datasource", new ClickListener() {
+ Button b = new Button("Change container datasource",
+ new ClickListener() {
- public void buttonClick(ClickEvent event) {
- for (int i = 0; i < 5; i++) {
- t.setContainerDataSource(createContainer());
- // prop.setValue("ipsum");
- }
- }
+ public void buttonClick(ClickEvent event) {
+ for (int i = 0; i < 5; i++) {
+ t.setContainerDataSource(createContainer());
+ // prop.setValue("ipsum");
+ }
+ }
- });
+ });
layout.addComponent(b);
IndexedContainer ic = new IndexedContainer();
ic.addContainerProperty("a", String.class, null);
- for (String s : new String[] { "Lorem", "ipsum", "dolor", "sit", "amet", "consectetuer" }) {
+ for (String s : new String[] { "Lorem", "ipsum", "dolor", "sit",
+ "amet", "consectetuer" }) {
Item item = ic.addItem(s);
item.getItemProperty("a").setValue(s);
}
public void valueChange(ValueChangeEvent event) {
- System.out.println("Value change from " + tableValue + " to " + t.getValue());
+ System.out.println("Value change from " + tableValue + " to "
+ + t.getValue());
tableValue = t.getValue();
}
}
}));
- w.addComponent(new Button("new bigger item", new Button.ClickListener() {
+ w.addComponent(new Button("new bigger item",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- form.setItemDataSource(new BeanItem<MyBean>(new MyBiggerBean()));
+ public void buttonClick(ClickEvent event) {
+ form.setItemDataSource(new BeanItem<MyBean>(
+ new MyBiggerBean()));
- }
+ }
- }));
- w.addComponent(new Button("new grid layout", new Button.ClickListener() {
+ }));
+ w.addComponent(new Button("new grid layout",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- form.setLayout(new GridLayout());
+ public void buttonClick(ClickEvent event) {
+ form.setLayout(new GridLayout());
- }
+ }
- }));
- w.addComponent(new Button("new form layout", new Button.ClickListener() {
+ }));
+ w.addComponent(new Button("new form layout",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- form.setLayout(new FormLayout());
+ public void buttonClick(ClickEvent event) {
+ form.setLayout(new FormLayout());
- }
+ }
- }));
+ }));
}
vl.setWidth("500px");
vl.setHeight("500px");
vl.setStyleName("borders");
- label = new Label("<b>Error messages follows:</b><br/>", Label.CONTENT_XHTML);
+ label = new Label("<b>Error messages follows:</b><br/>",
+ Label.CONTENT_XHTML);
vl.addComponent(label);
layout.addComponent(vl);
gl.setWidth("500px");
gl.setHeight("500px");
gl.setStyleName("borders");
- label = new Label("<b>Error messages follows:</b><br/>", Label.CONTENT_XHTML);
+ label = new Label("<b>Error messages follows:</b><br/>",
+ Label.CONTENT_XHTML);
gl.addComponent(label);
layout.addComponent(gl);
for (String horiz : horizontals) {
// Test "l","r","left","right" etc
int expectedHoriz = expected.get(horiz);
- checkAlignment(layout, horiz, AlignmentHandler.ALIGNMENT_TOP | expectedHoriz);
+ checkAlignment(layout, horiz, AlignmentHandler.ALIGNMENT_TOP
+ | expectedHoriz);
for (String vert : shortVerticalAlignments) {
int expectedVert = expected.get(vert);
// Test "lt","rt" etc
if (horiz.length() == 1) {
- checkAlignment(layout, horiz + vert, expectedHoriz | expectedVert);
- checkAlignment(layout, vert + horiz, expectedHoriz | expectedVert);
+ checkAlignment(layout, horiz + vert, expectedHoriz
+ | expectedVert);
+ checkAlignment(layout, vert + horiz, expectedHoriz
+ | expectedVert);
} else {
boolean ok = false;
try {
- checkAlignment(layout, horiz + vert, expectedHoriz | expectedVert);
+ checkAlignment(layout, horiz + vert, expectedHoriz
+ | expectedVert);
} catch (IllegalArgumentException e) {
// OK, "centert","rightb" etc are not valid
ok = true;
}
if (!ok) {
- error("IllegalArgumentException was not thrown for " + horiz + vert);
+ error("IllegalArgumentException was not thrown for "
+ + horiz + vert);
}
ok = false;
try {
- checkAlignment(layout, vert + horiz, expectedHoriz | expectedVert);
+ checkAlignment(layout, vert + horiz, expectedHoriz
+ | expectedVert);
} catch (IllegalArgumentException e) {
// OK, "centert","rightb" etc are not valid
ok = true;
}
if (!ok) {
- error("IllegalArgumentException was not thrown for " + horiz + vert);
+ error("IllegalArgumentException was not thrown for "
+ + horiz + vert);
}
}
// Test "l t","r t" etc
- checkAlignment(layout, horiz + " " + vert, expectedHoriz | expectedVert);
- checkAlignment(layout, vert + " " + horiz, expectedHoriz | expectedVert);
+ checkAlignment(layout, horiz + " " + vert, expectedHoriz
+ | expectedVert);
+ checkAlignment(layout, vert + " " + horiz, expectedHoriz
+ | expectedVert);
}
for (String vert : longVerticalAlignments) {
int expectedVert = expected.get(vert);
// Test "right t","right b" etc
- checkAlignment(layout, horiz + " " + vert, expectedHoriz | expectedVert);
- checkAlignment(layout, vert + " " + horiz, expectedHoriz | expectedVert);
+ checkAlignment(layout, horiz + " " + vert, expectedHoriz
+ | expectedVert);
+ checkAlignment(layout, vert + " " + horiz, expectedHoriz
+ | expectedVert);
// Three alignments should throw an exception
boolean ok = false;
try {
- checkAlignment(layout, horiz + " " + vert + " " + horiz, expectedHoriz | expectedVert);
+ checkAlignment(layout, horiz + " " + vert + " " + horiz,
+ expectedHoriz | expectedVert);
} catch (IllegalArgumentException e) {
// OK, "centert","rightb" etc are not valid
ok = true;
}
if (!ok) {
- error("IllegalArgumentException was not thrown for " + horiz + " " + vert + " " + horiz);
+ error("IllegalArgumentException was not thrown for "
+ + horiz + " " + vert + " " + horiz);
}
}
}
- checkAlignment(layout, "left right", AlignmentHandler.ALIGNMENT_TOP | AlignmentHandler.ALIGNMENT_RIGHT);
+ checkAlignment(layout, "left right", AlignmentHandler.ALIGNMENT_TOP
+ | AlignmentHandler.ALIGNMENT_RIGHT);
}
- private void checkAlignment(AlignmentHandler layout, String alignmentString, int expected) {
- layout.setComponentAlignment(label, AlignmentInfo.Bits.ALIGNMENT_TOP, AlignmentInfo.Bits.ALIGNMENT_LEFT);
+ private void checkAlignment(AlignmentHandler layout,
+ String alignmentString, int expected) {
+ layout.setComponentAlignment(label, AlignmentInfo.Bits.ALIGNMENT_TOP,
+ AlignmentInfo.Bits.ALIGNMENT_LEFT);
if (layout instanceof AbstractOrderedLayout) {
- ((AbstractOrderedLayout) layout).setComponentAlignment(label, alignmentString);
+ ((AbstractOrderedLayout) layout).setComponentAlignment(label,
+ alignmentString);
} else {
((GridLayout) layout).setComponentAlignment(label, alignmentString);
}
int actual = layout.getComponentAlignment(label).getBitMask();
if (actual != expected) {
- String error = "Error " + alignmentString + " did not produce expected results";
+ String error = "Error " + alignmentString
+ + " did not produce expected results";
error(error);
} else {
- String str = layout.getClass().getSimpleName() + "/" + alignmentString + ": OK";
+ String str = layout.getClass().getSimpleName() + "/"
+ + alignmentString + ": OK";
System.out.println(str);
}
layout1 = new FormLayout();
layout1.setSizeUndefined();
layout1.setStyleName("borders");
- Label label = new Label("This should not be wider than this label + reserved error space");
+ Label label = new Label(
+ "This should not be wider than this label + reserved error space");
label.setCaption("A caption");
layout1.addComponent(label);
w.addComponent(layout1);
GridLayout gl = new GridLayout(2, 2);
gl.setSizeUndefined();
- gl.addComponent(new Label("Label 1 abc abc abcasdfas dfasd fasdf asdf sadf asdf"));
+ gl.addComponent(new Label(
+ "Label 1 abc abc abcasdfas dfasd fasdf asdf sadf asdf"));
gl.addComponent(new Label("Label 2 abc abc abc "));
Label l = new Label("Colspan2, align right");
gl.addComponent(l, 0, 1, 1, 1);
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
URL url = getURL();\r
- main.addComponent(new Label("Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));\r
+ main.addComponent(new Label(\r
+ "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));\r
\r
Label l = new Label();\r
l.setContentMode(Label.CONTENT_XHTML);\r
- l.setValue("This is a label with as slow image. <img src=\"" + url + "/icon.png\" />");\r
+ l.setValue("This is a label with as slow image. <img src=\"" + url\r
+ + "/icon.png\" />");\r
main.addComponent(l);\r
\r
l = new Label();\r
l.setContentMode(Label.CONTENT_XHTML);\r
- l.setValue("This is a label with as slow image. <img src=\"" + url + "/icon.png\" />");\r
+ l.setValue("This is a label with as slow image. <img src=\"" + url\r
+ + "/icon.png\" />");\r
main.addComponent(l);\r
\r
}\r
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
ExternalResource icon = new ExternalResource("./icon.png");\r
- main.addComponent(new Label("Note, run with trailing slash in url to have a working icon. Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)"));\r
+ main.addComponent(new Label(\r
+ "Note, run with trailing slash in url to have a working icon. Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)"));\r
Button b = new Button();\r
main.addComponent(b);\r
b.setIcon(icon);\r
e1.printStackTrace();\r
}\r
\r
- BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);\r
+ BufferedImage image = new BufferedImage(200, 200,\r
+ BufferedImage.TYPE_INT_RGB);\r
Graphics drawable = image.getGraphics();\r
drawable.setColor(Color.lightGray);\r
drawable.fillRect(0, 0, 200, 200);\r
ImageIO.write(image, "png", imagebuffer);\r
\r
// Return a stream from the buffer.\r
- ByteArrayInputStream istream = new ByteArrayInputStream(imagebuffer.toByteArray());\r
+ ByteArrayInputStream istream = new ByteArrayInputStream(\r
+ imagebuffer.toByteArray());\r
return new DownloadStream(istream, null, null);\r
} catch (IOException e) {\r
return null;\r
result3 = "FAILED: " + e.getMessage();
}
- label1.setValue("Result 1: " + result1 + ", result 2: " + result2 + ", result 3: " + result3);
+ label1.setValue("Result 1: " + result1 + ", result 2: " + result2
+ + ", result 3: " + result3);
}
}
\r
@Override\r
public void init() {\r
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
+ final Window main = new Window(getClass().getName().substring(\r
+ getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
URL url = getURL();\r
- main.addComponent(new Label("Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));\r
+ main.addComponent(new Label(\r
+ "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));\r
\r
try {\r
- CustomLayout cl = new CustomLayout(new ByteArrayInputStream(("This is an empty CustomLayout with as slow image. <img src=\"" + url.toString() + "/icon.png\" />").getBytes()));\r
+ CustomLayout cl = new CustomLayout(\r
+ new ByteArrayInputStream(\r
+ ("This is an empty CustomLayout with as slow image. <img src=\""\r
+ + url.toString() + "/icon.png\" />")\r
+ .getBytes()));\r
main.addComponent(cl);\r
\r
- cl = new CustomLayout(new ByteArrayInputStream(("This is an empty CustomLayout with as slow image. <img src=\"" + url.toString() + "/icon.png\" />").getBytes()));\r
+ cl = new CustomLayout(\r
+ new ByteArrayInputStream(\r
+ ("This is an empty CustomLayout with as slow image. <img src=\""\r
+ + url.toString() + "/icon.png\" />")\r
+ .getBytes()));\r
main.addComponent(cl);\r
} catch (IOException e) {\r
// TODO Auto-generated catch block\r
String customlayout = "<div location=\"test\"></div>";\r
CustomLayout cl = null;\r
try {\r
- cl = new CustomLayout(new ByteArrayInputStream(customlayout.getBytes()));\r
+ cl = new CustomLayout(new ByteArrayInputStream(\r
+ customlayout.getBytes()));\r
} catch (IOException e) {\r
// TODO Auto-generated catch block\r
e.printStackTrace();\r
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));
+ final Window main = new Window(getClass().getName().substring(
+ getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Panel p = new Panel();
main.addComponent(p);
p.setHeight("100px");
- Label l = new Label("a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n");
+ Label l = new Label(
+ "a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n");
l.setContentMode(Label.CONTENT_PREFORMATTED);
p.addComponent(l);
- main.addComponent(new Label("This text should be right below the panel, w/o spacing"));
+ main.addComponent(new Label(
+ "This text should be right below the panel, w/o spacing"));
}
}
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));
+ final Window main = new Window(getClass().getName().substring(
+ getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
- main.addComponent(new Label("Instructions: change label when panel is " + "invisible -> invalid change (with disabled " + "flag) is sent to client. Label is grey when panel is shown."));
+ main.addComponent(new Label("Instructions: change label when panel is "
+ + "invisible -> invalid change (with disabled "
+ + "flag) is sent to client. Label is grey when panel is shown."));
final Panel p = new Panel();
p.setStyleName(Reindeer.PANEL_LIGHT);
Window mainw = new Window();
setMainWindow(mainw);
- mainw.addComponent(new Label("This test has somewhat invalid layouts in it to detect analyzy layout function in debug dialog"));
+ mainw.addComponent(new Label(
+ "This test has somewhat invalid layouts in it to detect analyzy layout function in debug dialog"));
HorizontalLayout hl = new HorizontalLayout();
Panel panel = new Panel("p1");
lo.setSizeUndefined();
lo.setWidth("100%");
TextField tf = new TextField();
- tf.setValue("The textfield should fill the window." + "\n - Try to resize window\n - Try to push REdo button");
+ tf.setValue("The textfield should fill the window."
+ + "\n - Try to resize window\n - Try to push REdo button");
tf.setRows(10);
tf.setWidth("100%");
lo.addComponent(tf);
- Window subWin = new Window("This window should initially be as wide as the caption", lo);
+ Window subWin = new Window(
+ "This window should initially be as wide as the caption", lo);
main.addWindow(subWin);
// subWin.setWidth("500px");
}
}
class TestColumnGenerator implements ColumnGenerator {
- public Component generateCell(Table source, Object rowId, Object columnId) {
+ public Component generateCell(Table source, Object rowId,
+ Object columnId) {
return new Button("1");
}
}
Button b = new Button("add", new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2, gl.getCursorY());
+ gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2,
+ gl.getCursorY());
}
setMainWindow(mainWin);
try {
- CustomLayout cl = new CustomLayout(new ByteArrayInputStream("<div style=\"width:400px;overflow:hidden;background-color:red;\"><div style=\"border:1em solid blue; height:4em; padding:1em 1.5em;\" location=\"b\"></div></div>".getBytes()));
+ CustomLayout cl = new CustomLayout(
+ new ByteArrayInputStream(
+ "<div style=\"width:400px;overflow:hidden;background-color:red;\"><div style=\"border:1em solid blue; height:4em; padding:1em 1.5em;\" location=\"b\"></div></div>"
+ .getBytes()));
Button button = new Button("b");
button.setSizeFull();
t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
- mainWin.addComponent(new Label("Both rows in table should have same data (default values)"));
+ mainWin.addComponent(new Label(
+ "Both rows in table should have same data (default values)"));
mainWin.addComponent(t);
// Let's attach that one straight away too
root.addComponent(top);
- label = new Label("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor porta lacus. Nulla tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mollis turpis in mauris faucibus posuere. Nullam rutrum, nisi a fermentum tempus, lacus metus rutrum massa, a condimentum mauris justo a tortor. Mauris aliquet, ante quis ultricies posuere, sapien libero laoreet sem, a accumsan diam metus sed elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vehicula metus nec turpis dignissim cursus. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam feugiat orci eget risus. Vestibulum at sem. ");
+ label = new Label(
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor porta lacus. Nulla tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mollis turpis in mauris faucibus posuere. Nullam rutrum, nisi a fermentum tempus, lacus metus rutrum massa, a condimentum mauris justo a tortor. Mauris aliquet, ante quis ultricies posuere, sapien libero laoreet sem, a accumsan diam metus sed elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vehicula metus nec turpis dignissim cursus. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam feugiat orci eget risus. Vestibulum at sem. ");
label.setWidth("100%");
top.addComponent(label);
split = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
split.setHeight("100%");
- Embedded image = new Embedded("An image", new ExternalResource("http://dev.itmill.com/chrome/site/toolkit-logo.png"));
+ Embedded image = new Embedded("An image", new ExternalResource(
+ "http://dev.itmill.com/chrome/site/toolkit-logo.png"));
image.setWidth("100%");
root.addComponent(split);
((VerticalLayout) root.getContent()).setExpandRatio(split, 1.0f);
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
+ Button b = new Button("Button " + i\r
+ + " should be 100px or 101px high");\r
b.setHeight("100%");\r
l.addComponent(b);\r
}\r
final String content = "<select/>";
- w.addComponent(new Label("CONTENT_DEFAULT: " + content, Label.CONTENT_DEFAULT));
- w.addComponent(new Label("CONTENT_PREFORMATTED: " + content, Label.CONTENT_PREFORMATTED));
+ w.addComponent(new Label("CONTENT_DEFAULT: " + content,
+ Label.CONTENT_DEFAULT));
+ w.addComponent(new Label("CONTENT_PREFORMATTED: " + content,
+ Label.CONTENT_PREFORMATTED));
w.addComponent(new Label("CONTENT_RAW: " + content, Label.CONTENT_RAW));
w.addComponent(new Label("CONTENT_TEXT: " + content, Label.CONTENT_TEXT));
w.addComponent(new Label("CONTENT_XML: " + content, Label.CONTENT_XML));
- w.addComponent(new Label("CONTENT_XHTML: " + content, Label.CONTENT_XHTML));
+ w.addComponent(new Label("CONTENT_XHTML: " + content,
+ Label.CONTENT_XHTML));
}
Window w = new Window();
setMainWindow(w);
- Label help = new Label("Use CTRL X to fire action, CTRL C to remove it (fails before fix)");
+ Label help = new Label(
+ "Use CTRL X to fire action, CTRL C to remove it (fails before fix)");
w.addComponent(help);
w.addActionHandler(new Handler() {
- final ShortcutAction a1 = new ShortcutAction("action", KeyCode.X, new int[] { ModifierKey.CTRL });
- final ShortcutAction a2 = new ShortcutAction("action", KeyCode.C, new int[] { ModifierKey.CTRL });
+ final ShortcutAction a1 = new ShortcutAction("action", KeyCode.X,
+ new int[] { ModifierKey.CTRL });
+ final ShortcutAction a2 = new ShortcutAction("action", KeyCode.C,
+ new int[] { ModifierKey.CTRL });
Action[] actions = new Action[] { a1, a2 };
}
- private static Alignment[] alignments = new Alignment[] { Alignment.TOP_LEFT, Alignment.TOP_CENTER, Alignment.TOP_RIGHT, Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER, Alignment.MIDDLE_RIGHT, Alignment.BOTTOM_LEFT, Alignment.BOTTOM_CENTER, Alignment.BOTTOM_RIGHT };
+ private static Alignment[] alignments = new Alignment[] {
+ Alignment.TOP_LEFT, Alignment.TOP_CENTER, Alignment.TOP_RIGHT,
+ Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER,
+ Alignment.MIDDLE_RIGHT, Alignment.BOTTOM_LEFT,
+ Alignment.BOTTOM_CENTER, Alignment.BOTTOM_RIGHT };
private void populateLayout(Layout layout) {
layout.setSizeFull();
for (int i = 0; i < 9; i++) {
Label l = new Label("M");
Alignment a = alignments[i];
- l.setCaption(a.getHorizontalAlignment() + " " + a.getVerticalAlignment() + " " + a.getBitMask());
+ l.setCaption(a.getHorizontalAlignment() + " "
+ + a.getVerticalAlignment() + " " + a.getBitMask());
layout.addComponent(l);
((AlignmentHandler) layout).setComponentAlignment(l, a);
}
setMainWindow(w);
- Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 50);
+ Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3,
+ 50);
t.setPageLength(0);
public void init() {
final Window main = new MainWindow();
setMainWindow(main);
- main.addComponent(new Label("Clicking the link should open a new window that should receive the URI 'msg/hello' and add that a a Label to it's ui. Currently the Label ends up in this (main) window (try reloading). Console intentionally spams during the window finding/uri handling - looks, uhm, interesting."));
+ main.addComponent(new Label(
+ "Clicking the link should open a new window that should receive the URI 'msg/hello' and add that a a Label to it's ui. Currently the Label ends up in this (main) window (try reloading). Console intentionally spams during the window finding/uri handling - looks, uhm, interesting."));
}
@Override
public Window getWindow(String name) {
System.err.println("Looking for " + name);
if ("msg".equals(name)) {
- System.err.println(" rest uri, returning new MainWindow with message from uri");
+ System.err
+ .println(" rest uri, returning new MainWindow with message from uri");
MainWindow restWindow = new MainWindow();
addWindow(restWindow);
return restWindow;
public MainWindow() {
super("Main window");
- addComponent(new Link("new mainwin", new ExternalResource(Ticket2440.this.getURL() + "msg/hello"), "_blank", -1, -1, Window.BORDER_DEFAULT));
+ addComponent(new Link("new mainwin", new ExternalResource(
+ Ticket2440.this.getURL() + "msg/hello"), "_blank", -1, -1,
+ Window.BORDER_DEFAULT));
addURIHandler(new URIHandler() {
public DownloadStream handleURI(URL context, String relativeUri) {
- System.err.println((getMainWindow() == getWindow() ? "mainwin: " : "subwin: ") + context + ", " + relativeUri);
+ System.err
+ .println((getMainWindow() == getWindow() ? "mainwin: "
+ : "subwin: ")
+ + context + ", " + relativeUri);
addComponent(new Label(relativeUri));
return null;
}
}\r
\r
@Override\r
- public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {\r
+ public Field createField(Container container, Object itemId,\r
+ Object propertyId, Component uiContext) {\r
\r
/*\r
* trainingType is manyToOne relation, give it a combobox\r
return getSecondaryTypesList(itemId);\r
}\r
\r
- final Field f = super.createField(container, itemId, propertyId, uiContext);\r
+ final Field f = super.createField(container, itemId, propertyId,\r
+ uiContext);\r
if (f != null) {\r
if (f instanceof TextField) {\r
TextField tf = (TextField) f;\r
float f = Float.parseFloat((String) value);\r
return true;\r
} catch (Exception e) {\r
- f.getWindow().showNotification("Bad number value");\r
+ f.getWindow().showNotification(\r
+ "Bad number value");\r
f.setValue(0);\r
return false;\r
}\r
}\r
\r
- public void validate(Object value) throws InvalidValueException {\r
+ public void validate(Object value)\r
+ throws InvalidValueException {\r
// TODO Auto-generated method stub\r
\r
}\r
c.set(Calendar.SECOND, 0);\r
c.set(Calendar.MINUTE, 0);\r
\r
- String[] titles = new String[] { "A short easy one", "intervals", "very long", "just shaking legs after work", "long one with Paul", "test run" };\r
+ String[] titles = new String[] { "A short easy one", "intervals",\r
+ "very long", "just shaking legs after work",\r
+ "long one with Paul", "test run" };\r
\r
c.add(Calendar.DATE, -1000);\r
\r
\r
for (int i = 0; i < 1000; i++) {\r
r = new Workout();\r
- c.set(Calendar.HOUR_OF_DAY, 12 + (rnd.nextInt(11) - rnd.nextInt(11)));\r
+ c.set(Calendar.HOUR_OF_DAY,\r
+ 12 + (rnd.nextInt(11) - rnd.nextInt(11)));\r
r.setDate(c.getTime());\r
r.setTitle(titles[rnd.nextInt(titles.length)]);\r
r.setKilometers(Math.round(rnd.nextFloat() * 30));\r
table.setWidth("200px");\r
mainWindow.addComponent(table);\r
\r
- Button clearButton = new Button("Clear selection", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- clearSelection();\r
- }\r
- });\r
+ Button clearButton = new Button("Clear selection",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ clearSelection();\r
+ }\r
+ });\r
mainWindow.addComponent(clearButton);\r
- Button clearButton2 = new Button("Clear selection 2", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- clearSelection2();\r
- }\r
- });\r
+ Button clearButton2 = new Button("Clear selection 2",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ clearSelection2();\r
+ }\r
+ });\r
mainWindow.addComponent(clearButton2);\r
- Button clearButton3 = new Button("Clear selection 3", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- clearSelection3();\r
- }\r
- });\r
+ Button clearButton3 = new Button("Clear selection 3",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ clearSelection3();\r
+ }\r
+ });\r
mainWindow.addComponent(clearButton3);\r
- Button printButton = new Button("Print selection", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- printSelection();\r
- }\r
- });\r
+ Button printButton = new Button("Print selection",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ printSelection();\r
+ }\r
+ });\r
mainWindow.addComponent(printButton);\r
\r
result = new TextField();\r
reader.addListener(new UriFragmentUtility.FragmentChangedListener() {
public void fragmentChanged(FragmentChangedEvent event) {
- getMainWindow().showNotification("Fragment now: " + event.getUriFragmentUtility().getFragment());
+ getMainWindow().showNotification(
+ "Fragment now: "
+ + event.getUriFragmentUtility().getFragment());
// try to change to view mapped by fragment string
setView(event.getUriFragmentUtility().getFragment());
}
mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
- final Window mainWin = new Window("Test app for URI fragment management/reading", mainLayout);
+ final Window mainWin = new Window(
+ "Test app for URI fragment management/reading", mainLayout);
setMainWindow(mainWin);
// UriFragmentReader is 0px size by default, so it will not render
private void setView(String string) {
Component component = views.get(string);
if (component == null) {
- getMainWindow().showNotification("View called " + string + " not found!");
+ getMainWindow().showNotification(
+ "View called " + string + " not found!");
} else if (component != currentView) {
if (currentView != null) {
mainLayout.replaceComponent(currentView, component);
Panel p = new Panel(string);
p.setSizeFull();
((VerticalLayout) p.getContent()).setSpacing(true);
- p.addComponent(new Label("This is a simple test case for " + "UriFragmentReader that can be used for" + " adding linking, back/forward button " + "and history support for ajax application. "));
+ p.addComponent(new Label("This is a simple test case for "
+ + "UriFragmentReader that can be used for"
+ + " adding linking, back/forward button "
+ + "and history support for ajax application. "));
StringBuffer sb = new StringBuffer();
sb.append("Available views : ");
for (String key : strings) {
sb.append(key);
sb.append(" ");
}
- sb.append("Application will change to them from uri " + "fragment or server initiated via textfield below.");
+ sb.append("Application will change to them from uri "
+ + "fragment or server initiated via textfield below.");
p.addComponent(new Label(sb.toString()));
- final TextField tf = new TextField("Type view name (will change to that " + "view and change the uri fragment)");
+ final TextField tf = new TextField(
+ "Type view name (will change to that "
+ + "view and change the uri fragment)");
p.addComponent(tf);
Button b = new Button("Go!");
p.addComponent(b);
\r
public class Ticket677 extends Application {\r
\r
- private static final Label info = new Label("<li> keep debug window open to see variable changes" + "<li> disable root panel w/ toggle button" + "<li> toggle one of the subpanels" + "<li> we attempt to focus the subpanels first textfield" + "<li> focusing should fail (try tabbing as well) [worked previousy]" + "<li> no variable changes should be sent from disabled fields [changed sent previously]" + "<li> try further toggling and tabbing around", Label.CONTENT_RAW);\r
+ private static final Label info = new Label(\r
+ "<li> keep debug window open to see variable changes"\r
+ + "<li> disable root panel w/ toggle button"\r
+ + "<li> toggle one of the subpanels"\r
+ + "<li> we attempt to focus the subpanels first textfield"\r
+ + "<li> focusing should fail (try tabbing as well) [worked previousy]"\r
+ + "<li> no variable changes should be sent from disabled fields [changed sent previously]"\r
+ + "<li> try further toggling and tabbing around",\r
+ Label.CONTENT_RAW);\r
\r
Panel root = new Panel("Enabled");\r
Panel one = new Panel("Enabled");\r
HorizontalLayout l = new HorizontalLayout();\r
main.addComponent(l);\r
\r
- l.addComponent(new Button("Toggle root panel", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- toggle(root);\r
- }\r
- }));\r
- l.addComponent(new Button("Toggle panel one", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- toggle(one);\r
- }\r
- }));\r
- l.addComponent(new Button("Toggle panel two", new Button.ClickListener() {\r
- public void buttonClick(ClickEvent event) {\r
- toggle(two);\r
- }\r
- }));\r
+ l.addComponent(new Button("Toggle root panel",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ toggle(root);\r
+ }\r
+ }));\r
+ l.addComponent(new Button("Toggle panel one",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ toggle(one);\r
+ }\r
+ }));\r
+ l.addComponent(new Button("Toggle panel two",\r
+ new Button.ClickListener() {\r
+ public void buttonClick(ClickEvent event) {\r
+ toggle(two);\r
+ }\r
+ }));\r
l.addComponent(new Button("Toggle form", new Button.ClickListener() {\r
public void buttonClick(ClickEvent event) {\r
toggle(form);\r
form.setFieldFactory(new BaseFieldFactory() {\r
\r
@Override\r
- public Field createField(Item item, Object propertyId, Component uiContext) {\r
+ public Field createField(Item item, Object propertyId,\r
+ Component uiContext) {\r
Field f = super.createField(item, propertyId, uiContext);\r
f.setEnabled(!"disabled".equals(propertyId));\r
return f;\r
table.setFieldFactory(new BaseFieldFactory() {\r
\r
@Override\r
- public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {\r
- Field f = super.createField(container, itemId, propertyId, uiContext);\r
+ public Field createField(Container container, Object itemId,\r
+ Object propertyId, Component uiContext) {\r
+ Field f = super.createField(container, itemId, propertyId,\r
+ uiContext);\r
Item item = container.getItem(itemId);\r
Property p = item.getItemProperty(propertyId);\r
if ("disabled".equals(p.getValue())) {\r
c.setEnabled(enable);\r
c.setCaption((enable ? "Enabled" : "Disabled"));\r
if (c instanceof ComponentContainer) {\r
- TextField tf = (TextField) ((ComponentContainer) c).getComponentIterator().next();\r
+ TextField tf = (TextField) ((ComponentContainer) c)\r
+ .getComponentIterator().next();\r
tf.focus();\r
}\r
}\r
ObjectOutputStream oos = new ObjectOutputStream(buffer);
long t = System.currentTimeMillis();
oos.writeObject(getContext());
- w.showNotification("ApplicationContext serialized (" + buffer.size() + "bytes) in " + (System.currentTimeMillis() - t) + "ms");
+ w.showNotification("ApplicationContext serialized ("
+ + buffer.size() + "bytes) in "
+ + (System.currentTimeMillis() - t) + "ms");
} catch (IOException e) {
e.printStackTrace();
w.showNotification("ApplicationContext serialization failed - see console for stacktrace");
// Create form for editing address
final Form f = new Form();
- f.setItemDataSource(new BeanItem<Address>(address, new String[] { "name", "street", "zip", "city", "state", "country" }));
+ f.setItemDataSource(new BeanItem<Address>(address, new String[] {
+ "name", "street", "zip", "city", "state", "country" }));
f.setCaption("Office address");
f.setIcon(new ThemeResource("../runo/icons/16/document.png"));
f.setDescription("Jep jpe, this is form description.");
// Add some validators for the form
f.getField("zip").addValidator(new IsInteger());
f.getField("zip").setDescription("Jepjep");
- ((AbstractComponent) f.getField("zip")).setIcon(new ThemeResource("../runo/icons/16/folder.png"));
+ ((AbstractComponent) f.getField("zip")).setIcon(new ThemeResource(
+ "../runo/icons/16/folder.png"));
f.getField("state").addValidator(new IsValidState());
f.getField("name").setRequired(true);
f.getField("street").setRequired(true);
// Debug form properties
final Panel formProperties = new Panel("Form properties");
formProperties.setWidth("200px");
- final String[] visibleProps = { "required", "invalidAllowed", "readOnly", "readThrough", "writeThrough", "invalidCommitted", "validationVisible", "immediate" };
+ final String[] visibleProps = { "required", "invalidAllowed",
+ "readOnly", "readThrough", "writeThrough", "invalidCommitted",
+ "validationVisible", "immediate" };
for (int i = 0; i < visibleProps.length; i++) {
- Button b = new Button(visibleProps[i], new MethodProperty<Boolean>(f, visibleProps[i]));
+ Button b = new Button(visibleProps[i], new MethodProperty<Boolean>(
+ f, visibleProps[i]));
b.setImmediate(true);
formProperties.addComponent(b);
}
mainWin.addComponent(formProperties);
// Debug the internal state of the address-object
- mainWin.addComponent(new Button("Show state of the address object", new Button.ClickListener() {
+ mainWin.addComponent(new Button("Show state of the address object",
+ new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- mainWin.showNotification(address.toString());
- }
- }));
+ public void buttonClick(ClickEvent event) {
+ mainWin.showNotification(address.toString());
+ }
+ }));
}
/** Address pojo. */
@Override
public String toString() {
- return name + "; " + street + "; " + city + " " + zip + (state != null ? " " + state : "") + " " + country;
+ return name + "; " + street + "; " + city + " " + zip
+ + (state != null ? " " + state : "") + " " + country;
}
}
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
- throw new InvalidValueException("'" + value + "' is not a number");
+ throw new InvalidValueException("'" + value
+ + "' is not a number");
}
}
}
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
- throw new InvalidValueException("State must be either two capital letter abreviation or left empty");
+ throw new InvalidValueException(
+ "State must be either two capital letter abreviation or left empty");
}
}
}
}
});
- final String[] visibleProps = { "required", "invalidAllowed", "readOnly", "readThrough", "invalidCommitted", "validationVisible" };
+ final String[] visibleProps = { "required", "invalidAllowed",
+ "readOnly", "readThrough", "invalidCommitted",
+ "validationVisible" };
for (int i = 0; i < visibleProps.length; i++) {
- Button b = new Button(visibleProps[i], new MethodProperty<Boolean>(tx, visibleProps[i]));
+ Button b = new Button(visibleProps[i], new MethodProperty<Boolean>(
+ tx, visibleProps[i]));
b.setImmediate(true);
mainWin.addComponent(b);
}
// tx.setIcon(new ThemeResource("icons/16/folder.png"));
- mainWin.addComponent(new Button("Validate integer", new Button.ClickListener() {
- public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
- mainWin.showNotification("The field is " + (tx.isValid() ? "" : "not ") + "valid");
- };
- }));
- TextField caption = new TextField("Caption", new MethodProperty<String>(tx, "caption"));
+ mainWin.addComponent(new Button("Validate integer",
+ new Button.ClickListener() {
+ public void buttonClick(
+ com.vaadin.ui.Button.ClickEvent event) {
+ mainWin.showNotification("The field is "
+ + (tx.isValid() ? "" : "not ") + "valid");
+ };
+ }));
+ TextField caption = new TextField("Caption",
+ new MethodProperty<String>(tx, "caption"));
caption.setImmediate(true);
mainWin.addComponent(caption);
}
final Window mainWin = new Window("Test app for max length feature");
setMainWindow(mainWin);
- final TextField tx = new TextField("Textfield with maxlenght 10, single row");
+ final TextField tx = new TextField(
+ "Textfield with maxlenght 10, single row");
tx.setImmediate(true);
tx.setMaxLength(10);
b.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- l.setValue("Length: " + tx.getValue().toString().length() + " Content: " + tx.getValue());
+ l.setValue("Length: " + tx.getValue().toString().length()
+ + " Content: " + tx.getValue());
}
});
mainWin.addComponent(tx);
mainWin.addComponent(b);
- final TextField tx2 = new TextField("Textfield with maxlenght 10, multirow ");
+ final TextField tx2 = new TextField(
+ "Textfield with maxlenght 10, multirow ");
mainWin.addComponent(tx2);
tx2.setImmediate(true);
tx2.setRows(5);
b2.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- l.setValue("Length: " + tx2.getValue().toString().length() + " Content: " + tx2.getValue());
+ l.setValue("Length: " + tx2.getValue().toString().length()
+ + " Content: " + tx2.getValue());
}
});
b = new Button("Check value");
b.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- l.setValue("Length: " + rta.getValue().toString().length() + " Content: " + rta.getValue());
+ l.setValue("Length: " + rta.getValue().toString().length()
+ + " Content: " + rta.getValue());
}
});
case 0:
result = new HorizontalLayout();
- ((HorizontalLayout) result).setCaption("OrderedLayout_horizontal_" + caption);
+ ((HorizontalLayout) result).setCaption("OrderedLayout_horizontal_"
+ + caption);
break;
case 1:
result = new VerticalLayout();
- ((VerticalLayout) result).setCaption("OrderedLayout_vertical_" + caption);
+ ((VerticalLayout) result).setCaption("OrderedLayout_vertical_"
+ + caption);
break;
case 2:
GridLayout gl;
if (seededRandom.nextInt(1) > 0) {
gl = new GridLayout();
} else {
- gl = new GridLayout(seededRandom.nextInt(3) + 1, seededRandom.nextInt(3) + 1);
+ gl = new GridLayout(seededRandom.nextInt(3) + 1,
+ seededRandom.nextInt(3) + 1);
}
gl.setCaption("GridLayout_" + caption);
gl.setDescription(gl.getCaption());
// Link
result = new Panel();
result.setCaption("Panel component " + caption);
- ((Panel) result).addComponent(new Label("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." + " Panel contains an layout where the actual contained components are added, " + "this layout may be switched on the fly."));
+ ((Panel) result)
+ .addComponent(new Label(
+ "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."
+ + " Panel contains an layout where the actual contained components are added, "
+ + "this layout may be switched on the fly."));
((Panel) result).setWidth(250);
break;
case 6:
case 11:
result = new VerticalLayout();
// TODO: disabled gwt bug with mixed up iframe's
- ((VerticalLayout) result).addComponent(new EmbeddedBrowserExample());
+ ((VerticalLayout) result)
+ .addComponent(new EmbeddedBrowserExample());
break;
case 12:
result = new VerticalLayout();
break;
case 22:
result = new VerticalLayout();
- ((VerticalLayout) result).addComponent(new StressComponentsInTable());
+ ((VerticalLayout) result)
+ .addComponent(new StressComponentsInTable());
break;
}
return em;
}
- public class MultiListener implements Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener, ValueChangeListener {
+ public class MultiListener implements Button.ClickListener,
+ PropertySetChangeListener, ItemSetChangeListener,
+ ValueChangeListener {
public void buttonClick(ClickEvent event) {
- System.out.println("ClickEvent from " + event.getButton().getCaption());
+ System.out.println("ClickEvent from "
+ + event.getButton().getCaption());
}
public void containerPropertySetChange(PropertySetChangeEvent event) {
- System.out.println("containerPropertySetChange from " + event.getContainer());
+ System.out.println("containerPropertySetChange from "
+ + event.getContainer());
}
public void containerItemSetChange(ItemSetChangeEvent event) {
- System.out.println("containerItemSetChange from " + event.getContainer());
+ System.out.println("containerItemSetChange from "
+ + event.getContainer());
}
public void valueChange(ValueChangeEvent event) {