use of org.talend.designer.xmlmap.editor.XmlMapGraphicViewer in project tdi-studio-se by Talend.
the class OutputTreeNodeEditPart method notifyChanged.
@Override
public void notifyChanged(Notification notification) {
super.notifyChanged(notification);
int type = notification.getEventType();
int featureId = notification.getFeatureID(XmlmapPackage.class);
switch(type) {
case Notification.SET:
switch(featureId) {
case XmlmapPackage.TREE_NODE__TYPE:
if (XmlMapUtil.DOCUMENT.equals(notification.getOldValue()) || !XmlMapUtil.DOCUMENT.equals(notification.getOldValue()) && XmlMapUtil.DOCUMENT.equals(notification.getNewValue())) {
MapperTablePart mapperTablePart = MapperUtils.getMapperTablePart(this);
if (mapperTablePart.getFigure() instanceof OutputXmlTreeFigure) {
((OutputXmlTreeFigure) mapperTablePart.getFigure()).update(XmlmapPackage.TREE_NODE__TYPE);
}
}
break;
case XmlmapPackage.TREE_NODE__LOOP:
((XmlmapTreeNodeFigure) getFigure()).getBranchContent().updateLoopButtonFigure();
AbstractInOutTree abstractInOutTree = XmlMapUtil.getAbstractInOutTree((OutputTreeNode) getModel());
if (abstractInOutTree != null) {
((XmlMapGraphicViewer) getViewer()).getMapperManager().getProblemsAnalyser().checkProblems(abstractInOutTree);
((XmlMapGraphicViewer) getViewer()).getMapperManager().getMapperUI().updateStatusBar();
}
}
break;
case Notification.REMOVE:
case Notification.REMOVE_MANY:
switch(featureId) {
}
// }
case Notification.ADD:
case Notification.ADD_MANY:
switch(featureId) {
case XmlmapPackage.INPUT_LOOP_NODES_TABLE__INPUTLOOPNODES:
case XmlmapPackage.OUTPUT_TREE_NODE__INPUT_LOOP_NODES_TABLE:
XmlmapTreeNodeFigure outputFigure = (XmlmapTreeNodeFigure) getFigure();
if (outputFigure.getElement() != null) {
outputFigure.getBranchContent().updateLoopButtonFigure();
}
break;
default:
break;
}
}
}
Aggregations