Package com.vaadin.ui

Examples of com.vaadin.ui.AbsoluteLayout


        css.setCaption("CssLayout");
        css.addComponent(new Label("Some content"));
        css.setId("layout" + debugIdCounter++);
        addComponent(css);

        AbsoluteLayout abs = new AbsoluteLayout();
        abs.setCaption("Abs layout");
        abs.addComponent(new Label("Some content"));
        abs.setComponentError(new UserError("A error message..."));
        abs.setId("layout" + debugIdCounter++);

        addComponent(abs);

        GridLayout gl = new GridLayout();
        gl.setMargin(true);
View Full Code Here


    private AbsoluteLayout layout;

    public AcceptFromComponent(final Tree tree1) {
        setCaption("Checks the source is tree1 on server");

        layout = new AbsoluteLayout();
        DragAndDropWrapper wrapper = new DragAndDropWrapper(layout);

        setContent(wrapper);

        wrapper.setSizeFull();
View Full Code Here

    private AbsoluteLayout root;
    private AcceptCriterion crit;

    public DragDropPane() {
        super(new AbsoluteLayout());
        root = (AbsoluteLayout) getCompositionRoot();
        setDropHandler(this);
        setDragStartMode(DragStartMode.COMPONENT);
    }
View Full Code Here

        layoutsLayout.addComponent(createClickableAbsoluteLayout());
        layoutsLayout.addComponent(createClickableCSSLayout());
    }

    private Component createClickableAbsoluteLayout() {
        final AbsoluteLayout al = new AbsoluteLayout();
        al.setCaption("AbsoluteLayout");
        al.setStyleName("borders");
        al.setWidth("300px");
        al.setHeight("500px");
        al.addComponent(new TextField("This is its caption",
                "This is a textfield"), "top: 60px; left: 0px; width: 100px;");
        al.addComponent(new TextField("Another textfield caption",
                "This is another textfield"),
                "top: 120px; left: 20px; width: 100px;");

        al.addComponent(new Button("A button with its own click listener",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(
                            com.vaadin.ui.Button.ClickEvent event) {
                        log("Button " + event.getButton().getCaption()
                                + " was clicked");

                    }
                }));
        al.addLayoutClickListener(new LayoutClickListener() {

            @Override
            public void layoutClick(LayoutClickEvent event) {
                logLayoutClick("AbsoluteLayout", event);
            }
View Full Code Here

    }

    private void testAbsoluteLayout() {
        content.removeAllComponents();

        final AbsoluteLayout a = new AbsoluteLayout();
        a.setWidth("300px");
        a.setHeight("300px");
        a.addComponentAttachListener(new ComponentAttachListener() {
            @Override
            public void componentAttachedToContainer(ComponentAttachEvent event) {
                AbsoluteLayout layout = (AbsoluteLayout) event.getContainer();
                AbsoluteLayout.ComponentPosition position = layout
                        .getPosition(event.getAttachedComponent());

                getMainWindow().showNotification(
                        "Attached to " + position.getCSSString(),
                        Notification.TYPE_ERROR_MESSAGE);
View Full Code Here

public class AbsoluteLayoutClipping extends TestBase {

    @Override
    protected void setup() {
        setTheme("tests-tickets");
        AbsoluteLayout abs = new AbsoluteLayout();
        abs.setStyleName("borders");
        abs.setWidth("100px");
        abs.setHeight("100px");

        Label l = new Label("This should be clipped at 100px");
        l.setSizeUndefined();
        abs.addComponent(l, "top:50px;left:50px");

        Label l2 = new Label("This should not be visible");
        l2.setSizeUndefined();
        abs.addComponent(l2, "top:80px;left:150px");

        Label l3 = new Label("This should be clipped vertically at 100px");
        l3.setWidth("50px");
        abs.addComponent(l3, "top:20px;left:0px");

        addComponent(abs);
    }
View Full Code Here

    private TextField editEmail = new TextField();
    private PasswordField editPassword = new PasswordField();

    @Override
    protected void setup(VaadinRequest request) {
        mainLayout = new AbsoluteLayout();
        mainLayout.setImmediate(true);
        mainLayout.setWidth("100%");
        mainLayout.setHeight("100%");

        topBar.setHeight("50px");
View Full Code Here

    private AbsoluteLayout al;
    protected ComponentContainer vl;

    @Override
    protected void setup() {
        al = new AbsoluteLayout();
        al.setWidth("200px");
        al.setHeight("200px");

        testButton = new Button("Click to move to inner layout",
                new Button.ClickListener() {
View Full Code Here

public class AbsoluteLayoutCorrectPositioningOfHiddenField extends TestBase {

    @Override
    protected void setup() {
        setTheme("tests-tickets");
        final AbsoluteLayout abs = new AbsoluteLayout();
        abs.setStyleName("borders");
        abs.setWidth("250px");
        abs.setHeight("100px");

        final Label l = new Label("Top 20, Left 20");
        l.setSizeUndefined();
        l.setId("positionedLabel");
        l.setVisible(false);
        abs.addComponent(l, "top:20px;left:20px");

        final Button action = new Button("Set visible");
        action.addClickListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (l.isVisible()) {
                    l.setValue("Top 70, Left 20");
                    ComponentPosition position = abs.getPosition(l);
                    position.setCSSString("top:70px;left:20px;");
                    abs.setPosition(l, position);
                } else {
                    l.setVisible(true);
                    action.setCaption("Move down");
                }
            }
        });
        action.setId("actionButton");
        abs.addComponent(action, "top: 70px;left: 150px;");

        addComponent(abs);
    }
View Full Code Here

    @Override
    protected void setup() {
        getLayout().setSizeFull();

        AbsoluteLayout al = new AbsoluteLayout();

        TextArea ta = new TextArea();
        ta.setValue("When resizing the layout this text area should also get resized");
        ta.setSizeFull();
        al.addComponent(ta, "left: 10px; right: 10px; top: 10px; bottom: 10px;");

        HorizontalSplitPanel horizPanel = new HorizontalSplitPanel();
        horizPanel.setSizeFull();
        horizPanel.setFirstComponent(al);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.AbsoluteLayout

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.