Example usage for com.google.gwt.dom.client SpanElement getString

List of usage examples for com.google.gwt.dom.client SpanElement getString

Introduction

In this page you can find the example usage for com.google.gwt.dom.client SpanElement getString.

Prototype

@Override
    public String getString() 

Source Link

Usage

From source file:org.kaaproject.kaa.server.admin.client.mvp.view.endpoint.EndpointProfileViewImpl.java

License:Apache License

@Override
protected void initDetailsTable() {

    detailsTable.getColumnFormatter().setWidth(0, "200px");
    detailsTable.getColumnFormatter().setWidth(1, "550px");
    detailsTable.getColumnFormatter().setWidth(2, "0px");

    getSaveButtonWidget().removeFromParent();
    getCancelButtonWidget().removeFromParent();
    requiredFieldsNoteLabel.setVisible(false);

    int row = 0;//  w w w. ja v a 2s  .  c  o m
    Label keyHashLabel = new Label(Utils.constants.endpointKeyHash());
    endpointKeyHash = new KaaAdminSizedTextBox(-1, false);
    endpointKeyHash.setWidth("100%");
    detailsTable.setWidget(row, 0, keyHashLabel);
    detailsTable.setWidget(row, 1, endpointKeyHash);

    userInfoList = new ArrayList<>();
    Label userIDLabel = new Label(Utils.constants.userId());
    userID = new KaaAdminSizedTextBox(-1, false);
    userID.setWidth("100%");
    detailsTable.setWidget(++row, 0, userIDLabel);
    detailsTable.setWidget(row, 1, userID);
    userInfoList.add(userIDLabel);
    userInfoList.add(userID);

    Label userExternalIDLabel = new Label(Utils.constants.userExternalId());
    userExternalID = new KaaAdminSizedTextBox(-1, false);
    userExternalID.setWidth("100%");
    detailsTable.setWidget(++row, 0, userExternalIDLabel);
    detailsTable.setWidget(row, 1, userExternalID);
    userInfoList.add(userExternalIDLabel);
    userInfoList.add(userExternalID);

    Label sdkLabel = new Label(Utils.constants.sdkProfile());
    sdkAnchor = new Anchor();
    sdkAnchor.getElement().getStyle().setCursor(Style.Cursor.POINTER);
    sdkAnchor.setWidth("100%");
    detailsTable.getFlexCellFormatter().setHeight(row, 0, "40px");
    detailsTable.setWidget(row, 0, sdkLabel);
    detailsTable.setWidget(row++, 1, sdkAnchor);

    SpanElement span = Document.get().createSpanElement();
    span.appendChild(Document.get().createTextNode(Utils.constants.endpointProfile()));
    span.addClassName("gwt-Label");

    CaptionPanel formPanel = new CaptionPanel(span.getString(), true);
    FlexTable recordTable = new FlexTable();
    recordTable.setWidth("100%");

    Label endpointProfSchemaLabel = new Label(Utils.constants.schemaName());
    endpointProfSchemaName = new Anchor();
    endpointProfSchemaName.getElement().getStyle().setCursor(Style.Cursor.POINTER);

    HorizontalPanel schemaNamePanel = new HorizontalPanel();
    schemaNamePanel.setHeight("40px");
    schemaNamePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    schemaNamePanel.add(endpointProfSchemaLabel);
    schemaNamePanel.add(endpointProfSchemaName);
    schemaNamePanel.setCellWidth(endpointProfSchemaName, "200px");
    endpointProfSchemaName.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);

    HorizontalPanel schemaButtonsPanel = new HorizontalPanel();
    schemaButtonsPanel.setSpacing(6);
    downloadEndpointProfileJsonButton = new ImageTextButton(Utils.resources.download(),
            Utils.constants.downloadJson());
    schemaButtonsPanel.add(downloadEndpointProfileJsonButton);
    schemaNamePanel.add(schemaButtonsPanel);
    schemaButtonsPanel.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);

    recordTable.setWidget(0, 0, schemaNamePanel);

    endpointProfForm = new RecordPanel(new AvroWidgetsConfig.Builder().recordPanelWidth(700).createConfig(),
            Utils.constants.profile(), this, true, true);
    endpointProfForm.getRecordWidget().setForceNavigation(true);
    endpointProfForm.setPreferredHeightPx(200);
    recordTable.setWidget(1, 0, endpointProfForm);
    recordTable.getFlexCellFormatter().setColSpan(1, 0, 2);

    formPanel.add(recordTable);

    detailsTable.setWidget(++row, 0, formPanel);
    detailsTable.getFlexCellFormatter().setColSpan(row, 0, 2);

    formPanel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);

    span = Document.get().createSpanElement();
    span.appendChild(Document.get().createTextNode(Utils.constants.serverProfile()));
    span.addClassName("gwt-Label");

    CaptionPanel serverFormPanel = new CaptionPanel(span.getString(), true);
    FlexTable serverRecordTable = new FlexTable();
    serverRecordTable.setWidth("100%");

    Label serverProfSchemaLabel = new Label(Utils.constants.schemaName());
    serverProfSchemaName = new Anchor();
    serverProfSchemaName.getElement().getStyle().setCursor(Style.Cursor.POINTER);

    schemaNamePanel = new HorizontalPanel();
    schemaNamePanel.setHeight("40px");
    schemaNamePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    schemaNamePanel.add(serverProfSchemaLabel);
    schemaNamePanel.add(serverProfSchemaName);
    schemaNamePanel.setCellWidth(serverProfSchemaName, "200px");
    serverProfSchemaName.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);

    schemaButtonsPanel = new HorizontalPanel();
    schemaButtonsPanel.setSpacing(6);
    downloadServerProfileJsonButton = new ImageTextButton(Utils.resources.download(),
            Utils.constants.downloadJson());
    schemaButtonsPanel.add(downloadServerProfileJsonButton);
    editServerProfileButton = new Button(Utils.constants.edit());
    schemaButtonsPanel.add(editServerProfileButton);
    schemaNamePanel.add(schemaButtonsPanel);
    schemaButtonsPanel.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);

    serverRecordTable.setWidget(0, 0, schemaNamePanel);
    serverProfForm = new RecordPanel(new AvroWidgetsConfig.Builder().recordPanelWidth(700).createConfig(),
            Utils.constants.profile(), this, true, true);
    serverProfForm.getRecordWidget().setForceNavigation(true);
    serverProfForm.setPreferredHeightPx(200);
    serverRecordTable.setWidget(1, 0, serverProfForm);
    serverRecordTable.getFlexCellFormatter().setColSpan(1, 0, 2);

    serverFormPanel.add(serverRecordTable);

    detailsTable.setWidget(++row, 0, serverFormPanel);
    detailsTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    serverFormPanel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);

    groupsGrid = new EndpointGroupGrid(true);
    groupsGrid.setSize("100%", "200px");
    Label groupsLabel = new Label(Utils.constants.endpointGroups());
    detailsTable.setWidget(++row, 0, groupsLabel);
    groupsLabel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
    detailsTable.setWidget(++row, 0, groupsGrid);
    groupsGrid.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
    detailsTable.getFlexCellFormatter().setColSpan(row, 0, 2);

    topicsGrid = new TopicGrid(false, true);
    topicsGrid.setSize("100%", "200px");
    Label topicLabel = new Label(Utils.constants.subscribedOnNfTopics());
    topicLabel.addStyleName(Utils.kaaAdminStyle.bAppContentTitleLabel());
    detailsTable.setWidget(++row, 0, topicLabel);
    detailsTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    topicLabel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
    detailsTable.setWidget(++row, 0, topicsGrid);
    detailsTable.getFlexCellFormatter().setColSpan(row, 0, 2);
    topicsGrid.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
}

From source file:org.kaaproject.kaa.server.admin.client.mvp.view.widget.RecordPanel.java

License:Apache License

public void setTitle(String title) {
    if (showCaption) {
        if (optional) {
            recordCaption.setCaptionText(title);
        } else {/* ww  w  . j  a v  a2s  . c o  m*/
            SpanElement span = Document.get().createSpanElement();
            span.appendChild(Document.get().createTextNode(title));
            span.addClassName("gwt-Label");
            span.addClassName(REQUIRED);
            recordCaption.setCaptionHTML(span.getString());
        }
    }
}