diff options
Diffstat (limited to 'src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java')
-rw-r--r-- | src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java deleted file mode 100644 index c698828794..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowModalExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowModalExample() {
-
- // Create the window...
- subwindow = new Window("A modal subwindow");
- // ...and make it modal
- subwindow.setModal(true);
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a modal subwindow.");
- subwindow.addComponent(message);
-
- Button close = new Button("Close", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- // close the window by removing it from the main window
- getApplication().getMainWindow().removeWindow(subwindow);
- }
- });
- // The components added to the window are actually added to the window's
- // layout; you can use either. Alignments are set using the layout
- layout.addComponent(close);
- layout.setComponentAlignment(close, "right");
-
- // Add a button for opening the subwindow
- Button open = new Button("Open modal window",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() != null) {
- // window is already showing
- getWindow().showNotification(
- "Window is already open");
- } else {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
- }
- });
- addComponent(open);
-
- }
-
-}
\ No newline at end of file |