@Override
public void handleEvent(Event event) {
Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
if (changedObj instanceof MPartSashContainer) {
MPartSashContainer parent = (MPartSashContainer) changedObj;
if (BaseSashRenderer.this == parent.getRenderer()) {
String eventType = (String) event.getProperty(UIEvents.EventTags.TYPE);
if (UIEvents.EventTypes.ADD.equals(eventType)) {
MUIElement element = (MUIElement) event.getProperty(UIEvents.EventTags.NEW_VALUE);
handleChildAddition(parent, (MPartSashContainerElement) element);
} else if (UIEvents.EventTypes.REMOVE.equals(eventType)) {
MUIElement element = (MUIElement) event.getProperty(UIEvents.EventTags.OLD_VALUE);
handleChildRemove(parent, (MPartSashContainerElement) element);
}
}
}
}
});
eventBroker.subscribe(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT, new EventHandler() {
@Override
public void handleEvent(Event event) {
Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
if (changedObj instanceof MPartSashContainer) {
MPartSashContainer parent = (MPartSashContainer) changedObj;
if (BaseSashRenderer.this == parent.getRenderer()) {
String eventType = (String) event.getProperty(UIEvents.EventTags.TYPE);
if (UIEvents.EventTypes.SET.equals(eventType)) {
MUIElement newValue = (MUIElement) event.getProperty(UIEvents.EventTags.NEW_VALUE);
MUIElement oldValue = (MUIElement) event.getProperty(UIEvents.EventTags.OLD_VALUE);
handleSelectedElement(parent, (MPartSashContainerElement) oldValue, (MPartSashContainerElement) newValue);
}
}
}
}
});
eventBroker.subscribe(UIEvents.UIElement.TOPIC_VISIBLE, new EventHandler() {
@Override
public void handleEvent(Event event) {
MUIElement changedObj = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
if (changedObj.isToBeRendered()) {
MUIElement parent = changedObj.getParent();
if( parent != null ) {
if (BaseSashRenderer.this == parent.getRenderer()) {
MPartSashContainer stack = (MPartSashContainer) parent;
String eventType = (String) event.getProperty(UIEvents.EventTags.TYPE);
if (UIEvents.EventTypes.SET.equals(eventType)) {
Boolean newValue = (Boolean) event.getProperty(UIEvents.EventTags.NEW_VALUE);
if (newValue.booleanValue()) {
// TODO Is childRendered not dangerous to call