本文整理汇总了Java中org.eclipse.gef.requests.CreateConnectionRequest.getStartCommand方法的典型用法代码示例。如果您正苦于以下问题:Java CreateConnectionRequest.getStartCommand方法的具体用法?Java CreateConnectionRequest.getStartCommand怎么用?Java CreateConnectionRequest.getStartCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.CreateConnectionRequest
的用法示例。
在下文中一共展示了CreateConnectionRequest.getStartCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(
CreateConnectionRequest request) {
LinkCommand command = (LinkCommand) request
.getStartCommand();
command.setTarget(getComponentEditPart().getCastedModel());
ConnectionAnchor ctor = getComponentEditPart().getTargetConnectionAnchor(
request);
if (ctor == null)
return null;
command.setTargetTerminal(getComponentEditPart()
.mapConnectionAnchorToTerminal(ctor));
return command;
}
示例2: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
final AbstractCreateConnectionCommand command = (AbstractCreateConnectionCommand) request.getStartCommand();
final DiagramWalkerEditPart targetEditPart = (DiagramWalkerEditPart) request.getTargetEditPart();
if (command instanceof AbstractCreateRelationshipCommand) {
if (!(targetEditPart instanceof TableViewEditPart)) {
return null;
}
}
final String validatedMessage = command.validate();
if (validatedMessage != null) {
Activator.showErrorDialog(validatedMessage);
return null;
}
command.setTarget(targetEditPart);
if (!command.canExecute()) {
return null;
}
return command;
}
示例3: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
protected org.eclipse.gef.commands.Command getConnectionCompleteCommand(
CreateConnectionRequest request )
{
ConnectionCommand command = (ConnectionCommand) request.getStartCommand( );
if ( command == null )
return null;
EditPart sourcePart = command.getSource( );
if ( !( getHost( ) instanceof ColumnEditPart )
|| getHost( ) == sourcePart
|| getHost( ).getParent( ) == sourcePart.getParent( ) )
{
return null;
}
ColumnEditPart targetPart = (ColumnEditPart) getHost( );
command.setTarget( targetPart );
AddJoinConditionCommand addJoinConditionCommand = new AddJoinConditionCommand( sourcePart,
targetPart );
return addJoinConditionCommand;
}
示例4: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest req) {
CreateLinkCommand cmd = (CreateLinkCommand) req.getStartCommand();
if (cmd == null)
return null;
ExchangeNode toConnect = (ExchangeNode) req.getTargetEditPart().getModel();
ExchangeNode other = cmd.startedFromOutput ? cmd.output : cmd.input;
if (!toConnect.matches(other) || toConnect.parent().isConnected(toConnect.exchange.getId())) {
cmd.completeWith(null);
req.setStartCommand(cmd);
return null;
}
cmd.completeWith(toConnect);
req.setStartCommand(cmd);
if (cmd.output == null || cmd.input == null)
return null;
return cmd;
}
示例5: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
LinkCreateCommand cmd = (LinkCreateCommand) request.getStartCommand();
Node end = (Node) getHost().getModel();
Node start = cmd.getSource();
if (end instanceof ReferenceNode && (!(start.getParent().getId().equalsIgnoreCase(end.getParent().getId())))) {
ReferenceNode nd = (ReferenceNode) end;
ServiceNode st = (ServiceNode) start;
if (nd.getIntf().equalsIgnoreCase(st.getIntf())) {
cmd.setTarget(end);
return cmd;
}
}
return null;
}
示例6: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
LinkCreateCommand result = (LinkCreateCommand) request.getStartCommand();
if (getHost().getModel() instanceof GraphElement) {
GraphElement target = (GraphElement) getHost().getModel();
result.setLink((GWLink) request.getNewObject());
result.setTarget(target);
return result;
}
return UnexecutableCommand.INSTANCE;
}
示例7: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
if (request.getStartCommand() != null) {
ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
cmd.setTarget((Table) getHost().getModel());
return cmd;
}
return null;
}
示例8: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
DwParentChildConnectionCreateCommand command = (DwParentChildConnectionCreateCommand)request.getStartCommand();
command.setFeatureModel(featureModel);
command.setTarget((DwFeatureWrapped)getHost().getModel());
return command;
}
示例9: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(final CreateConnectionRequest request) {
final CreateCommentConnectionCommand command = (CreateCommentConnectionCommand) request.getStartCommand();
command.setTarget(request.getTargetEditPart());
if (!command.canExecute()) {
return null;
}
return command;
}
示例10: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command getConnectionCompleteCommand(final CreateConnectionRequest request) {
final AbstractCreateConnectionCommand command = (AbstractCreateConnectionCommand) request.getStartCommand();
final NodeElementEditPart targetEditPart = (NodeElementEditPart) request.getTargetEditPart();
if (command instanceof AbstractCreateRelationCommand) {
if (!(targetEditPart instanceof TableViewEditPart)) {
return null;
}
}
final String validatedMessage = command.validate();
if (validatedMessage != null) {
ERDiagramActivator.showErrorDialog(validatedMessage);
return null;
}
command.setTarget(targetEditPart);
if (!command.canExecute()) {
return null;
}
return command;
}
示例11: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
@Override
protected Command getConnectionCompleteCommand(
CreateConnectionRequest request) {
CreateCommentConnectionCommand command = (CreateCommentConnectionCommand) request
.getStartCommand();
command.setTarget(request.getTargetEditPart());
if (!command.canExecute()) {
return null;
}
return command;
}
示例12: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected Command getConnectionCompleteCommand(
CreateConnectionRequest request) {
AbstractCreateConnectionCommand command = (AbstractCreateConnectionCommand) request
.getStartCommand();
NodeElementEditPart targetEditPart = (NodeElementEditPart) request
.getTargetEditPart();
if (command instanceof AbstractCreateRelationCommand) {
if (!(targetEditPart instanceof TableViewEditPart)) {
return null;
}
}
String validatedMessage = command.validate();
if (validatedMessage != null) {
ERDiagramActivator.showErrorDialog(validatedMessage);
return null;
}
command.setTarget(targetEditPart);
if (!command.canExecute()) {
return null;
}
return command;
}
示例13: setupConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* This method completes and return the creation commands for all {@link Relation}s except for
* {@link Relation}s from type cyclic, irreflexive, acyclic, reflexive and total.
*
* @return {@link ORMRelationCreateCommand}
* */
private ORMRelationCreateCommand setupConnectionCompleteCommand(
final CreateConnectionRequest request) {
final ORMRelationCreateCommand result = (ORMRelationCreateCommand) request.getStartCommand();
result.setTarget(((Relation) getHost().getModel()).getConnectionAnchor());
return result;
}
示例14: getConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*
* @return {@link ORMRelationshipConstraintCreateCommand}( in case a {@link Relation} from type
* cyclic, total, acyclic, reflexive or irreflexive should be created) or {@link ORMRelationCreateCommand}( in
* case any other Relation should be created)
* */
@Override
protected Command getConnectionCompleteCommand(final CreateConnectionRequest request) {
Command retVal = null;
if (!(request.getNewObjectType().equals(Type.RELATIONSHIP_IMPLICATION)||
request.getNewObjectType().equals(Type.RELATIONSHIP_EXCLUSION))) {
if (isCompleteOK(request)) {
retVal = setupConnectionCompleteCommand(request);
}
// Irreflexive Acyclic Total Cyclic Reflexive End
if ((oSTCheck(request, Type.CYCLIC, Type.ROLE_TYPE, Type.ROLE_TYPE)
|| oSTCheck(request, Type.IRREFLEXIVE, Type.ROLE_TYPE, Type.ROLE_TYPE) || oSTCheck(
request, Type.TOTAL, Type.ROLE_TYPE, Type.ROLE_TYPE) || oSTCheck(
request, Type.ACYCLIC, Type.ROLE_TYPE, Type.ROLE_TYPE) || oSTCheck(
request, Type.REFLEXIVE, Type.ROLE_TYPE, Type.ROLE_TYPE))
&& tNotEqualSCheck(request)
&& hasARelationship(request, true) && !hasConstraintsKind(request)) {
final ORMRelationshipConstraintCreateCommand result =
(ORMRelationshipConstraintCreateCommand) request.getStartCommand();
result.setTarget((Shape) getHost().getModel());
ArrayList<Relation> refrencedRelations = new ArrayList<Relation>();
refrencedRelations.add(testedRelationship);
result.setRefrencedRelations(refrencedRelations);
retVal = result;
}
}
return retVal;
}
示例15: setupConnectionCompleteCommand
import org.eclipse.gef.requests.CreateConnectionRequest; //导入方法依赖的package包/类
/**
* This method completes and return the creation commands for all {@link Relation}s except for
* {@link Relation}s from type cyclic, irreflexive, acyclic, reflexive and total.
*
* @return {@link ORMRelationCreateCommand}
* */
private ORMRelationCreateCommand setupConnectionCompleteCommand(
final CreateConnectionRequest request) {
final ORMRelationCreateCommand result = (ORMRelationCreateCommand) request.getStartCommand();
result.setTarget((Shape) getHost().getModel());
return result;
}