Search in sources :

Example 6 with XmlMapGraphicViewer

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;
            }
    }
}
Also used : AbstractInOutTree(org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree) XmlmapTreeNodeFigure(org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure) MapperTablePart(org.talend.designer.gefabstractmap.part.MapperTablePart) OutputXmlTreeFigure(org.talend.designer.xmlmap.figures.OutputXmlTreeFigure) XmlMapGraphicViewer(org.talend.designer.xmlmap.editor.XmlMapGraphicViewer)

Aggregations

XmlMapGraphicViewer (org.talend.designer.xmlmap.editor.XmlMapGraphicViewer)6 Command (org.eclipse.gef.commands.Command)3 MapperManager (org.talend.designer.xmlmap.ui.tabs.MapperManager)3 Point (org.eclipse.draw2d.geometry.Point)2 EditPart (org.eclipse.gef.EditPart)2 TransferedObject (org.talend.designer.gefabstractmap.dnd.TransferedObject)2 MapperTablePart (org.talend.designer.gefabstractmap.part.MapperTablePart)2 OutputXmlTreeFigure (org.talend.designer.xmlmap.figures.OutputXmlTreeFigure)2 OutputTreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)2 OutputTreeNodeEditPart (org.talend.designer.xmlmap.parts.OutputTreeNodeEditPart)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 CommandStack (org.eclipse.gef.commands.CommandStack)1 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)1 Shell (org.eclipse.swt.widgets.Shell)1 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)1 MetadataTable (org.talend.core.model.metadata.MetadataTable)1 TableEntityPart (org.talend.designer.gefabstractmap.part.TableEntityPart)1 CreateDocChildrenCommand (org.talend.designer.xmlmap.commands.CreateDocChildrenCommand)1 DirectEditCommand (org.talend.designer.xmlmap.commands.DirectEditCommand)1