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;
}
Aggregations