Search in sources :

Example 1 with IWidgetCell

use of org.talend.designer.gefabstractmap.figures.cells.IWidgetCell in project tdi-studio-se by Talend.

the class OutputXmlTreeEditPart method performRequest.

@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_DIRECT_EDIT.equals(req.getType())) {
        DirectEditRequest drequest = (DirectEditRequest) req;
        Point figureLocation = drequest.getLocation();
        IFigure findFigureAt = getFigure().findFigureAt(figureLocation.x, figureLocation.y);
        if (findFigureAt != null && findFigureAt instanceof IWidgetCell) {
            directEditManager = new XmlMapNodeDirectEditManager(this, new XmlMapNodeCellEditorLocator((Figure) findFigureAt));
            directEditManager.show();
        }
        if (directEditManager != null) {
            if (findFigureAt != null && findFigureAt instanceof FilterTextArea) {
                if (figure.containsPoint(figureLocation)) {
                    directEditManager.show();
                    ((XmlMapGraphicViewer) getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
                }
            }
        }
    }
}
Also used : XmlMapNodeDirectEditManager(org.talend.designer.xmlmap.parts.directedit.XmlMapNodeDirectEditManager) XmlMapNodeCellEditorLocator(org.talend.designer.gefabstractmap.part.directedit.XmlMapNodeCellEditorLocator) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) FilterTextArea(org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea) Point(org.eclipse.draw2d.geometry.Point) IWidgetCell(org.talend.designer.gefabstractmap.figures.cells.IWidgetCell) IFigure(org.eclipse.draw2d.IFigure)

Example 2 with IWidgetCell

use of org.talend.designer.gefabstractmap.figures.cells.IWidgetCell in project tdi-studio-se by Talend.

the class TreeNodeEditPart method performRequest.

@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_DIRECT_EDIT.equals(req.getType())) {
        Figure figure = null;
        DirectEditRequest drequest = (DirectEditRequest) req;
        Point figureLocation = drequest.getLocation();
        if (getFigure() instanceof TableTreeEntityFigure) {
            XmlmapTreeNodeFigure treeNodeFigure = (XmlmapTreeNodeFigure) getFigure();
            ArrayList collection = new ArrayList();
            collection.add(treeNodeFigure.getExpressionFigure());
            collection.add(treeNodeFigure.getBranchContent());
            figure = (Figure) treeNodeFigure.findFigureAt(figureLocation.x, figureLocation.y, new FigureSearch(collection));
        }
        if (figure instanceof IWidgetCell) {
            directEditManager = new XmlMapNodeDirectEditManager(this, new XmlMapNodeCellEditorLocator(figure, this));
        }
        if (directEditManager != null) {
            TreeNode outputTreeNode = (TreeNode) getModel();
            if (figure instanceof ExpressionFigure) {
                if (XmlMapUtil.isExpressionEditable(outputTreeNode)) {
                    Point location = drequest.getLocation();
                    if (figure.containsPoint(location)) {
                        directEditManager.show();
                        ((XmlMapGraphicViewer) getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
                    }
                }
            } else if (!(((TreeNode) getModel()).eContainer() instanceof AbstractInOutTree)) {
            // disable for RC2
            // directEditManager.show();
            // ((XmlMapGraphicViewer)
            // getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
            }
        }
    }
    super.performRequest(req);
}
Also used : XmlMapNodeDirectEditManager(org.talend.designer.xmlmap.parts.directedit.XmlMapNodeDirectEditManager) TableTreeEntityFigure(org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure) ArrayList(java.util.ArrayList) AbstractInOutTree(org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree) Point(org.eclipse.draw2d.geometry.Point) XmlmapTreeNodeFigure(org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure) IFigure(org.eclipse.draw2d.IFigure) ExpressionFigure(org.talend.designer.gefabstractmap.figures.ExpressionFigure) XmlmapTreeNodeFigure(org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure) TableTreeEntityFigure(org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure) Figure(org.eclipse.draw2d.Figure) XmlMapNodeCellEditorLocator(org.talend.designer.gefabstractmap.part.directedit.XmlMapNodeCellEditorLocator) ExpressionFigure(org.talend.designer.gefabstractmap.figures.ExpressionFigure) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode) TreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode) IWidgetCell(org.talend.designer.gefabstractmap.figures.cells.IWidgetCell)

Example 3 with IWidgetCell

use of org.talend.designer.gefabstractmap.figures.cells.IWidgetCell in project tdi-studio-se by Talend.

the class InputXmlTreeEditPart method performRequest.

@Override
public void performRequest(Request req) {
    if (RequestConstants.REQ_DIRECT_EDIT.equals(req.getType())) {
        DirectEditRequest drequest = (DirectEditRequest) req;
        Point figureLocation = drequest.getLocation();
        IFigure findFigureAt = getFigure().findFigureAt(figureLocation.x, figureLocation.y);
        if (findFigureAt != null && findFigureAt instanceof IWidgetCell) {
            directEditManager = new XmlMapNodeDirectEditManager(this, new XmlMapNodeCellEditorLocator((Figure) findFigureAt));
            directEditManager.show();
        }
        if (directEditManager != null) {
            if (findFigureAt != null && findFigureAt instanceof FilterTextArea) {
                if (figure.containsPoint(figureLocation)) {
                    directEditManager.show();
                    ((XmlMapGraphicViewer) getViewer()).getMapperManager().setCurrentDirectEditManager(directEditManager);
                }
            }
        }
    }
}
Also used : XmlMapNodeDirectEditManager(org.talend.designer.xmlmap.parts.directedit.XmlMapNodeDirectEditManager) XmlMapNodeCellEditorLocator(org.talend.designer.gefabstractmap.part.directedit.XmlMapNodeCellEditorLocator) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) FilterTextArea(org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea) Point(org.eclipse.draw2d.geometry.Point) IWidgetCell(org.talend.designer.gefabstractmap.figures.cells.IWidgetCell) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

IFigure (org.eclipse.draw2d.IFigure)3 Point (org.eclipse.draw2d.geometry.Point)3 DirectEditRequest (org.eclipse.gef.requests.DirectEditRequest)3 IWidgetCell (org.talend.designer.gefabstractmap.figures.cells.IWidgetCell)3 XmlMapNodeCellEditorLocator (org.talend.designer.gefabstractmap.part.directedit.XmlMapNodeCellEditorLocator)3 XmlMapNodeDirectEditManager (org.talend.designer.xmlmap.parts.directedit.XmlMapNodeDirectEditManager)3 FilterTextArea (org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea)2 ArrayList (java.util.ArrayList)1 Figure (org.eclipse.draw2d.Figure)1 ExpressionFigure (org.talend.designer.gefabstractmap.figures.ExpressionFigure)1 TableTreeEntityFigure (org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure)1 XmlmapTreeNodeFigure (org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure)1 AbstractInOutTree (org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree)1 OutputTreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)1 TreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode)1