Search in sources :

Example 1 with ConnectionCreateCommand

use of org.whole.lang.ui.commands.ConnectionCreateCommand in project whole by wholeplatform.

the class WholeNodeEditPolicy method getConnectionCreateCommand.

protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
    FeatureDescriptor fd = getNodeEditPart().getSourceConnectionFeature(request);
    if (fd == null)
        return UnexecutableCommand.INSTANCE;
    ConnectionCreateCommand cmd = new ConnectionCreateCommand();
    cmd.setSource(getNode());
    cmd.setSourceFeature(fd);
    request.setStartCommand(cmd);
    return cmd;
}
Also used : FeatureDescriptor(org.whole.lang.reflect.FeatureDescriptor) ConnectionCreateCommand(org.whole.lang.ui.commands.ConnectionCreateCommand)

Example 2 with ConnectionCreateCommand

use of org.whole.lang.ui.commands.ConnectionCreateCommand in project whole by wholeplatform.

the class WholeNodeEditPolicy method getConnectionCompleteCommand.

protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
    FeatureDescriptor fd = getNodeEditPart().getTargetConnectionFeature(request);
    if (fd == null)
        return UnexecutableCommand.INSTANCE;
    ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
    if (cmd == null)
        return UnexecutableCommand.INSTANCE;
    cmd.setConnection((IEntity) request.getNewObject());
    cmd.setTarget(getNode());
    cmd.setTargetFeature(fd);
    return cmd;
}
Also used : FeatureDescriptor(org.whole.lang.reflect.FeatureDescriptor) ConnectionCreateCommand(org.whole.lang.ui.commands.ConnectionCreateCommand)

Aggregations

FeatureDescriptor (org.whole.lang.reflect.FeatureDescriptor)2 ConnectionCreateCommand (org.whole.lang.ui.commands.ConnectionCreateCommand)2