/**
* Helper for tt initialization
*/
- @SuppressWarnings("unused")
private JavaScriptObject getVersionInfo() {
return configuration.getVersionInfoJSObject();
}
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;
/**
* A helper class to implement keyboard shorcut handling. Keeps a list of owners
import com.vaadin.external.org.apache.commons.fileupload.portlet.PortletFileUpload;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.Terminal;
+import com.vaadin.terminal.gwt.client.ApplicationConfiguration;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.ui.Window;
/**
try {
final Application app = (Application) c.newInstance();
app.init();
- Layout lo = app.getMainWindow().getLayout();
+ Layout lo = (Layout) app.getMainWindow().getContent();
lo.setParent(null);
return lo;
} catch (final Exception e) {
import com.vaadin.ui.Table;\r
import com.vaadin.ui.Tree;\r
import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.themes.Reindeer;\r
\r
/**\r
* @author marc\r
buttons.addComponent(b);\r
\r
Panel p = new Panel("Tree");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
+ p.setStyleName(Reindeer.PANEL_LIGHT);\r
h.addComponent(p);\r
Tree tree = new Tree("ITEM_CAPTION_MODE_PROPERTY");\r
tree.setContainerDataSource(ordered);\r
p.addComponent(tree);\r
\r
p = new Panel("ComboBox");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
+ p.setStyleName(Reindeer.PANEL_LIGHT);\r
h.addComponent(p);\r
ComboBox c = new ComboBox("ITEM_CAPTION_MODE_PROPERTY");\r
c.setImmediate(true);\r
p.addComponent(c);\r
\r
p = new Panel("ListBox");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
+ p.setStyleName(Reindeer.PANEL_LIGHT);\r
h.addComponent(p);\r
ListSelect l = new ListSelect("ITEM_CAPTION_MODE_PROPERTY");\r
l.setContainerDataSource(cont);\r
import com.vaadin.ui.TabSheet;\r
import com.vaadin.ui.Table;\r
import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.themes.Reindeer;\r
\r
public class TestForBasicApplicationLayout extends CustomComponent {\r
\r
cal.setLocale(new Locale("en", "US"));\r
report.addComponent(cal);\r
((VerticalLayout) report.getContent()).setExpandRatio(controls, 1);\r
- report.addStyleName(Panel.STYLE_LIGHT);\r
+ report.addStyleName(Reindeer.PANEL_LIGHT);\r
report.setHeight(100, SplitPanel.UNITS_PERCENTAGE);\r
\r
sp2.setFirstComponent(report);\r
import com.vaadin.ui.Label;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.OptionGroup;
-import com.vaadin.ui.OrderedLayout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Tree;
import com.vaadin.ui.TwinColSelect;
package com.vaadin.tests.components.form;
import com.vaadin.Application;
+import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
hl.setWidth("100%");
Button b = new Button("right aligned");
hl.addComponent(b);
- hl.setComponentAlignment(b, "r");
+ hl.setComponentAlignment(b, Alignment.TOP_RIGHT);
f.setFooter(hl);
}
}
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Table;
+import com.vaadin.ui.themes.BaseTheme;
public class TableRowHeight2 extends TestBase {
Button b = new Button();
b.setWidth("100%");
- b.setStyleName(Button.STYLE_LINK);
+ b.setStyleName(BaseTheme.BUTTON_LINK);
b.addStyleName("nowraplink");
b.setCaption("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper, elit quis elementum iaculis, dui est rutrum risus, at cursus sem leo eget arcu. Proin vel eros ut tortor luctus pretium. Nulla facilisi. Donec in dui. Proin ac diam vitae massa tempus faucibus. Fusce eu risus. Nunc ac risus. Cras libero.");
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Table;
+import com.vaadin.ui.themes.BaseTheme;
public class TableRowHeight3 extends TestBase {
Button b = new Button();
b.setWidth("100%");
- b.setStyleName(Button.STYLE_LINK);
+ b.setStyleName(BaseTheme.BUTTON_LINK);
b.addStyleName("nowraplink");
if (i < 2) {
b.setCaption("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper, elit quis elementum iaculis, dui est rutrum risus, at cursus sem leo eget arcu. Proin vel eros ut tortor luctus pretium. Nulla facilisi. Donec in dui. Proin ac diam vitae massa tempus faucibus. Fusce eu risus. Nunc ac risus. Cras libero.");
\r
panel1 = new Panel("Panel initial caption (should also be tab caption)");\r
panel1.setSizeFull();\r
- panel1.getLayout().setSizeFull();\r
+ panel1.getContent().setSizeFull();\r
panel1.addComponent(new Label("This is a panel"));\r
tabSheet.addTab(panel1);\r
\r
protected void setup() {
Window centered = new Window("A window");
centered.setSizeUndefined();
- centered.getLayout().setSizeFull();
+ centered.getContent().setSizeFull();
centered.center();
Label l = new Label("This window should be centered");
@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());
}
});
super("Subwindow");
setWidth("400px");
- Layout hl = getLayout();
+ Layout hl = (Layout) getContent();
hl.addComponent(new Label("Current size: "));
hl.addComponent(sizeLabel);
}
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()]);
}
}
import com.vaadin.ui.Field;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Layout;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Select;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.Reindeer;
public class PropertyPanel extends Panel implements Button.ClickListener, Property.ValueChangeListener {
/** Contruct new property panel for configuring given object. */
public PropertyPanel(Object objectToConfigure) {
super();
- getLayout().setMargin(false);
+ ((Layout) getContent()).setMargin(false);
// Layout
setCaption("Properties");
// Create new panel containing the form
final Panel p = new Panel();
p.setCaption(propertySetCaption);
- p.setStyleName(Panel.STYLE_LIGHT);
+ p.setStyleName(Reindeer.PANEL_LIGHT);
p.addComponent(properties);
formsLayout.addComponent(p);
protected void setup() {\r
Layout main = getLayout();\r
main.setSizeUndefined();\r
- getMainWindow().getLayout().setHeight(null);\r
+ getMainWindow().getContent().setHeight(null);\r
\r
Label l = new Label(\r
"This is a nice game to guess how many Layouts your FF2 (or any other browser) can deal with. Due to the worldwide attempt to decrease energy consumption, playing this game is only allowed above 60° longitude betwheen August and May (as excess energy consumed by you CPU is used to heat your room). It is considered wise to save all your work before starting the game.");\r
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
public class GridLayoutInsidePanel extends TestBase {
{
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");
- p.getLayout().setMargin(false);
+ ((Layout) p.getContent()).setMargin(false);
p.setSizeUndefined();
- p.getLayout().setSizeUndefined();
+ p.getContent().setSizeUndefined();
p.addComponent(gl);
addComponent(p);
{
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);
- p.getLayout().setMargin(false);
+ ((Layout) p.getContent()).setMargin(false);
p.setSizeUndefined();
- p.getLayout().setSizeUndefined();
+ p.getContent().setSizeUndefined();
addComponent(p);
}
public void init() {
Window w = new Window("Main");
setMainWindow(w);
- layout = w.getLayout();
+ layout = (Layout) w.getContent();
GridLayout gl = new GridLayout(1, 1);
gl.setSizeUndefined();
Label l = new Label("This should be visible");
import com.vaadin.ui.HorizontalLayout;\r
import com.vaadin.ui.Label;\r
import com.vaadin.ui.Layout;\r
-import com.vaadin.ui.Layout.AlignmentHandler;\r
import com.vaadin.ui.Panel;\r
import com.vaadin.ui.Select;\r
import com.vaadin.ui.TextField;\r
public class OrderedLayoutBasics extends TestBase {\r
\r
String valignName[] = new String[] { "top", "middle", "bottom" };\r
- int valign[] = new int[] { AlignmentHandler.ALIGNMENT_TOP, AlignmentHandler.ALIGNMENT_VERTICAL_CENTER, AlignmentHandler.ALIGNMENT_BOTTOM };\r
\r
Set<AbstractOrderedLayout> layouts = new HashSet<AbstractOrderedLayout>();\r
private AbstractOrderedLayout layoutContainer;\r
\r
@Override\r
public void setup() {\r
- getMainWindow().getLayout().setHeight(null);\r
+ getMainWindow().getContent().setHeight(null);\r
\r
layoutContainer = new VerticalLayout();\r
createUI(layoutContainer);\r
\r
/* LAYOUTS */\r
\r
+ @SuppressWarnings("unused")\r
private Layout layout1() {\r
HorizontalLayout ol = new HorizontalLayout();\r
ol.setHeight("200px");\r
\r
}\r
\r
+ @SuppressWarnings("unused")\r
private Layout layout2() {\r
HorizontalLayout ol = new HorizontalLayout();\r
ol.setHeight("70px");\r
return ol;\r
}\r
\r
+ @SuppressWarnings("unused")\r
private Layout layout3() {\r
HorizontalLayout ol = new HorizontalLayout();\r
ol.setHeight("");\r
return ol;\r
}\r
\r
+ @SuppressWarnings("unused")\r
private Layout layout3New() {\r
HorizontalLayout ol = new HorizontalLayout();\r
ol.setHeight("300px");\r
return ol;\r
}\r
\r
+ @SuppressWarnings("unused")\r
private Layout layout4(AbstractOrderedLayout ol) {\r
// ol.setHeight("300px");\r
// ol.setWidth("500px");\r
tf.setWidth(w + "px");\r
tf.setHeight(w + "px");\r
ol.addComponent(tf);\r
- ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_LEFT, valign[i % 3]);\r
+ if (i % 3 == 0) {\r
+ ol.setComponentAlignment(tf, Alignment.TOP_LEFT);\r
+ } else if (i % 3 == 1) {\r
+ ol.setComponentAlignment(tf, Alignment.MIDDLE_LEFT);\r
+ } else {\r
+ ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);\r
+ }\r
\r
}\r
\r
ol.addComponent(tf);\r
ol.setComponentAlignment(tf, Alignment.TOP_LEFT);\r
\r
- Button b;\r
+ // Button b;\r
// b = new Button("This is a 100%x50% valign middle button");\r
// b.setSizeFull();\r
// b.setHeight("50%");\r
tf.setRequired(true);\r
ol.addComponent(tf);\r
ol.setExpandRatio(tf, 1f);\r
- ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_LEFT, AlignmentHandler.ALIGNMENT_VERTICAL_CENTER);\r
+ ol.setComponentAlignment(tf, Alignment.MIDDLE_LEFT);\r
// tf.setComponentError(new UserError("It's broken!"));\r
\r
// tf.setHeight("100%");\r
return ol;\r
}\r
\r
+ @SuppressWarnings("unused")\r
private Layout layout_pctFilled2(AbstractOrderedLayout ol) {\r
ol.setHeight("600px");\r
ol.setWidth("600px");\r
componentChooser.addListener(new Button.ClickListener() {\r
public void buttonClick(ClickEvent event) {\r
final Window chooser = new Window("Choose component");\r
- chooser.getLayout().setSizeUndefined();\r
+ chooser.getContent().setSizeUndefined();\r
chooser.setModal(true);\r
\r
NativeSelect select = new NativeSelect(\r
public void buttonClick(ClickEvent event) {\r
final Window chooser = new Window(\r
"Choose component type to add");\r
- chooser.getLayout().setSizeUndefined();\r
+ chooser.getContent().setSizeUndefined();\r
chooser.setModal(true);\r
\r
NativeSelect select = new NativeSelect(\r
@Override\r
protected void setup() {\r
getLayout().setSizeUndefined();\r
- getMainWindow().getLayout().setHeight(null);\r
+ getMainWindow().getContent().setHeight(null);\r
\r
Label l = new Label(\r
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc condimentum urna quis leo. In hac habitasse platea dictumst. Pellentesque tincidunt. Sed libero nisl, faucibus in, laoreet pellentesque, consectetur non, dolor. Sed tortor. Ut pretium sapien. Cras elementum enim non lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla velit est, aliquam a, pellentesque a, iaculis nec, sapien. Ut ultrices ligula vitae nulla. Morbi sem pede, iaculis ac, condimentum a, ornare eget, nisi. Aliquam hendrerit pulvinar massa. Vestibulum pretium purus eu augue. Sed posuere elit ut magna. Cras consequat faucibus nunc. Vestibulum quis diam.");\r
create = null;
label = null;
stressLayout = null;
- System.out.println("main.getLayout()=" + main.getLayout());
+ System.out.println("main.getLayout()=" + main.getContent());
System.out.println(getMemoryStatistics());
} else if (event.getButton() == close) {
System.out.println("Before close, memory statistics:");
import com.vaadin.ui.AbstractSelect;\r
import com.vaadin.ui.CustomComponent;\r
import com.vaadin.ui.Label;\r
-import com.vaadin.ui.Panel;\r
import com.vaadin.ui.TextField;\r
import com.vaadin.ui.Tree;\r
import com.vaadin.ui.VerticalLayout;\r
import com.vaadin.ui.Window;\r
+import com.vaadin.ui.themes.Reindeer;\r
\r
public class Ticket1245 extends com.vaadin.Application {\r
\r
setCompositionRoot(main);\r
\r
// Panel w/ Tree\r
- main.setStyleName(Panel.STYLE_LIGHT);\r
+ main.setStyleName(Reindeer.PANEL_LIGHT);\r
main.setWidth(200);\r
// // Description, this is needed. Works in first slot\r
main.addComponent(new Label(desc));\r
setUser(username);
currentUser.setValue(username);
currentUser.getWindow().showNotification("Logged in user: " + username);
- getMainWindow().getLayout().replaceComponent(loginBox, mainPanel);
+ getMainWindow().getContent().replaceComponent(loginBox, mainPanel);
el.setExpandRatio(mainPanel, 1);
} else {
getMainWindow().showNotification("Wrong password. Hint, try '1234' ", Notification.TYPE_WARNING_MESSAGE);
final Window mainWin = new Window("ButtonPanel containing a table test");
setMainWindow(mainWin);
- ((AbstractOrderedLayout) mainWin.getLayout()).setSpacing(true);
+ ((AbstractOrderedLayout) mainWin.getContent()).setSpacing(true);
ButtonPanel dataCardView1 = buildButtonPanel("My Tickets");
ButtonPanel dataCardView2 = buildButtonPanel("My Tickets 2");
private void initContainer() {
container.setStyleName("custompanel");
container.setSizeFull();
- container.getLayout().setMargin(false);
- container.getLayout().setSizeFull();
+ ((Layout) container.getContent()).setMargin(false);
+ container.getContent().setSizeFull();
root.addComponent(container);
- root.setExpandRatio(container,1);
+ root.setExpandRatio(container, 1);
}
public void setHeight(int height, int unit) {
import com.vaadin.ui.Button;\r
import com.vaadin.ui.GridLayout;\r
import com.vaadin.ui.Label;\r
+import com.vaadin.ui.Layout;\r
import com.vaadin.ui.TextField;\r
import com.vaadin.ui.Window;\r
\r
public void init() {\r
final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
- main.getLayout().setMargin(false);\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
main.addComponent(description);\r
p.setWidth(w);\r
p.setHeight(h);\r
\r
- p.getLayout().setSizeFull();\r
+ p.getContent().setSizeFull();\r
\r
parentLayout.addComponent(p);\r
p.addComponent(form);\r
// p.addComponent(gl);\r
\r
// w.getLayout().addComponent(p);\r
- createUI(w.getLayout());\r
+ createUI((Layout) w.getContent());\r
}\r
\r
private void createUI(Layout layout) {\r
Panel p = new Panel("GridLayout");\r
p.setWidth(500);\r
p.setHeight(500);\r
- p.getLayout().setSizeFull();\r
+ p.getContent().setSizeFull();\r
layout.addComponent(p);\r
\r
GridLayout gl = new GridLayout(1, 4);\r
Panel p = new Panel("OrderedLayout");\r
p.setWidth(500);\r
p.setHeight(500);\r
- p.getLayout().setWidth("100%");\r
+ p.getContent().setWidth("100%");\r
layout.addComponent(p);\r
\r
AbstractOrderedLayout ol = new VerticalLayout();\r
private void expandLayout(Layout layout) {\r
Panel p = new Panel("ExpandLayout");\r
layout.addComponent(p);\r
- p.getLayout().setWidth("500");\r
- p.getLayout().setHeight("400");\r
+ p.getContent().setWidth("500");\r
+ p.getContent().setHeight("400");\r
\r
AbstractOrderedLayout el = new VerticalLayout();\r
// el.setCaption("Horizontal");\r
Panel p = new Panel(ol);\r
p.setWidth("300px");\r
p.setHeight("300px");\r
- p.getLayout().setSizeFull();\r
+ p.getContent().setSizeFull();\r
\r
TextField tf = new TextField("Long caption, longer than 100 pixels");\r
tf.setWidth("100px");\r
final Window main = new Window(getClass().getName().substring(getClass().getName().lastIndexOf(".") + 1));\r
setMainWindow(main);\r
\r
- main.getLayout().setSizeFull();\r
+ main.getContent().setSizeFull();\r
\r
TabSheet ts = new TabSheet();\r
ts.setSizeFull();\r
GridLayout layout = new GridLayout(2, 2);\r
layout.setHeight("100%");\r
layout.setWidth("700");\r
- w.getLayout().setSizeFull();\r
- w.getLayout().setHeight("2000");\r
- w.getLayout().addComponent(layout);\r
+ w.getContent().setSizeFull();\r
+ 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 TextField("This should not get stuck either..."));\r
VerticalLayout ol = new VerticalLayout();\r
ol.setHeight("1000");\r
ol.setWidth("200");\r
- w.getLayout().addComponent(ol);\r
+ w.getContent().addComponent(ol);\r
ol.addComponent(new Label("Just a label to enable the scrollbar"));\r
\r
}\r
setMainWindow(w);\r
// setTheme("tests-tickets");\r
Panel p = createPanel();\r
- w.getLayout().addComponent(p);\r
+ w.getContent().addComponent(p);\r
// w.getLayout().addComponent(createGLPanel());\r
- w.getLayout().addComponent(createPanelV());\r
+ w.getContent().addComponent(createPanelV());\r
}\r
\r
private Panel createPanel() {\r
\r
HorizontalLayout layout = new HorizontalLayout();\r
p.setContent(layout);\r
- p.getLayout().setSizeFull();\r
+ p.getContent().setSizeFull();\r
\r
for (int i = 0; i < COMPONENTS; i++) {\r
TextField tf = new TextField();\r
\r
GridLayout layout = new GridLayout(COMPONENTS, 1);\r
p.setContent(layout);\r
- p.getLayout().setSizeFull();\r
+ p.getContent().setSizeFull();\r
\r
for (int i = 0; i < COMPONENTS; i++) {\r
TextField tf = new TextField();\r
\r
VerticalLayout layout = new VerticalLayout();\r
p.setContent(layout);\r
- p.getLayout().setSizeFull();\r
+ p.getContent().setSizeFull();\r
\r
for (int i = 0; i < COMPONENTS; i++) {\r
TextField tf = new TextField();\r
\r
import com.vaadin.ui.Accordion;\r
import com.vaadin.ui.Label;\r
+import com.vaadin.ui.Layout;\r
import com.vaadin.ui.TextField;\r
import com.vaadin.ui.Window;\r
\r
Window main = new Window();\r
setMainWindow(main);\r
\r
- main.getLayout().setSizeFull();\r
- main.getLayout().setMargin(true);\r
+ main.getContent().setSizeFull();\r
+ ((Layout) main.getContent()).setMargin(true);\r
\r
setTheme("tests-tickets");\r
\r
getMainWindow().setContent(orderedLayout);\r
// getMainWindow().setContent(new GridLayout(1, 1));\r
getMainWindow().setSizeFull();\r
- getMainWindow().getLayout().setSizeFull();\r
+ getMainWindow().getContent().setSizeFull();\r
\r
createUI(orderedLayout);\r
// createUI(gridLayout);\r
\r
public void buttonClick(ClickEvent event) {\r
Embedded newEmbedded = new Embedded(null, new ThemeResource("icons/64/folder-add.png"));\r
- getMainWindow().getLayout().replaceComponent(embedded, newEmbedded);\r
+ getMainWindow().getContent().replaceComponent(embedded, newEmbedded);\r
embedded = newEmbedded;\r
\r
}\r
public void init() {
mainWindow = new Window("Ticket 2061");
mainWindow.setSizeFull();
- mainWindow.getLayout().setSizeFull();
+ mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
MyTable table1 = new MyTable(24, "table1");
private void createUI(GridLayout layout) {\r
Panel p = new Panel("This is a panel with a longer caption than it should have");\r
p.setWidth("100px");\r
- p.getLayout().addComponent(new Label("Contents"));\r
+ p.getContent().addComponent(new Label("Contents"));\r
layout.addComponent(p);\r
}\r
}\r
\r
// uncomment to workaround iorderedlayout bug in current trunk\r
// w.setContent(new ExpandLayout());\r
- w.getLayout().setSizeFull();\r
+ w.getContent().setSizeFull();\r
\r
Embedded em = new Embedded();\r
em.setType(Embedded.TYPE_BROWSER);\r
Button b = new Button("Button with a long text which will not fit on 50 pixels");\r
b.setWidth("50px");\r
\r
- w.getLayout().addComponent(b);\r
+ w.getContent().addComponent(b);\r
}\r
\r
}\r
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
textArea.setSizeFull();
}
if (c == Panel.class) {
- Layout layout = ((Panel) cc).getLayout();
+ Layout layout = (Layout) ((Panel) cc).getContent();
containerToComponent.put(cc, layout);
layout.setVisible(false);
textArea.setVisible(true);
@Override\r
public void init() {\r
setMainWindow(new Window());\r
- getMainWindow().getLayout().setWidth("250px");\r
+ getMainWindow().getContent().setWidth("250px");\r
gl = new VerticalLayout();\r
gl.setStyleName("borders");\r
getMainWindow().addComponent(gl);\r
@Override\r
public void init() {\r
setMainWindow(new Window());\r
- getMainWindow().getLayout().setWidth("250px");\r
+ getMainWindow().getContent().setWidth("250px");\r
gl = new VerticalLayout();\r
gl.setSizeUndefined();\r
gl.setStyleName("borders");\r
import com.vaadin.ui.Panel;\r
import com.vaadin.ui.VerticalLayout;\r
import com.vaadin.ui.Window;\r
+import com.vaadin.ui.themes.Reindeer;\r
\r
public class Ticket2215 extends Application {\r
\r
p.addComponent(new Label("Panel1"));\r
p.setHeight("500px");\r
p.setWidth("500px");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
+ p.setStyleName(Reindeer.PANEL_LIGHT);\r
ol.addComponent(p);\r
ol.addComponent(new Label("NextComponent"));\r
\r
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
outerPanel.setHeight("1000px");
outerPanel.setWidth("1000px");
- outerPanel.getLayout().setSizeFull();
+ outerPanel.getContent().setSizeFull();
Panel innerPanel = new Panel("Inner panel");
innerPanel.setSizeFull();
outerPanel.addComponent(innerPanel);
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
@Override
public void init() {
Window main = new Window("The Main Window");
- main.getLayout().setSizeFull();
+ main.getContent().setSizeFull();
setMainWindow(main);
SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_VERTICAL);
main.addComponent(sp);
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
+// This tests the deprecated setComponentAlignment(Component,String) API
+@SuppressWarnings("deprecation")
public class Ticket2279 extends Application {
private Label label;
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
- AbstractOrderedLayout layout = (AbstractOrderedLayout) w.getLayout();
+ AbstractOrderedLayout layout = (AbstractOrderedLayout) w.getContent();
createUI(layout);
}
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
- w.getLayout().setSizeUndefined();
+ w.getContent().setSizeUndefined();
layout1 = new FormLayout();
layout1.setSizeUndefined();
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Window;
public class Ticket2283 extends Application {
gl.addComponent(new Label("Label 2 abc abc abc "));
Label l = new Label("Colspan2, align right");
gl.addComponent(l, 0, 1, 1, 1);
- gl.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT, AlignmentHandler.ALIGNMENT_TOP);
+ gl.setComponentAlignment(l, Alignment.TOP_RIGHT);
w.setContent(gl);
}
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Window;
public class Ticket2294 extends Application {
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((AbstractOrderedLayout) w.getLayout());
+ createUI((AbstractOrderedLayout) w.getContent());
}
private void createUI(AbstractOrderedLayout layout) {
layout.addComponent(label1);
try {
- layout.setComponentAlignment(label1, AlignmentHandler.ALIGNMENT_LEFT, AlignmentHandler.ALIGNMENT_BOTTOM);
+ layout.setComponentAlignment(label1, Alignment.BOTTOM_LEFT);
result1 = "OK";
} catch (Exception e) {
result1 = "FAILED: " + e.getMessage();
}
try {
- layout.setComponentAlignment(label2, AlignmentHandler.ALIGNMENT_LEFT, AlignmentHandler.ALIGNMENT_BOTTOM);
+ layout.setComponentAlignment(label2, Alignment.BOTTOM_LEFT);
result2 = "FAILED, no exception";
} catch (IllegalArgumentException e) {
result2 = "OK";
}
try {
- layout.setComponentAlignment(label3, AlignmentHandler.ALIGNMENT_LEFT, AlignmentHandler.ALIGNMENT_BOTTOM);
+ layout.setComponentAlignment(label3, Alignment.BOTTOM_LEFT);
result3 = "FAILED, no exception";
} catch (IllegalArgumentException e) {
result3 = "OK";
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.Reindeer;
public class Ticket2304 extends Application {
setMainWindow(main);
Panel p = new Panel();
- p.setStyleName(Panel.STYLE_LIGHT);
+ p.setStyleName(Reindeer.PANEL_LIGHT);
main.addComponent(p);
p.setHeight("100px");
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.Reindeer;
public class Ticket2310 extends Application {
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(Panel.STYLE_LIGHT);
+ p.setStyleName(Reindeer.PANEL_LIGHT);
main.addComponent(p);
p.setHeight("100px");
Window subWindow = new Window("");
subWindow.setSizeUndefined();
- subWindow.getLayout().setSizeUndefined();
+ subWindow.getContent().setSizeUndefined();
subWindow.center();
subWindow.addComponent(new RichTextArea());
w.addWindow(subWindow);
public void init() {
Window mainw = new Window();
setMainWindow(mainw);
- mainLo = (VerticalLayout) mainw.getLayout();
+ mainLo = (VerticalLayout) mainw.getContent();
table = new Table();
for (int i = 0; i < 10000; i++) {
table.addItem(i);
public void init() {
Window main = new Window();
setMainWindow(main);
- constructTables(main.getLayout());
+ constructTables((Layout) main.getContent());
}
private void constructTables(Layout layout) {
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.BaseTheme;
public class Ticket2344 extends Application {
VerticalLayout vl = new VerticalLayout();
// vl.setWidth(null);
Button b = new Button("String 1 2 3");
- b.setStyleName(Button.STYLE_LINK);
+ b.setStyleName(BaseTheme.BUTTON_LINK);
vl.addComponent(b);
t.addItem(new Object[] { vl, "String 2", "String 3", "String 4",
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
- createUI((VerticalLayout) w.getLayout());
+ createUI((VerticalLayout) w.getContent());
}
private void createUI(VerticalLayout layout) {
if (panel == null) {
panel = new Panel("Panel level " + i);
panel.setSizeFull();
- panel.getLayout().setSizeFull();
+ panel.getContent().setSizeFull();
}
Panel p = new Panel("Panel level " + i--);
- p.getLayout().setSizeFull();
+ p.getContent().setSizeFull();
p.setSizeFull();
panel.addComponent(p);
if (i > 0) {
import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
+import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
import com.vaadin.ui.SplitPanel;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
// browser.addWindow(root);
setMainWindow(root);
- root.getLayout().setSizeFull();
- root.getLayout().setMargin(false);
+ root.getContent().setSizeFull();
+ ((Layout) root.getContent()).setMargin(false);
// Top area, containing playback and volume controls, play status, view
// modes and search
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.getLayout()).setExpandRatio(split, 1.0f);
+ ((VerticalLayout) root.getContent()).setExpandRatio(split, 1.0f);
VerticalLayout vl = new VerticalLayout();
split.addComponent(vl);
vl.addComponent(new TextField("abc"));
vl.addComponent(image);
vl.setExpandRatio(image, 1.0f);
- vl.setComponentAlignment(image, "bottom center");
+ vl.setComponentAlignment(image, Alignment.BOTTOM_CENTER);
vl.setHeight("100%");
// We'll need one splitpanel to separate the sidebar and track listing
Button bottomButton = new Button("Filler");
// The splitpanel is by default 100% x 100%, but we'll need to adjust
// our main window layout to accomodate the height
- root.getLayout().setHeight("100%");
+ root.getContent().setHeight("100%");
// ((VerticalLayout) root.getLayout()).setExpandRatio(bottomButton,
// 1.0F);
Window w = new Window(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
- createUI((VerticalLayout) w.getLayout());
+ createUI((VerticalLayout) w.getContent());
}
private void createUI(VerticalLayout layout) {
Window w = new Window();
setMainWindow(w);
- w.getLayout().setSizeFull();
- ((SpacingHandler) w.getLayout()).setSpacing(true);
+ w.getContent().setSizeFull();
+ ((SpacingHandler) w.getContent()).setSpacing(true);
Layout layout = new GridLayout(3, 3);
populateLayout(layout);
import com.vaadin.ui.TextField;\r
import com.vaadin.ui.VerticalLayout;\r
import com.vaadin.ui.Window;\r
+import com.vaadin.ui.themes.Reindeer;\r
\r
/**\r
* Table layout is very slow in Firefox 3.0.10 when the table contains\r
Layout main = new VerticalLayout();\r
setLayout(main);\r
main.setSizeUndefined();\r
- main.setStyleName(Panel.STYLE_LIGHT);\r
+ main.setStyleName(Reindeer.PANEL_LIGHT);\r
\r
FormLayout form = new FormLayout();\r
form.setSizeUndefined();\r
\r
// set theme and some layout stuff\r
setMainWindow(w);\r
- w.getLayout().setSizeFull();\r
- w.getLayout().setMargin(false);\r
+ w.getContent().setSizeFull();\r
+ ((Layout) w.getContent()).setMargin(false);\r
\r
Panel p = new Panel("Workout Log");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
+ p.setStyleName(Reindeer.PANEL_LIGHT);\r
w.addComponent(p);\r
mainLayout = new VerticalLayout();\r
p.setContent(mainLayout);\r
for (String string : strings) {
Panel p = new Panel(string);
p.setSizeFull();
- ((VerticalLayout) p.getLayout()).setSpacing(true);
+ ((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. "));
StringBuffer sb = new StringBuffer();
sb.append("Available views : ");
import com.vaadin.ui.Select;\r
import com.vaadin.ui.TextField;\r
import com.vaadin.ui.VerticalLayout;\r
+import com.vaadin.ui.themes.Reindeer;\r
\r
public class EmptyFieldErrorIndicators extends TestBase {\r
\r
\r
Panel panel = new Panel();\r
panel.setSizeFull();\r
- panel.setStyleName(Panel.STYLE_LIGHT);\r
+ panel.setStyleName(Reindeer.PANEL_LIGHT);\r
panel.addComponent(hl);\r
panel.setScrollable(true);\r
addComponent(panel);\r