Search in sources :

Example 1 with LabelWithTextTruncation

use of org.ovirt.engine.ui.common.widget.label.LabelWithTextTruncation in project ovirt-engine by oVirt.

the class NetworkLabelPanel method getContents.

@Override
protected Widget getContents() {
    VerticalPanel vPanel = new VerticalPanel();
    // $NON-NLS-1$
    vPanel.addStyleName("ts5");
    // $NON-NLS-1$
    vPanel.setWidth("100%");
    Grid titleRow = new Grid(1, 2);
    // $NON-NLS-1$
    titleRow.addStyleName("ts3");
    ColumnFormatter columnFormatter = titleRow.getColumnFormatter();
    // $NON-NLS-1$
    columnFormatter.setWidth(0, "30px");
    // $NON-NLS-1$
    columnFormatter.setWidth(1, "100%");
    // $NON-NLS-1$
    titleRow.setWidth("100%");
    // $NON-NLS-1$
    titleRow.setHeight("27px");
    LabelWithTextTruncation titleLabel = new LabelWithTextTruncation(item.getName());
    // $NON-NLS-1$
    titleLabel.setWidth("185px");
    // $NON-NLS-1$
    titleLabel.setHeight("100%");
    Image labelImage = new Image(resources.tagImage());
    titleRow.setWidget(0, 0, labelImage);
    titleRow.setWidget(0, 1, titleLabel);
    // $NON-NLS-1$
    titleRow.addStyleName("ts3");
    // $NON-NLS-1$
    titleRow.addStyleName("tp3");
    vPanel.add(titleRow);
    addClassName();
    List<LogicalNetworkModel> networks = item.getNetworks();
    Collections.sort(networks);
    for (LogicalNetworkModel network : networks) {
        InternalNetworkPanel networkPanel = new InternalNetworkPanel(network, style, false);
        networkPanel.parentPanel = this;
        vPanel.add(networkPanel);
    }
    return vPanel;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Grid(com.google.gwt.user.client.ui.Grid) LogicalNetworkModel(org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel) Image(com.google.gwt.user.client.ui.Image) ColumnFormatter(com.google.gwt.user.client.ui.HTMLTable.ColumnFormatter) LabelWithTextTruncation(org.ovirt.engine.ui.common.widget.label.LabelWithTextTruncation)

Aggregations

Grid (com.google.gwt.user.client.ui.Grid)1 ColumnFormatter (com.google.gwt.user.client.ui.HTMLTable.ColumnFormatter)1 Image (com.google.gwt.user.client.ui.Image)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1 LabelWithTextTruncation (org.ovirt.engine.ui.common.widget.label.LabelWithTextTruncation)1 LogicalNetworkModel (org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel)1