protected Command getReconnectSourceCommand(ReconnectRequest request) { Connection conn = (Connection) request.getConnectionEditPart().getModel(); Node newSource = (Node) getHost().getModel(); if (newSource.isReadOnly()) { return null; } ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn); cmd.setNewSource(newSource); return cmd; }
@SuppressWarnings("unchecked") // $NON-NLS-1$ protected Command getConnectionCreateCommand(CreateConnectionRequest request) { Node source = (Node) getHost().getModel(); if (source.isReadOnly()) { return null; } String style = (String) request.getNewObjectType(); ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, style, (List<Object>) request.getNewObject()); request.setStartCommand(cmd); return cmd; }