Package com.vaadin.ui

Examples of com.vaadin.ui.CustomLayout


        setMainWindow(mainWin);

        setTheme("tests-tickets");
        TabSheet ts = new TabSheet();

        ts.addTab(new CustomLayout("Ticket1519_News"), "News", null);
        ts.addTab(new CustomLayout("Ticket1519_Support"), "Support", null);

        mainWin.addComponent(ts);

    }
View Full Code Here


        smallSplitPanel.setId("layout" + debugIdCounter++);
        addComponent(smallSplitPanel);

        String customLayoutSrc = "<html><div location='pos1' class='customclass'> </div></html>";

        CustomLayout custom;
        try {
            custom = new CustomLayout(new ByteArrayInputStream(
                    customLayoutSrc.getBytes()));
            custom.addComponent(new Label("Some content"), "pos1");
            custom.setComponentError(new UserError("A error mesasge..."));
            custom.setCaption("CustomLayout");
            custom.setId("layout" + debugIdCounter++);

            addComponent(custom);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

        setTheme("tests-tickets");
        createUI((VerticalLayout) w.getContent());
    }

    private void createUI(VerticalLayout layout) {
        CustomLayout cl = new CustomLayout("Ticket2347");
        b1 = new Button("200px button");
        b1.addListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (b1.getWidth() == 200.0) {
                    b1.setWidth("300px");
                } else {
                    b1.setWidth("200px");

                }
                b1.setCaption(b1.getWidth() + "px button");

            }

        });
        b1.setWidth("200px");
        Button b2 = new Button("100% button");
        b2.setWidth("100%");

        cl.addComponent(b1, "button1");
        cl.addComponent(b2, "button2");

        layout.addComponent(cl);
    }
View Full Code Here

    }

    @Override
    protected void setup(VaadinRequest request) {
        setTheme("tests-tickets");
        CustomLayout customLayout = new CustomLayout("Ticket14340");
        final Button button = new Button("Button");
        button.setId(BUTTON_ID);
        customLayout.addComponent(button);
        addComponent(customLayout);
    }
View Full Code Here

                .getComponentContainersSupportingAddRemoveComponent();

        // No default constructor, special case
        containerClasses.remove(CustomLayout.class);
        containerClasses.remove(ColorPickerPreview.class);
        testRemoveComponentFromWrongContainer(new CustomLayout("dummy"));

        for (Class<? extends ComponentContainer> c : containerClasses) {
            testRemoveComponentFromWrongContainer(c.newInstance());
        }
    }
View Full Code Here

        return 3070;
    }

    @Override
    protected void setup() {
        styles = new CustomLayout(css);
        addComponent(styles);

        Tree tree = new Tree();

        tree.setItemStyleGenerator(new Tree.ItemStyleGenerator() {
View Full Code Here

                template);

        addComponent(button1);

        try {
            layout = new CustomLayout(is);
            addComponent(layout);
        } catch (IOException e) {
            addComponent(new Label(e.getMessage()));
            e.printStackTrace();
        } finally {
View Full Code Here

    @Override
    protected void setup() {
        InputStream is = new ByteArrayInputStream(
                "<div location='loc1'>".getBytes());
        try {
            final CustomLayout cl = new CustomLayout(is);

            cl.addComponent(new TextField("Hello world"), "loc1");

            cl.setPrimaryStyleName("my-customlayout");
            addComponent(cl);

            addComponent(new Button("Set primary stylename",
                    new Button.ClickListener() {
                        @Override
                        public void buttonClick(ClickEvent event) {
                            cl.setPrimaryStyleName("my-second-customlayout");
                        }
                    }));

        } catch (IOException e) {
            // TODO Auto-generated catch block
View Full Code Here

    private CustomLayout layout;

    @Override
    protected void setup() {
        setTheme("tests-tickets");
        layout = new CustomLayout("Ticket1775");
        addComponent(layout);
        layout.addComponent(new TextField("Username"), "loginUser");
        layout.addComponent(new TextField("Password"), "loginPassword");
        layout.addComponent(new Button("Login"), "loginButton");
        layout.setWidth(null);
View Full Code Here

    _app = application;
    setMargin(true);
    
    addr = InetAddress.getLocalHost();

    CustomLayout custom = new CustomLayout("login");
    addComponent(custom);

    Panel loginPanel = new Panel("Login");
    loginPanel.setSizeUndefined();
    loginPanel.setStyleName("mystyle");
    LoginForm loginForm = new LoginForm();
    loginForm.addListener(new LoginListener() {

      @Override
      public void onLogin(LoginEvent event) {
        String username = event.getLoginParameter("username");
        String password = event.getLoginParameter("password");

        if (username.equals("admin") && password.equals("admin") && addr.getHostName().equals("stroika")) {
          _app.getViewManager().switchScreen(
              AdminView.class.getName(), new AdminView(_app));
        } else if (username.equals("respo") && password.equals("admin") && addr.getHostName().equals("stroika")) {
          _app.getViewManager().switchScreen(
              RespView.class.getName(), new RespView(_app));
        } else {

          _app.getMainWindow().showNotification("Login Error",
              "<br>Please verify your username or password",
              Window.Notification.TYPE_ERROR_MESSAGE);
        }
      }

    });

    loginPanel.addComponent(loginForm);
    custom.addComponent(loginPanel, "loginPanel");

  }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.CustomLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.