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);
}
}
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);
}
}
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());
}
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);
}
}
}
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);
}
}
}
}
}
Aggregations