use of org.eclipse.gef.requests.CreationFactory in project dbeaver by serge-rider.
the class NodeDropTargetListener method createTargetRequest.
@Override
protected Request createTargetRequest() {
CreateRequest request = new CreateRequest();
request.setFactory(new CreationFactory() {
@Override
public Object getNewObject() {
Collection<DBPNamedObject> objects = DatabaseObjectTransfer.getInstance().getObject();
if (objects == null) {
return null;
}
return DiagramObjectCollector.generateEntityList(((DiagramPart) getViewer().getRootEditPart().getContents()).getDiagram(), objects);
}
@Override
public Object getObjectType() {
return RequestConstants.REQ_CREATE;
}
});
request.setLocation(getDropLocation());
return request;
}
use of org.eclipse.gef.requests.CreationFactory in project tdi-studio-se by Talend.
the class ComponentChooseDialog method createTargetRequest.
@Override
protected Request createTargetRequest() {
fromPalette = false;
CreateRequest request = new CreateRequest();
CreationFactory factory = getFactory(LocalSelectionTransfer.getTransfer().getSelection());
if (factory != null) {
fromPalette = true;
request.setFactory(factory);
return request;
}
return super.createTargetRequest();
}
Aggregations