@SuppressWarnings("unchecked") @NotNull public <R extends P4CommandRunner.ClientResult> P4CommandRunner.ActionAnswer<R> perform( @NotNull ClientConfig config, @NotNull P4CommandRunner.ClientAction<R> action) { ClientActionRunner<?> runner = clientActionRunners.get(action.getCmd()); if (runner == null) { throw new IllegalStateException("command not supported: " + action.getCmd()); } return ((ClientActionRunner<R>) runner).perform(config, action); }
switch (existing.getCmd()) { case CREATE_CHANGELIST: { CreateChangelistAction ex = (CreateChangelistAction) existing;
switch (existing.getCmd()) { case CREATE_CHANGELIST:
ret.actionId = action.getActionId(); ret.serverActionCmd = null; ret.clientActionCmd = action.getCmd(); ret.data = new PrimitiveMap(); switch (action.getCmd()) { case MOVE_FILE: { MoveFileAction a = (MoveFileAction) action; throw new IllegalArgumentException("Should not attempt to store a submit action"); default: throw new IllegalArgumentException("Unknown client cmd " + action.getCmd());
switch (existingSrc.getCmd()) { case MOVE_FILE: {
switch (action.getCmd()) { case MOVE_FILE: { MoveFileAction a = toMoveFileAction(action);
switch (action.getCmd()) {
switch (existing.getCmd()) { case MOVE_FILE: { MoveFileAction ex = (MoveFileAction) existing;
switch (existing.getCmd()) { case ADD_JOB_TO_CHANGELIST: { AddJobToChangelistAction ex = (AddJobToChangelistAction) existing;
switch (existing.getCmd()) { case ADD_JOB_TO_CHANGELIST: { AddJobToChangelistAction ex = (AddJobToChangelistAction) existing;
switch (existing.getCmd()) { case EDIT_CHANGELIST_DESCRIPTION: { EditChangelistAction ex = (EditChangelistAction) existing;
switch (existing.getCmd()) { case MOVE_FILE: { MoveFileAction ex = (MoveFileAction) existing;
public <R extends ClientResult> ActionAnswer<R> perform( @NotNull ClientConfig config, @NotNull ClientAction<R> action) { switch (action.getCmd()) { case ADD_EDIT_FILE: { AddEditAction fileAction = (AddEditAction) action;
switch (existing.getCmd()) { case MOVE_FILE:
@Nullable private P4ChangelistId getAssociatedChangelistId(@NotNull P4CommandRunner.ClientAction<?> action) { switch (action.getCmd()) { case MOVE_FILE: return ((MoveFileAction) action).getChangelistId();
@NotNull P4CommandRunner.ClientAction<?> added, @NotNull P4CommandRunner.ClientAction<?> existing) { switch (added.getCmd()) { case MOVE_FILE: return curateMoveRequest((MoveFileAction) added, existing); LOG.warn("Purging " + added.getCmd() + " actions from list; should never have been added"); return KEEP_EXISTING_REMOVE_ADDED_STOP;
P4ChangeProvider(@NotNull P4Vcs vcs, @NotNull Disposable parentDisposable) { this.project = vcs.getProject(); this.vcs = vcs; this.loader = new HistoryContentLoaderImpl(project); final MessageBusClient.ApplicationClient mbClient = MessageBusClient.forApplication(parentDisposable); final String cacheId = AbstractCacheMessage.createCacheId(project, P4ChangeProvider.class); ClientActionMessage.addListener(mbClient, cacheId, event -> { P4CommandRunner.ClientActionCmd cmd = (P4CommandRunner.ClientActionCmd) event.getAction().getCmd(); try { switch (cmd) { case CREATE_CHANGELIST: onChangelistCreated( (CreateChangelistAction) event.getAction(), (CreateChangelistResult) event.getResult(), event.getState()); break; case DELETE_CHANGELIST: if (event.getState() == ClientActionMessage.ActionState.PENDING) { onChangelistDelete((DeleteChangelistAction) event.getAction()); } break; } } catch (InterruptedException e) { InternalErrorMessage.send(project).cacheLockTimeoutError(new ErrorEvent<>( new VcsInterruptedException(e))); } }); }
private void renderActionChoice(ActionChoice value) { final String text = value.when( (c) -> c.getCmd().name().toLowerCase().replace('_', ' '), (s) -> s.getCmd().name().toLowerCase().replace('_', ' ') ); append(text, PENDING_ACTION_STYLE); String[] params = value.getDisplayParameters(); if (params.length > 0) { boolean first = true; for (String param : params) { if (first) { append(" (", PENDING_ACTION_SEPARATOR_STYLE); first = false; } else { append(", ", PENDING_ACTION_SEPARATOR_STYLE); } append(param, PENDING_ACTION_PARAMETER_STYLE); } append(")", PENDING_ACTION_SEPARATOR_STYLE); } }
@Override public String toString() { return client != null ? ("ClientAction(" + client.getCmd() + ")") : ("ServerAction(" + server.getCmd() + ")"); }