Search in sources :

Example 1 with ApplicationVertex

use of org.opennms.features.topology.plugins.topo.application.ApplicationVertex in project opennms by OpenNMS.

the class ApplicationSelectionLinkGenerator method generateCell.

@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;
        }
    }
}
Also used : Button(com.vaadin.ui.Button) ApplicationVertex(org.opennms.features.topology.plugins.topo.application.ApplicationVertex)

Aggregations

Button (com.vaadin.ui.Button)1 ApplicationVertex (org.opennms.features.topology.plugins.topo.application.ApplicationVertex)1