Search in sources :

Example 16 with DirectEditRequest

use of org.eclipse.gef.requests.DirectEditRequest in project tdi-studio-se by Talend.

the class DataBusinessItemNameEditPart method performDirectEditRequest.

/**
     * @generated
     */
protected void performDirectEditRequest(Request request) {
    final Request theRequest = request;
    try {
        getEditingDomain().runExclusive(new Runnable() {

            public void run() {
                if (isActive() && isEditable()) {
                    if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
                        Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
                        performDirectEdit(initialChar.charValue());
                    } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
                        DirectEditRequest editRequest = (DirectEditRequest) theRequest;
                        performDirectEdit(editRequest.getLocation());
                    } else {
                        performDirectEdit();
                    }
                }
            }
        });
    } catch (InterruptedException e) {
        // e.printStackTrace();
        ExceptionHandler.process(e);
    }
}
Also used : DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) Request(org.eclipse.gef.Request) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest)

Example 17 with DirectEditRequest

use of org.eclipse.gef.requests.DirectEditRequest in project tdi-studio-se by Talend.

the class DatabaseBusinessItemNameEditPart method performDirectEditRequest.

/**
     * @generated
     */
protected void performDirectEditRequest(Request request) {
    final Request theRequest = request;
    try {
        getEditingDomain().runExclusive(new Runnable() {

            public void run() {
                if (isActive() && isEditable()) {
                    if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
                        Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
                        performDirectEdit(initialChar.charValue());
                    } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
                        DirectEditRequest editRequest = (DirectEditRequest) theRequest;
                        performDirectEdit(editRequest.getLocation());
                    } else {
                        performDirectEdit();
                    }
                }
            }
        });
    } catch (InterruptedException e) {
        // e.printStackTrace();
        ExceptionHandler.process(e);
    }
}
Also used : DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest) Request(org.eclipse.gef.Request) DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest)

Example 18 with DirectEditRequest

use of org.eclipse.gef.requests.DirectEditRequest in project tdi-studio-se by Talend.

the class MapperSelectEditPartTracker method performDirectEdit.

@Override
protected void performDirectEdit() {
    DirectEditRequest req = new DirectEditRequest();
    req.setLocation(getCurrentInput().getMouseLocation());
    new DelayedDirectEditHelper(getSourceEditPart().getViewer(), req, getSourceEditPart());
}
Also used : DirectEditRequest(org.eclipse.gef.requests.DirectEditRequest)

Example 19 with DirectEditRequest

use of org.eclipse.gef.requests.DirectEditRequest in project tdi-studio-se by Talend.

the class GlobalMapNodeEditPart method performRequest.

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

Example 20 with DirectEditRequest

use of org.eclipse.gef.requests.DirectEditRequest 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

DirectEditRequest (org.eclipse.gef.requests.DirectEditRequest)21 Request (org.eclipse.gef.Request)14 IFigure (org.eclipse.draw2d.IFigure)6 Point (org.eclipse.draw2d.geometry.Point)6 XmlMapNodeCellEditorLocator (org.talend.designer.gefabstractmap.part.directedit.XmlMapNodeCellEditorLocator)6 XmlMapNodeDirectEditManager (org.talend.designer.xmlmap.parts.directedit.XmlMapNodeDirectEditManager)6 Figure (org.eclipse.draw2d.Figure)3 IWidgetCell (org.talend.designer.gefabstractmap.figures.cells.IWidgetCell)3 TableTreeEntityFigure (org.talend.designer.gefabstractmap.figures.table.entity.TableTreeEntityFigure)2 FilterTextArea (org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea)2 ArrayList (java.util.ArrayList)1 ImageFigure (org.eclipse.draw2d.ImageFigure)1 Label (org.eclipse.draw2d.Label)1 ExpressionFigure (org.talend.designer.gefabstractmap.figures.ExpressionFigure)1 VarEntityFigure (org.talend.designer.gefabstractmap.figures.var.VarEntityFigure)1 GlobalMapKeysEntityFigure (org.talend.designer.xmlmap.figures.GlobalMapKeysEntityFigure)1 XmlmapTreeNodeFigure (org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure)1 VarNodeFigure (org.talend.designer.xmlmap.figures.varnode.VarNodeFigure)1 AbstractInOutTree (org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree)1 OutputTreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)1