Example usage for com.vaadin.ui HorizontalLayout setDebugId

List of usage examples for com.vaadin.ui HorizontalLayout setDebugId

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalLayout setDebugId.

Prototype

@Deprecated
public void setDebugId(String id) 

Source Link

Usage

From source file:com.expressui.core.view.field.SelectField.java

License:Open Source License

private void initialize() {
    setSizeUndefined();/* ww w . j a v  a 2  s .c o  m*/
    field = new TextField();
    FormField.initAbstractFieldDefaults(field);
    FormField.initTextFieldDefaults(field);
    field.setReadOnly(true);

    HorizontalLayout selectFieldLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, selectFieldLayout, "selectFieldLayout");
    selectFieldLayout.setDebugId(id);
    selectFieldLayout.addComponent(field);

    searchButton = new Button();
    searchButton.setDescription(uiMessageSource.getToolTip("selectField.search.toolTip"));
    searchButton.setSizeUndefined();
    searchButton.addStyleName("borderless");
    searchButton.setIcon(new ThemeResource("../chameleon/img/magnifier.png"));
    searchButton.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            entitySelect.open();
        }
    });
    selectFieldLayout.addComponent(searchButton);

    clearButton = new Button();
    clearButton.setDescription(uiMessageSource.getToolTip("selectField.clear.toolTip"));
    clearButton.setSizeUndefined();
    clearButton.addStyleName("borderless");
    clearButton.setIcon(new ThemeResource("../runo/icons/16/cancel.png"));
    selectFieldLayout.addComponent(clearButton);

    entitySelect.getResults().addSelectActionListener(this, "itemSelected");
    clearButton.addListener(Button.ClickEvent.class, this, "itemCleared");

    setCompositionRoot(selectFieldLayout);
}

From source file:com.expressui.core.view.form.layout.LeftLabelGridLayout.java

License:Open Source License

private void addFieldImpl(FormField formField) {
    Label label = formField.getFieldLabel();

    HorizontalLayout fieldLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, fieldLayout, "fieldLayout");
    fieldLayout.setDebugId(id);
    fieldLayout.setSizeUndefined();// w  ww . jav a 2 s .com
    Field field = formField.getField();
    fieldLayout.addComponent(field);

    Label spacer = new Label();
    spacer.setWidth("1em");

    if (formField.getColumnEnd() != null && formField.getRowEnd() != null) {
        addComponent(label, getLabelColumn(formField), getRowStart(formField), getLabelColumn(formField),
                getRowEnd(formField));

        addComponent(fieldLayout, getFieldColumn(formField), getRowStart(formField), getColumnEnd(formField),
                getRowEnd(formField));

        addComponent(spacer, getSpacerColumn(formField), getRowStart(formField), getSpacerColumn(formField),
                getRowEnd(formField));
    } else {
        addComponent(label, getLabelColumn(formField), getRowStart(formField));

        addComponent(fieldLayout, getFieldColumn(formField), getRowStart(formField));

        addComponent(spacer, getSpacerColumn(formField), getRowStart(formField));
    }
    setComponentAlignment(fieldLayout, Alignment.TOP_LEFT);
    setComponentAlignment(label, Alignment.TOP_RIGHT);
    setComponentAlignment(spacer, Alignment.TOP_LEFT);
}

From source file:com.expressui.core.view.form.ResultsConnectedEntityForm.java

License:Open Source License

private HorizontalLayout createNavigationFormLayout() {
    HorizontalLayout navigationFormLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, navigationFormLayout, "navigationFormLayout");
    navigationFormLayout.setDebugId(id);
    navigationFormLayout.setSizeUndefined();

    VerticalLayout previousButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, previousButtonLayout, "previousButtonLayout");
    previousButtonLayout.setDebugId(id);

    previousButtonLayout.setSizeUndefined();
    previousButtonLayout.setMargin(false);
    previousButtonLayout.setSpacing(false);
    Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();//from   w w  w.  j a  v  a  2s .  co m
    previousButtonLayout.addComponent(spaceLabel);

    Button previousButton = new Button(null, this, "previousItem");
    previousButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.previous.toolTip"));
    previousButton.setSizeUndefined();
    previousButton.addStyleName("borderless");
    previousButton.setIcon(new ThemeResource("../expressui/icons/16/previous.png"));

    if (entityForm.getViewableToManyRelationships().size() == 0) {
        HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout();
        id = StringUtil.generateDebugId("e", this, previousButtonHorizontalLayout,
                "previousButtonHorizontalLayout");
        previousButtonHorizontalLayout.setDebugId(id);
        previousButtonHorizontalLayout.setSizeUndefined();
        Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
        horizontalSpaceLabel.setSizeUndefined();
        previousButtonHorizontalLayout.addComponent(previousButton);
        previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
        previousButtonLayout.addComponent(previousButtonHorizontalLayout);
    } else {
        previousButtonLayout.addComponent(previousButton);
    }

    navigationFormLayout.addComponent(previousButtonLayout);
    navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT);

    navigationFormLayout.addComponent(entityForm);

    VerticalLayout nextButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonLayout, "nextButtonLayout");
    nextButtonLayout.setDebugId(id);
    nextButtonLayout.setSizeUndefined();
    nextButtonLayout.setMargin(false);
    nextButtonLayout.setSpacing(false);
    spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    previousButtonLayout.addComponent(spaceLabel);
    nextButtonLayout.addComponent(spaceLabel);

    Button nextButton = new Button(null, this, "nextItem");
    nextButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.next.toolTip"));
    nextButton.setSizeUndefined();
    nextButton.addStyleName("borderless");
    nextButton.setIcon(new ThemeResource("../expressui/icons/16/next.png"));

    HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonHorizontalLayout, "nextButtonHorizontalLayout");
    nextButtonHorizontalLayout.setDebugId(id);
    nextButtonHorizontalLayout.setSizeUndefined();
    Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
    horizontalSpaceLabel.setSizeUndefined();
    nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
    nextButtonHorizontalLayout.addComponent(nextButton);

    nextButtonLayout.addComponent(nextButtonHorizontalLayout);
    navigationFormLayout.addComponent(nextButtonLayout);
    navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT);

    navigationFormLayout.setSpacing(false);
    navigationFormLayout.setMargin(false);

    return navigationFormLayout;
}

From source file:rs.pupin.jpo.esta_ld.EstaLdComponent.java

private void refresh() {
    contentLayout.removeAllComponents();

    // create left part where the map goes
    // first create a vertical layout for components
    geoLayout = new VerticalLayout();
    geoLayout.setDebugId("l-geo");
    geoLayout.setSizeUndefined();/*from  ww w  .  j  ava  2 s  .c  o  m*/
    //        geoLayout.setWidth(GEO_PART_WIDTH);
    //        geoLayout.setHeight("100%");
    geoLayout.setSizeFull();
    geoLayout.setSpacing(true);
    contentLayout.addComponent(geoLayout);
    getWindow().executeJavaScript("$('div#l-geo').append('<div id=\"esta-map-popup\"><p></p></div>')");
    //        contentLayout.setExpandRatio(geoLayout, 0.0f);
    // create Level and +- controls
    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    final Label levelLabel = new Label(LEVEL_LABEL_CONTENT, Label.CONTENT_XHTML);
    hl.addComponent(levelLabel);
    hl.setComponentAlignment(levelLabel, Alignment.MIDDLE_LEFT);
    btnAggregColor = new Button("Aggregated Coloring");
    btnAggregColor.addStyleName("dim-name");
    btnAggregColor.addStyleName("btn-aggreg-coloring");
    btnAggregColor.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            getWindow().executeJavaScript("toggleAggregatedColoring()");
        }
    });
    hl.addComponent(btnAggregColor);
    geoLayout.addComponent(hl);
    geoLayout.setExpandRatio(hl, 0.0f);
    // create a layout for the map
    //        mapLayout = new VerticalLayout();
    mapLayout = new VerticalLayout() {
        @Override
        public void attach() {
            getWindow().executeJavaScript("console.log('Attached the map')");
        }
    };
    mapLayout.addListener(new ComponentAttachListener() {

        public void componentAttachedToContainer(ComponentAttachEvent event) {
            getWindow().executeJavaScript("console.log('ComponentAttachedListener triggered')");
        }
    });
    mapLayout.setSizeUndefined();
    mapLayout.setWidth("100%");
    //        mapLayout.setHeight("620px");
    mapLayout.setHeight("100%");
    mapLayout.setDebugId("map");
    mapLayout.addStyleName("leaflet-container");
    mapLayout.addStyleName("leaflet-fade-anim");
    geoLayout.addComponent(mapLayout);
    geoLayout.setExpandRatio(mapLayout, 2.0f);

    rightLayout = new VerticalLayout();
    rightLayout.setSizeUndefined();
    rightLayout.setWidth("100%");
    rightLayout.setSizeFull();
    rightLayout.setSpacing(true);
    contentLayout.addComponent(rightLayout);
    //        contentLayout.setExpandRatio(rightLayout, 2.0f);
    dimLayout = new GridLayout(6, 1);
    dimLayout.setColumnExpandRatio(0, 0.0f);
    dimLayout.setColumnExpandRatio(1, 0.0f);
    dimLayout.setColumnExpandRatio(2, 2.0f);
    dimLayout.setColumnExpandRatio(3, 0.0f);
    dimLayout.setColumnExpandRatio(4, 0.0f);
    dimLayout.setColumnExpandRatio(5, 2.0f);
    dimLayout.setDebugId("dim-layout");
    //        dimLayout.setSizeFull();
    dimLayout.setWidth("100%");
    dimLayout.setSpacing(true);
    //        rightLayout.addComponent(dimLayout);
    settingsLayout.addComponent(dimLayout);

    dimLayout.addListener(new LayoutEvents.LayoutClickListener() {
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            Component btnAggreg = event.getClickedComponent();
            if (!(btnAggreg instanceof Label))
                return;
            if (btnAggreg.getStyleName().contains("selected")) {
                btnAggreg.removeStyleName("selected");
            } else {
                btnAggreg.addStyleName("selected");
            }
            aggregDimensionsChanged();
        }
    });

    refreshDimensions();

    HorizontalLayout chartControlsLayout = new HorizontalLayout();
    chartControlsLayout.setDebugId("l-chart-controls");
    chartControlsLayout.setWidth("100%");
    chartControlsLayout.setSpacing(true);
    rightLayout.addComponent(chartControlsLayout);
    rightLayout.setExpandRatio(chartControlsLayout, 0.0f);
    btnCompare = new Button("Compare");
    btnCompare.setDebugId("btn-compare");
    btnCompare.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            getWindow().executeJavaScript("toggleCompare()");
        }
    });
    chartControlsLayout.addComponent(btnCompare);
    btnSwap = new Button("Swap");
    btnSwap.setDebugId("btn-swap");
    btnSwap.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            getWindow().executeJavaScript("toggleSwap()");
        }
    });
    chartControlsLayout.addComponent(btnSwap);
    btnInvert = new Button("Switch Axes");
    btnInvert.setDebugId("btn-invert");
    btnInvert.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            getWindow().executeJavaScript("toggleInvert()");
        }
    });
    chartControlsLayout.addComponent(btnInvert);
    btnStack = new Button("Stack");
    btnStack.setDebugId("btn-stack");
    btnStack.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            getWindow().executeJavaScript("toggleStacking()");
        }
    });
    chartControlsLayout.addComponent(btnStack);
    Label lblEmpty = new Label(" ");
    chartControlsLayout.addComponentAsFirst(lblEmpty);
    chartControlsLayout.setExpandRatio(lblEmpty, 2.0f);

    chartLayout = new VerticalLayout();
    chartLayout.setSizeFull();
    chartLayout.setDebugId("highchartsbarsingle");
    //        rightLayout.addComponent(chartLayout);
    VerticalLayout chartLayout2 = new VerticalLayout();
    chartLayout2.setSizeFull();
    chartLayout2.setDebugId("highchartsbarmultiple");
    rightLayout.addComponent(chartLayout2);
    rightLayout.setExpandRatio(chartLayout2, 2.0f);

    inspectLayout = new VerticalLayout();
    inspectLayout.setVisible(false);
    inspectLayout.setWidth("100%");
    inspectLayout.setDebugId("l-inspect");
    //        mainLayout.addComponent(inspectLayout);
    //        mainLayout.setExpandRatio(inspectLayout, 2.0f);
}