@Override public void actionPerformed(ActionEvent e) { Pair<String, String> frameworkAndTestName = Pair.of(TESTNG_FRAMEWORK_NAME, null); actionPerformed(frameworkAndTestName, false); } }
@Override public void actionPerformed(ActionEvent e) { Pair<String, String> frameworkAndTestName = Pair.of("PHPUnit", null); actionPerformed(frameworkAndTestName, false); }
@Override public void actionPerformed(ActionEvent e) { Pair<String, String> frameworkAndTestName = Pair.of(TESTNG_FRAMEWORK_NAME, null); actionPerformed(frameworkAndTestName, true); } }
private void addFirstProgress(ProgressReport progress) { currentProgress = progress; progresses.put(currentProgress.getId(), Pair.of(progress, currentTimeMillis())); startProcessesCleaner(); } }
@Override public void apply(final FactoryDto factory) throws OperationException { factoryService .findFactory( null, null, Collections.singletonList(Pair.of("name", factoryName))) .then(saveFactory(factory, factoryName)) .catchError(logError()); } })
@Override public Pair<List<MenuItem>, String> getChildren(MenuItem parent) { List<MenuItem> items = new ArrayList<>(); if (parent instanceof CommandItem) { final WorkspaceImpl workspace = appContext.getWorkspace(); final RuntimeImpl runtime = workspace.getRuntime(); if (runtime != null) { final CommandImpl command = ((CommandItem) parent).getCommand(); final Map<String, ? extends MachineImpl> machines = runtime.getMachines(); items.addAll( machines .values() .stream() .map(machine -> menuItemsFactory.newMachineItem(command, machine)) .collect(toList())); } } return Pair.of(items, null); }
/** * Adds new progress. * * @param progress information about progress */ public void addProgress(ProgressReport progress) { String taskId = progress.getId(); if (progresses.containsKey(taskId)) { updateProgress(progress); return; } ProgressView progressView = progressFactory.create(); progressView.updateProgressBar(progress); progresses.put(taskId, Pair.of(progressView, currentTimeMillis())); view.add(progressView); }
@Override public Promise<List<FactoryDto>> findFactory( @Nullable Integer skipCount, @Nullable Integer maxItems, @Nullable List<Pair<String, String>> params) { final List<Pair<String, String>> allParams = new LinkedList<>(); if (params != null) { allParams.addAll(params); } if (maxItems != null) { allParams.add(Pair.of("maxItems", maxItems.toString())); } if (skipCount != null) { allParams.add(Pair.of("skipCount", skipCount.toString())); } return asyncRequestFactory .createGetRequest(API_FACTORY_BASE_URL + "find" + queryString(allParams)) .header(HTTPHeader.ACCEPT, MimeType.APPLICATION_JSON) .header(HTTPHeader.CONTENT_TYPE, MimeType.APPLICATION_JSON) .loader(loaderFactory.newLoader("Searching factory...")) .send(unmarshallerFactory.newListUnmarshaller(FactoryDto.class)); }
/** {@inheritDoc} */ @Override public boolean add(final File item) { ensureGroupExist(); if (item == null || recentGroup == null) { return false; } // initial precondition if (recentStorage.size() == MAX_FILES_IN_STACK) { remove(recentStorage.getLast()); } remove(item); recentStorage.addFirst(item); openRecentFilesPresenter.setRecentFiles(getAll()); // register recent item action RecentFileAction action = recentFileActionFactory.newRecentFileAction(item); fileToAction.add(Pair.of(item, action)); actionManager.registerAction(action.getId(), action); recentGroup.add(action, FIRST); return true; }
private void handleProgressNotification(ProgressReport progress) { if (isNullOrEmpty(progress.getId())) { return; } String progressId = progress.getId(); if (progressFinished(progress)) { progresses.remove(progressId); backgroundLoader.updateProgressBar(progress); backgroundLoader.removeProgress(progress); updateCurrentProgress(); return; } if (progress.isComplete()) { return; } if (progresses.isEmpty()) { addFirstProgress(progress); } progresses.put(progressId, Pair.of(progress, currentTimeMillis())); backgroundLoader.addProgress(progress); if (currentProgress == null) { currentProgress = progress; } String currentTaskId = currentProgress.getId(); if (progressId.equals(currentTaskId)) { currentProgress = progress; backgroundLoader.updateProgressBar(currentProgress); } backgroundLoader.show(); }