use of org.apache.syncope.client.console.topology.TopologyTogglePanel.UpdateEvent in project syncope by apache.
the class TopologyNodePanel method onEvent.
@Override
public void onEvent(final IEvent<?> event) {
if (event.getPayload() instanceof UpdateEvent) {
final UpdateEvent updateEvent = UpdateEvent.class.cast(event.getPayload());
final String key = updateEvent.getKey();
final AjaxRequestTarget target = updateEvent.getTarget();
if (node.getKind() == Kind.CONNECTOR && key.equalsIgnoreCase(node.getKey())) {
ConnInstanceTO conn = new ConnectorRestClient().read(key);
String displayName = // [SYNCOPE-1233]
StringUtils.isBlank(conn.getDisplayName()) ? conn.getBundleName() : conn.getDisplayName();
final String resourceName = displayName.length() > 14 ? displayName.subSequence(0, 10) + "..." : displayName;
label.setDefaultModelObject(resourceName);
target.add(label);
node.setDisplayName(displayName);
}
}
}
Aggregations