本文整理了Java中com.vaadin.v7.ui.Table.getContainerProperty()
方法的一些代码示例,展示了Table.getContainerProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getContainerProperty()
方法的具体详情如下:
包路径:com.vaadin.v7.ui.Table
类名称:Table
方法名:getContainerProperty
暂无
代码示例来源:origin: OpenNMS/opennms
@Override
public String getStyle(Table source, Object itemId, Object propertyId) {
if (propertyId == null && source.getContainerProperty(itemId, "severityId") != null) {
Integer severity = (Integer) source.getContainerProperty(itemId, "severityId").getValue();
Property<?> prop = source.getContainerProperty(itemId, "acknowledged");
Boolean acknowledged = false;
if (prop != null) {
acknowledged = (Boolean) prop.getValue();
}
return renderer.getStyle(severity, acknowledged.booleanValue());
} else if ("severity".equals(propertyId)) {
return "bright";
}
return null;
}
代码示例来源:origin: OpenNMS/opennms
public Set<Integer> getSelectedIds(Table source) {
if (m_selectAll) {
Set<Integer> selected = new TreeSet<Integer>();
for (Object eachItemId : source.getItemIds()) {
Property<Integer> property = source.getContainerProperty(eachItemId, m_valueProperty);
if (property == null) continue;
selected.add(property.getValue());
}
//remove unselected
selected.removeAll(m_notSelectedCheckboxes);
return selected;
}
return Collections.unmodifiableSet(m_selectedCheckboxes);
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property<String> property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
return property.getValue();
}
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property<OnmsSeverity> property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
OnmsSeverity severity = property.getValue();
String label = severity.getLabel();
label = label.toLowerCase();
label = new String(label.substring(0, 1)).toUpperCase() + label.substring(1);
return new Label(" " + escapeHtml(label), Label.CONTENT_XML);
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void buttonClick(ClickEvent event) {
Integer nodeId = nodeIdProperty.getValue();
String nodeLabel = (String)source.getContainerProperty(itemId, m_nodeLabelProperty).getValue();
VertexRef vertexRef = new DefaultVertexRef("nodes", String.valueOf(nodeId), nodeLabel);
fireVertexUpdatedEvent(vertexRef);
}
});
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property<OnmsIpInterface> property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
return property.getValue().getIpAddressAsString();
}
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property<?> property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
return InetAddressUtils.str((InetAddress)property.getValue());
}
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property<OnmsServiceType> property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
return property.getValue().getName();
}
}
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
unregisterComponent((Component) cellVal);
} else {
Property<?> p = getContainerProperty(
pageBuffer[CELL_ITEMID][i + ix], colids[c]);
if (p instanceof ValueChangeNotifier
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(final Table source, final Object itemId, Object columnId) {
final Property<Integer> idProperty = source.getContainerProperty(itemId, idPropertyName);
final Property<String> labelProperty = source.getContainerProperty(itemId, labelPropertyName);
Object cellValue = columnGenerator.generateCell(source, itemId, columnId);
if (cellValue == null) {
return null;
} else {
if (idProperty.getValue() == null) {
return cellValue;
} else {
Button button = new Button(cellValue.toString());
button.setStyleName(BaseTheme.BUTTON_LINK);
button.setDescription(idProperty.getValue().toString());
button.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
Integer applicationId = idProperty.getValue();
String applicationName = labelProperty.getValue();
ApplicationVertex vertex = new ApplicationVertex(applicationId.toString(), applicationName);
fireVertexUpdatedEvent(vertex);
}
});
return button;
}
}
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
@SuppressWarnings("unchecked")
public Object generateCell(final Table source, final Object itemId, Object columnId) {
final Property<Long> idProperty = source.getContainerProperty(itemId, m_idPropertyName);
final Property<String> labelProperty = source.getContainerProperty(itemId, m_labelPropertyName);
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility
@Before
public void setUp() throws Exception {
definition = new BooleanPropertyColumnDefinition();
formatter = new BooleanPropertyColumnFormatter(definition);
table = mock(Table.class);
doAnswer(new Answer<Property<?>>() {
@Override
public Property<?> answer(InvocationOnMock invocation) throws Throwable {
FooItem foo = invocation.getArgumentAt(0, FooItem.class);
Object value = foo.getPropertyValue();
return value != null ? new ObjectProperty<>(value) : null;
}
}).when(table).getContainerProperty(any(FooItem.class), any());
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final Property<Integer> property = source.getContainerProperty(itemId, m_valueProperty);
if (property.getValue() == null) {
return null;
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final ZoneId userTimeZoneId = UserTimeZoneExtractor.extractUserTimeZoneIdOrNull(source.getUI());
final Property property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
}
String formattedValue;
if(property.getType().equals(Instant.class)){
formattedValue = timeformatService.format((Instant) property.getValue(), userTimeZoneId);
} else if(property.getType().equals(Date.class)){
formattedValue = timeformatService.format((Date) property.getValue(), userTimeZoneId);
} else {
formattedValue = property.toString();
}
return formattedValue;
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(final Table source, final Object itemId, Object columnId) {
final Property<Integer> nodeIdProperty = source.getContainerProperty(itemId, m_nodeIdProperty);
Object cellValue = m_generator.generateCell(source, itemId, columnId);
if (cellValue == null) {
return null;
} else {
if (nodeIdProperty.getValue() == null) {
return cellValue;
} else {
Button button = new Button(cellValue.toString());
button.setStyleName(BaseTheme.BUTTON_LINK);
button.setDescription(nodeIdProperty.getValue().toString());
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Integer nodeId = nodeIdProperty.getValue();
String nodeLabel = (String)source.getContainerProperty(itemId, m_nodeLabelProperty).getValue();
VertexRef vertexRef = new DefaultVertexRef("nodes", String.valueOf(nodeId), nodeLabel);
fireVertexUpdatedEvent(vertexRef);
}
});
return button;
}
}
}
}
代码示例来源:origin: OpenNMS/opennms
@Override
public Object generateCell(final Table source, Object itemId, Object columnId) {
if (source == null) return null; // no source
Property<Integer> alarmIdProperty = source.getContainerProperty(itemId, alarmIdPropertyName);
final Integer alarmId = alarmIdProperty.getValue();
if (alarmId == null) return null; // no value
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
p = getContainerProperty(id, colids[j]);
} catch (Exception e) {
exceptionsDuringCachePopulation.add(e);
内容来源于网络,如有侵权,请联系作者删除!