use of org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea in project tdi-studio-se by Talend.
the class DropContextAnalyzer method checkDropIsValid.
private boolean checkDropIsValid() {
if (objects == null || objects.getToTransfer().isEmpty() || targetEditPart == null) {
return false;
}
Object targetModel = targetEditPart.getModel();
targetFigure = targetEditPart.getFigure().findFigureAt(dropLocation.x, dropLocation.y);
boolean isTragetOutputNode = targetModel instanceof OutputTreeNode;
boolean isTragetInputNode = targetModel instanceof TreeNode && !(targetModel instanceof OutputTreeNode);
boolean isVar = targetModel instanceof VarNode;
boolean isDropInputTree = targetModel instanceof InputXmlTree;
boolean isDropOutputTree = targetModel instanceof OutputXmlTree;
boolean isDropVarTable = targetModel instanceof VarTable;
// drop expression
if (targetFigure instanceof ExpressionFigure) {
dropType = DropType.DROP_EXPRESSION;
if (isTragetOutputNode) {
// INPUT => OUTPUT
return XmlMapUtil.isExpressionEditable((TreeNode) targetModel);
} else if (isTragetInputNode) {
// INPUT => INPUT ,can't dnd in the same tree
boolean isValid = checkDropInputValid(targetModel);
if (isValid) {
isValid = XmlMapUtil.isExpressionEditable((TreeNode) targetModel);
}
return isValid;
}
return true;
} else // drop tree filter
if (targetFigure instanceof FilterTextArea) {
dropType = DropType.DROP_FILTER;
return true;
} else {
if (objects.getType() == TransferdType.INPUT) {
if (isTragetOutputNode) {
return checkDropOutputDocChildValid(targetModel);
} else if (isVar || isDropVarTable) {
dropType = DropType.DROP_INSERT_VAR;
return true;
} else if (isDropInputTree) {
dropType = DropType.DROP_INSERT_INPUT;
return checkDropInputValid(targetModel);
} else if (isDropOutputTree) {
dropType = DropType.DROP_INSERT_OUTPUT;
return true;
}
} else if (objects.getType() == TransferdType.VAR) {
if (isTragetOutputNode) {
return checkDropOutputDocChildValid(targetModel);
} else if (isDropOutputTree) {
dropType = DropType.DROP_INSERT_OUTPUT;
return true;
}
}
}
return false;
}
use of org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea 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);
}
}
}
}
}
use of org.talend.designer.gefabstractmap.figures.treesettings.FilterTextArea 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