Example usage for com.google.gwt.user.client.ui HasHorizontalAlignment ALIGN_LOCALE_START

List of usage examples for com.google.gwt.user.client.ui HasHorizontalAlignment ALIGN_LOCALE_START

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HasHorizontalAlignment ALIGN_LOCALE_START.

Prototype

HorizontalAlignmentConstant ALIGN_LOCALE_START

To view the source code for com.google.gwt.user.client.ui HasHorizontalAlignment ALIGN_LOCALE_START.

Click Source Link

Document

In a RTL layout, specifies that the widget's contents should be aligned to the right.

Usage

From source file:se.esss.litterbox.linaclego.webapp.client.panels.PbsLevelPanel.java

License:Open Source License

private VerticalPanel setupElementPanel() {
    HorizontalPanel expandButtonPanel = new HorizontalPanel();
    HorizontalPanel collapseButtonPanel = new HorizontalPanel();
    expandButtonPanel.add(expandButton);
    collapseButtonPanel.add(collapseButton);

    arrowLine1Image = new Image("images/blueLine.png");
    arrowLine1Image.setHeight(arrowHeight + "px");
    arrowLine1Image.setWidth(arrowLine1Width + "px");
    arrowLine1Panel = new HorizontalPanel();
    arrowLine1Panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    arrowLine1Panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    arrowLine1Panel.setWidth(arrowLine1Width + "px");
    arrowLine1Panel.setHeight("100%");
    arrowLine1Panel.add(arrowLine1Image);

    Image arrowLine2Image = new Image("images/blueLine.png");
    arrowLine2Image.setHeight(arrowHeight + "px");
    arrowLine2Image.setWidth("100%");
    arrowLine2Panel = new HorizontalPanel();
    arrowLine2Panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    arrowLine2Panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    arrowLine2Panel.setWidth("100%");
    arrowLine2Panel.setHeight("100%");
    arrowLine2Panel.add(arrowLine2Image);

    iconImage = new Image(textTree.getIconImageLocation());
    iconImage.addClickHandler(new IconImageClickHandler(this));
    iconImage.setSize(iconWidth + "px", iconHeight + "px");
    Image arrowHeadImage = new Image("images/blueArrowHead.png");
    arrowHeadImage.setSize(arrowHeight + "px", arrowHeight + "px");

    HorizontalPanel iconAndArrowHeadPanel = new HorizontalPanel();
    iconAndArrowHeadPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    iconAndArrowHeadPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    iconAndArrowHeadPanel.setWidth(iconWidth + arrowHeight + "px");
    iconAndArrowHeadPanel.add(arrowHeadImage);
    iconAndArrowHeadPanel.add(iconImage);

    HorizontalPanel allIconPanel = new HorizontalPanel();
    allIconPanel.setWidth("100%");
    allIconPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LOCALE_START);
    allIconPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    allIconPanel.add(arrowLine1Panel);
    allIconPanel.add(iconAndArrowHeadPanel);
    allIconPanel.add(arrowLine2Panel);

    HorizontalPanel tagAndButtonPanel = new HorizontalPanel();
    tagAndButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    tagAndButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    tagAndButtonPanel.add(expandButtonPanel);
    tagAndButtonPanel.add(new InlineHTML("<html>" + textTree.getAttribute(0).getAttributeValue() + "</html>"));
    //      tagAndButtonPanel.add(new InlineHTML("<html>" + textTree.getTag() + "</html>"));
    tagAndButtonPanel.add(collapseButtonPanel);
    tagAndButtonWrapperPanel = new HorizontalPanel();
    tagAndButtonWrapperPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    tagAndButtonWrapperPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    tagAndButtonWrapperPanel.setWidth("100%");
    tagAndButtonWrapperPanel.setHeight("40px");
    tagAndButtonWrapperPanel.add(tagAndButtonPanel);
    if (odd)/*  w  w w . ja  v  a  2s.c  o  m*/
        tagAndButtonWrapperPanel.setStyleName("pbsBackGroundOdd" + ilevel);
    if (!odd)
        tagAndButtonWrapperPanel.setStyleName("pbsBackGroundEven" + ilevel);
    FocusPanel tagAndButtonWrapperFocusPanel = new FocusPanel();
    tagAndButtonWrapperFocusPanel.addClickHandler(new CenterClickHandler(this));
    tagAndButtonWrapperFocusPanel.add(tagAndButtonWrapperPanel);

    VerticalPanel iconAndTag = new VerticalPanel();
    iconAndTag.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    iconAndTag.setWidth("100%");
    iconAndTag.add(tagAndButtonWrapperFocusPanel);
    iconAndTag.add(allIconPanel);

    VerticalPanel wrapperPanel = new VerticalPanel();
    wrapperPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    wrapperPanel.add(iconAndTag);
    if (textTree.hasChildren()) {
        expandButton.addClickHandler(new ExpandButtonClickHandler(this));
        expandButton.setVisible(true);
        collapseButton.addClickHandler(new CollapseButtonClickHandler(this));
        collapseButton.setVisible(false);
    } else {
        expandButton.setVisible(false);
        collapseButton.setVisible(false);
    }
    Grid attributePanel = new Grid(textTree.numAttributes(), 1);
    for (int ia = 0; ia < textTree.numAttributes(); ++ia) {
        attributePanel.setWidget(ia, 0,
                new InlineHTML(textTree.getAttribute(ia).getInlineHtmlString(false, false)));
    }

    Grid idPanel = new Grid(1, 1);
    idPanel.setWidget(0, 0, new Label(" "));
    wrapperPanel.add(idPanel);
    if (textTree.hasDataFolder()) {
        dataPanel = new Grid(textTree.getDataFolder().numChildren(), 1);
        for (int ia = 0; ia < textTree.getDataFolder().numChildren(); ++ia) {
            String html = textTree.getDataFolder().getTextTreeArrayList().get(ia).getInlineHtmlString(false,
                    false);
            dataPanel.setWidget(ia, 0, new InlineHTML(html));
        }
    }
    pbsInfoDialogBox = new PbsInfoDialogBox(textTree.getAttribute(1).getAttributeValue(), attributePanel,
            dataPanel);
    return wrapperPanel;
}