aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/application/application-architecture.asciidoc
diff options
context:
space:
mode:
authorMarko Gronroos <magi@vaadin.com>2016-05-20 14:44:42 +0300
committerMarko Grönroos <magi@vaadin.com>2016-06-30 11:13:20 +0000
commit93767cf76b2fb14c65b758066c67fc8b48cc2eeb (patch)
tree958ddb8c45271e9a505280ef750ae07ebeda170f /documentation/application/application-architecture.asciidoc
parentedad7348bb8eba807225bfa72d4b0a4342426c71 (diff)
downloadvaadin-framework-93767cf76b2fb14c65b758066c67fc8b48cc2eeb.tar.gz
vaadin-framework-93767cf76b2fb14c65b758066c67fc8b48cc2eeb.zip
Scaled images for print edition and fixed errors up to the beginning of layouts chapter (#19835). Also major revision of Tree, CustomField, and layouts overview.
Change-Id: I19f5e9511b83f953ce4707f324d81c2821ebb69d
Diffstat (limited to 'documentation/application/application-architecture.asciidoc')
-rw-r--r--documentation/application/application-architecture.asciidoc23
1 files changed, 9 insertions, 14 deletions
diff --git a/documentation/application/application-architecture.asciidoc b/documentation/application/application-architecture.asciidoc
index 77c1756594..c00a378a11 100644
--- a/documentation/application/application-architecture.asciidoc
+++ b/documentation/application/application-architecture.asciidoc
@@ -14,7 +14,6 @@ way you like to think about it), from the [classname]#UI# class of the
application. You normally set a layout component as the content of the UI and
fill it with other components.
-
[source, java]
----
public class MyHierarchicalUI extends UI {
@@ -24,10 +23,10 @@ public class MyHierarchicalUI extends UI {
VerticalLayout content = new VerticalLayout();
content.setSizeFull(); // Use entire window
setContent(content); // Attach to the UI
-
+
// Add some component
content.addComponent(new Label("Hello!"));
-
+
// Layout inside layout
HorizontalLayout hor = new HorizontalLayout();
hor.setSizeFull(); // Use all available space
@@ -64,8 +63,8 @@ UI
The result is shown in <<figure.application.architecture.example>>.
[[figure.application.architecture.example]]
-.Simple Hierarchical UI
-image::img/ui-architecture-hierarchical.png[]
+.Simple hierarchical UI
+image::img/ui-architecture-hierarchical.png[width=70%, scaledwidth=90%]
Instead of building the layout in Java, you can also use a declarative design,
as described later in
@@ -131,7 +130,7 @@ class MyView extends VerticalLayout {
addComponent(entry);
addComponent(display);
addComponent(click);
-
+
// Configure it a bit
setSizeFull();
addStyleName("myview");
@@ -164,13 +163,13 @@ class MyView extends CustomComponent {
public MyView() {
Layout layout = new VerticalLayout();
-
+
layout.addComponent(entry);
layout.addComponent(display);
layout.addComponent(click);
-
+
setCompositionRoot(layout);
-
+
setSizeFull();
}
}
@@ -233,7 +232,7 @@ UI.getCurrent().setLocale(new Locale("en"));
// Set the page title (window or tab caption)
Page.getCurrent().setTitle("My Page");
-
+
// Set a session attribute
VaadinSession.getCurrent().setAttribute("myattrib", "hello");
@@ -252,7 +251,3 @@ ifdef::web[]
<<dummy/../../../framework/advanced/advanced-global#advanced.global.threadlocal,"ThreadLocal
Pattern">>.
endif::web[]
-
-
-
-