Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
276,900 | void () { delegate.print(myBuffer); delegate.flush(); myBuffer.setLength(0); } | doFlush |
276,901 | ExternalSystemTaskNotificationListener () { return myNotificationListener.get(); } | getNotificationListener |
276,902 | RemoteExternalSystemTaskManager<S> () { try { return getService(RemoteExternalSystemTaskManager.class, myTaskManager); } catch (Exception e) { throw new IllegalStateException(String.format("Can't create '%s' service", ExternalSystemTaskManager.class.getName()), e); } } | getTaskManager |
276,903 | void (@NotNull String id, @NotNull ProjectSystemId externalSystemId) { } | release |
276,904 | boolean (@NotNull RemoteExternalSystemFacade facade) { RemoteExternalSystemFacade toCheck = facade; if (facade instanceof ExternalSystemFacadeWrapper) { toCheck = ((ExternalSystemFacadeWrapper)facade).getDelegate(); } return toCheck instanceof InProcessExternalSystemFacadeImpl; } | isAlive |
276,905 | void () { } | clear |
276,906 | RemoteExternalSystemTaskManager<ExternalSystemExecutionSettings> () { return RemoteExternalSystemTaskManager.NULL_OBJECT; } | getTaskManager |
276,907 | void (@NotNull ExternalSystemExecutionSettings settings) { } | applySettings |
276,908 | void (@NotNull RemoteExternalSystemProgressNotificationManager progressManager) { } | applyProgressManager |
276,909 | RawExternalSystemProjectResolver<ExternalSystemExecutionSettings> () { return RawExternalSystemProjectResolver.Companion.getNULL_OBJECT(); } | getRawProjectResolver |
276,910 | boolean (@NotNull ExternalSystemTaskId id) { return false; } | isTaskInProgress |
276,911 | boolean (@NotNull ExternalSystemTaskId id) { return false; } | cancelTask |
276,912 | void (TreeExpansionEvent event) { if (!mySuppressCollapseTracking) { myExpandedStateHolder.put(getPath(event.getPath()), true); } } | treeWillExpand |
276,913 | void (TreeExpansionEvent event) { if (!mySuppressCollapseTracking) { myExpandedStateHolder.put(getPath(event.getPath()), false); } } | treeWillCollapse |
276,914 | void (TreeModelEvent e) { scheduleCollapseStateAppliance(e.getTreePath()); } | treeStructureChanged |
276,915 | void (TreeModelEvent e) { scheduleCollapseStateAppliance(e.getTreePath()); } | treeNodesInserted |
276,916 | void (ActionEvent e) { ExternalTaskExecutionInfo task = get(); if (task == null) { return; } ExternalSystemUtil.runTask(task.getSettings(), task.getExecutorId(), project, externalSystemId, null, ProgressExecutionMode.NO_PROGRESS_ASYNC); } | actionPerformed |
276,917 | void (@NotNull TreePath path) { myPathsToProcessCollapseState.add(path); myCollapseStateAlarm.cancelAllRequests(); myCollapseStateAlarm.addRequest(() -> { // We assume that the paths collection is modified only from the EDT, so, ConcurrentModificationException doesn't have // a chance. // Another thing is that we sort the paths in order to process the longest first. That is related to the JTree specifics // that it automatically expands parent paths on child path expansion. List<TreePath> paths = new ArrayList<>(myPathsToProcessCollapseState); myPathsToProcessCollapseState.clear(); paths.sort(PATH_COMPARATOR); for (TreePath treePath : paths) { applyCollapseState(treePath); } final TreePath rootPath = new TreePath(getModel().getRoot()); if (isCollapsed(rootPath)) { expandPath(rootPath); } }, COLLAPSE_STATE_PROCESSING_DELAY_MILLIS); } | scheduleCollapseStateAppliance |
276,918 | void (@NotNull TreePath path) { final String key = getPath(path); final Boolean expanded = myExpandedStateHolder.get(key); if (expanded == null) { return; } boolean s = mySuppressCollapseTracking; mySuppressCollapseTracking = true; try { if (expanded) { expandPath(path); } else { collapsePath(path); } } finally { mySuppressCollapseTracking = s; } } | applyCollapseState |
276,919 | String (@NotNull TreePath path) { StringBuilder buffer = new StringBuilder(); for (TreePath current = path; current != null; current = current.getParentPath()) { buffer.append(current.getLastPathComponent().toString()).append('/'); } buffer.setLength(buffer.length() - 1); return buffer.toString(); } | getPath |
276,920 | ExternalTaskExecutionInfo () { TreePath[] selectionPaths = getSelectionPaths(); if (selectionPaths == null || selectionPaths.length == 0) { return null; } Map<String, ExternalTaskExecutionInfo> map = new HashMap<>(); for (TreePath selectionPath : selectionPaths) { Object component = selectionPath.getLastPathComponent(); if (!(component instanceof ExternalSystemNode)) { continue; } Object element = ((ExternalSystemNode)component).getDescriptor().getElement(); if (element instanceof ExternalTaskExecutionInfo taskExecutionInfo) { ExternalSystemTaskExecutionSettings executionSettings = taskExecutionInfo.getSettings(); String key = executionSettings.getExternalSystemIdString() + executionSettings.getExternalProjectPath() + executionSettings.getVmOptions(); ExternalTaskExecutionInfo executionInfo = map.get(key); if(executionInfo == null) { ExternalSystemTaskExecutionSettings taskExecutionSettings = new ExternalSystemTaskExecutionSettings(); taskExecutionSettings.setExternalProjectPath(executionSettings.getExternalProjectPath()); taskExecutionSettings.setExternalSystemIdString(executionSettings.getExternalSystemIdString()); taskExecutionSettings.setVmOptions(executionSettings.getVmOptions()); taskExecutionSettings.setScriptParameters(executionSettings.getScriptParameters()); taskExecutionSettings.setExecutionName(executionSettings.getExecutionName()); executionInfo = new ExternalTaskExecutionInfo(taskExecutionSettings, taskExecutionInfo.getExecutorId()); map.put(key, executionInfo); } executionInfo.getSettings().getTaskNames().addAll(executionSettings.getTaskNames()); executionInfo.getSettings().getTaskDescriptions().addAll(executionSettings.getTaskDescriptions()); } } // Disable tasks execution if it comes from different projects if(map.values().size() != 1) return null; return map.values().iterator().next(); } | get |
276,921 | boolean (@NotNull Project project) { return !getSettings(project).getLinkedProjectsSettings().isEmpty(); } | shouldBeAvailable |
276,922 | void (@NotNull Project project, @NotNull ToolWindow toolWindow) { toolWindow.setTitle(externalSystemId.getReadableName()); ContentManager contentManager = toolWindow.getContentManager(); contentManager.addContent(new ContentImpl(createInitializingLabel(), "", false)); ExternalProjectsManager.getInstance(project).runWhenInitialized(() -> { ExternalProjectsViewImpl projectView = new ExternalProjectsViewImpl(project, (ToolWindowEx)toolWindow, externalSystemId); ExternalProjectsManagerImpl.getInstance(project).registerView(projectView); ContentImpl taskContent = new ContentImpl(projectView, "", true); contentManager.removeAllContents(true); contentManager.addContent(taskContent); }); } | createToolWindowContent |
276,923 | JLabel () { JLabel label = new JLabel(ExternalSystemBundle.message("initializing.0.projects.data", externalSystemId.getReadableName()), SwingConstants.CENTER); label.setOpaque(true); return label; } | createInitializingLabel |
276,924 | void (@NotNull String projectPath) { final AbstractExternalSystemSettings externalSystemSettings = ExternalSystemApiUtil.getSettings(myProject, myProjectSystemId); //noinspection unchecked Collection<ExternalProjectSettings> projectsSettings = externalSystemSettings.getLinkedProjectsSettings(); List<ProjectItem> projects = ContainerUtil.map(projectsSettings, settings -> new ProjectItem(uiAware.getProjectRepresentationName(settings.getExternalProjectPath(), null), settings)); myTree = new SimpleTree(); myRootNode = new RootNode(); myTreeModel = createModel(myRootNode, myTree); final ExternalProjectSettings currentProjectSettings = externalSystemSettings.getLinkedProjectSettings(projectPath); if (currentProjectSettings != null) { SwingHelper.updateItems(projectCombobox, projects, new ProjectItem(uiAware.getProjectRepresentationName(projectPath, null), currentProjectSettings)); } projectCombobox.addActionListener(e -> updateTree(myRootNode)); } | setUpDialog |
276,925 | JComponent () { ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTree). setAddAction(button -> { ProjectItem projectItem = (ProjectItem)projectCombobox.getSelectedItem(); if(projectItem == null) return; final ExternalProjectInfo projectData = ProjectDataManager.getInstance() .getExternalProjectData(myProject, myProjectSystemId, projectItem.myProjectSettings.getExternalProjectPath()); if (projectData == null || projectData.getExternalProjectStructure() == null) return; final List<ProjectPopupItem> popupItems = new ArrayList<>(); for (DataNode<ModuleData> moduleDataNode : ExternalSystemApiUtil .findAllRecursively(projectData.getExternalProjectStructure(), ProjectKeys.MODULE)) { if(moduleDataNode.isIgnored()) continue; final List<String> tasks = ContainerUtil.map( ExternalSystemApiUtil.findAll(moduleDataNode, ProjectKeys.TASK), node -> node.getData().getName()); if (!tasks.isEmpty()) { popupItems.add(new ProjectPopupItem(moduleDataNode.getData(), tasks)); } } final ChooseProjectStep projectStep = new ChooseProjectStep(popupItems); final List<ProjectPopupItem> projectItems = projectStep.getValues(); ListPopupStep step = projectItems.size() == 1 ? (ListPopupStep)projectStep.onChosen(projectItems.get(0), false) : projectStep; assert step != null; JBPopupFactory.getInstance().createListPopup(step).show( ObjectUtils.notNull(button.getPreferredPopupPoint(), RelativePoint.getSouthEastOf(projectCombobox))); }). setRemoveAction(button -> { List<TaskActivationEntry> tasks = findSelectedTasks(); myTaskActivator.removeTasks(tasks); updateTree(null); }). setMoveUpAction(button -> moveAction(-1)). setMoveUpActionUpdater(e -> isMoveActionEnabled(-1)). setMoveDownAction(button -> moveAction(+1)). setMoveDownActionUpdater(e -> isMoveActionEnabled(+1)). setToolbarPosition(ActionToolbarPosition.RIGHT); tasksPanel.add(decorator.createPanel()); return contentPane; } | createCenterPanel |
276,926 | boolean (int increment) { final DefaultMutableTreeNode[] selectedNodes = myTree.getSelectedNodes(DefaultMutableTreeNode.class, null); if (selectedNodes.length == 0) return false; boolean enabled = true; for (DefaultMutableTreeNode node : selectedNodes) { final DefaultMutableTreeNode sibling = increment == -1 ? node.getPreviousSibling() : node.getNextSibling(); enabled = enabled && (node.getUserObject() instanceof TaskNode) && sibling != null; } if (!enabled) { enabled = true; for (DefaultMutableTreeNode node : selectedNodes) { final DefaultMutableTreeNode sibling = increment == -1 ? node.getPreviousSibling() : node.getNextSibling(); enabled = enabled && (node.getUserObject() instanceof ProjectNode) && sibling != null; } } return enabled; } | isMoveActionEnabled |
276,927 | void (int increment) { List<TaskActivationEntry> tasks = findSelectedTasks(); if (!tasks.isEmpty()) { myTaskActivator.moveTasks(tasks, increment); } else { List<String> projectsPaths = findSelectedProjects(); if (projectsPaths.isEmpty()) return; ProjectItem item = (ProjectItem)projectCombobox.getSelectedItem(); myTaskActivator.moveProjects(myProjectSystemId, projectsPaths, item.myProjectSettings.getModules(), increment); } moveSelectedRows(myTree, increment); } | moveAction |
276,928 | void (@NotNull final SimpleTree tree, final int direction) { final TreePath[] selectionPaths = tree.getSelectionPaths(); if (selectionPaths == null) return; ContainerUtil.sort(selectionPaths, new Comparator<>() { @Override public int compare(TreePath o1, TreePath o2) { return -direction * compare(tree.getRowForPath(o1), tree.getRowForPath(o2)); } private int compare(int x, int y) { return Integer.compare(x, y); } }); for (TreePath selectionPath : selectionPaths) { final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)selectionPath.getLastPathComponent(); final DefaultMutableTreeNode parent = (DefaultMutableTreeNode)treeNode.getParent(); final int idx = parent.getIndex(treeNode); ((DefaultTreeModel)tree.getModel()).removeNodeFromParent(treeNode); ((DefaultTreeModel)tree.getModel()).insertNodeInto(treeNode, parent, idx + direction); } tree.addSelectionPaths(selectionPaths); } | moveSelectedRows |
276,929 | int (TreePath o1, TreePath o2) { return -direction * compare(tree.getRowForPath(o1), tree.getRowForPath(o2)); } | compare |
276,930 | int (int x, int y) { return Integer.compare(x, y); } | compare |
276,931 | List<TaskActivationEntry> () { List<TaskActivationEntry> tasks = new SmartList<>(); for (DefaultMutableTreeNode node : myTree.getSelectedNodes(DefaultMutableTreeNode.class, null)) { tasks.addAll(findTasksUnder(ContainerUtil.ar((MyNode)node.getUserObject()))); } return tasks; } | findSelectedTasks |
276,932 | List<TaskActivationEntry> (SimpleNode @NotNull [] nodes) { List<TaskActivationEntry> tasks = new SmartList<>(); for (SimpleNode node : nodes) { if (node instanceof TaskNode taskNode) { final String taskName = taskNode.getName(); final PhaseNode phaseNode = (PhaseNode)taskNode.getParent(); tasks.add(new TaskActivationEntry(myProjectSystemId, phaseNode.myPhase, phaseNode.myProjectPath, taskName)); } else { tasks.addAll(findTasksUnder(node.getChildren())); } } return tasks; } | findTasksUnder |
276,933 | List<String> () { List<String> tasks = new ArrayList<>(); for (DefaultMutableTreeNode node : myTree.getSelectedNodes(DefaultMutableTreeNode.class, null)) { if (node.getUserObject() instanceof ProjectNode projectNode) { tasks.add(projectNode.myProjectPath); } } return tasks; } | findSelectedProjects |
276,934 | MyNode[] (final ExternalProjectSettings projectSettings, final ExternalProjectsStateProvider stateProvider, final RootNode parent) { List<String> paths = new ArrayList<>(stateProvider.getProjectsTasksActivationMap(myProjectSystemId).keySet()); paths.retainAll(projectSettings.getModules()); return ContainerUtil.mapNotNull(ArrayUtilRt.toStringArray(paths), path -> { final MyNode node = new ProjectNode(parent, stateProvider, projectSettings.getExternalProjectPath(), path); return node.getChildren().length > 0 ? node : null; }, new MyNode[]{}); } | buildProjectsNodes |
276,935 | MyNode[] (final String projectPath, final TaskActivationState tasksActivation, final MyNode parent) { return ContainerUtil.mapNotNull(Phase.values(), phase -> tasksActivation.getTasks(phase).isEmpty() ? null : new PhaseNode(projectPath, phase, tasksActivation, parent), new MyNode[]{}); } | buildProjectPhasesNodes |
276,936 | String () { return projectName + " (" + truncate(myProjectSettings.getExternalProjectPath()) + ")"; } | toString |
276,937 | String (@NotNull String s) { return s.length() < MAX_LENGTH ? s : s.substring(0, MAX_LENGTH / 2) + "..." + s.substring(s.length() - MAX_LENGTH / 2 - 3); } | truncate |
276,938 | boolean (Object o) { if (this == o) return true; if (!(o instanceof ProjectItem item)) return false; if (!myProjectSettings.equals(item.myProjectSettings)) return false; return true; } | equals |
276,939 | int () { return myProjectSettings.hashCode(); } | hashCode |
276,940 | void (@Nullable CachingSimpleNode nodeToUpdate) { Set<CachingSimpleNode> toUpdate = new ReferenceOpenHashSet<>(); if (nodeToUpdate == null) { for (DefaultMutableTreeNode node : myTree.getSelectedNodes(DefaultMutableTreeNode.class, null)) { final Object userObject = node.getUserObject(); if (userObject instanceof SimpleNode && ((SimpleNode)userObject).getParent() instanceof CachingSimpleNode) { toUpdate.add((CachingSimpleNode)((SimpleNode)userObject).getParent()); } } } else { toUpdate.add(nodeToUpdate); } if (toUpdate.isEmpty()) { toUpdate.add(myRootNode); } Element treeStateElement = new Element("root"); try { TreeState.createOn(myTree).writeExternal(treeStateElement); } catch (WriteExternalException ignore) { } for (CachingSimpleNode node : toUpdate) { cleanUpEmptyNodes(node); } TreeState.createFrom(treeStateElement).applyTo(myTree); } | updateTree |
276,941 | void (@NotNull CachingSimpleNode node) { node.cleanUpCache(); myTreeModel.invalidateAsync(node, true); if (node.getChildren().length == 0) { if (node.getParent() instanceof CachingSimpleNode) { cleanUpEmptyNodes((CachingSimpleNode)node.getParent()); } } } | cleanUpEmptyNodes |
276,942 | String () { return myModuleData.getId(); } | toString |
276,943 | PopupStep (final ProjectPopupItem projectPopupItem, final boolean finalChoice) { return new BaseListPopupStep<>(ExternalSystemBundle.message("popup.title.choose.activation.phase"), Phase.values()) { @Override public PopupStep onChosen(final Phase selectedPhase, boolean finalChoice) { final Map<String, TaskActivationState> activationMap = ExternalProjectsManagerImpl.getInstance(myProject).getStateProvider().getProjectsTasksActivationMap(myProjectSystemId); final String projectPath = projectPopupItem.myModuleData.getLinkedExternalProjectPath(); final List<String> tasks = activationMap.get(projectPath).getTasks(selectedPhase); final List<String> tasksToSuggest = new ArrayList<>(projectPopupItem.myTasks); tasksToSuggest.removeAll(tasks); return new BaseListPopupStep<>(ExternalSystemBundle.message("popup.title.choose.task"), tasksToSuggest) { @Override public PopupStep onChosen(final String taskName, boolean finalChoice) { return doFinalStep(() -> { myTaskActivator.addTask(new TaskActivationEntry(myProjectSystemId, selectedPhase, projectPath, taskName)); updateTree(myRootNode); }); } }; } @Override public boolean hasSubstep(Phase phase) { return true; } }; } | onChosen |
276,944 | PopupStep (final Phase selectedPhase, boolean finalChoice) { final Map<String, TaskActivationState> activationMap = ExternalProjectsManagerImpl.getInstance(myProject).getStateProvider().getProjectsTasksActivationMap(myProjectSystemId); final String projectPath = projectPopupItem.myModuleData.getLinkedExternalProjectPath(); final List<String> tasks = activationMap.get(projectPath).getTasks(selectedPhase); final List<String> tasksToSuggest = new ArrayList<>(projectPopupItem.myTasks); tasksToSuggest.removeAll(tasks); return new BaseListPopupStep<>(ExternalSystemBundle.message("popup.title.choose.task"), tasksToSuggest) { @Override public PopupStep onChosen(final String taskName, boolean finalChoice) { return doFinalStep(() -> { myTaskActivator.addTask(new TaskActivationEntry(myProjectSystemId, selectedPhase, projectPath, taskName)); updateTree(myRootNode); }); } }; } | onChosen |
276,945 | PopupStep (final String taskName, boolean finalChoice) { return doFinalStep(() -> { myTaskActivator.addTask(new TaskActivationEntry(myProjectSystemId, selectedPhase, projectPath, taskName)); updateTree(myRootNode); }); } | onChosen |
276,946 | boolean (Phase phase) { return true; } | hasSubstep |
276,947 | boolean (ProjectPopupItem selectedValue) { return true; } | hasSubstep |
276,948 | boolean () { return true; } | isAutoExpandNode |
276,949 | MyNode[] () { ProjectItem item = (ProjectItem)projectCombobox.getSelectedItem(); if(item == null) return new MyNode[]{}; if (item.myProjectSettings.getModules().isEmpty() || item.myProjectSettings.getModules().size() == 1) { final TaskActivationState tasksActivation = myStateProvider.getTasksActivation(myProjectSystemId, item.myProjectSettings.getExternalProjectPath()); return buildProjectPhasesNodes(item.myProjectSettings.getExternalProjectPath(), tasksActivation, this); } else { return buildProjectsNodes(item.myProjectSettings, myStateProvider, this); } } | buildChildren |
276,950 | void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(AllIcons.Nodes.ConfigFolder); } | update |
276,951 | String () { return myProjectName; } | getName |
276,952 | MyNode[] () { final TaskActivationState tasksActivation = myStateProvider.getTasksActivation(myProjectSystemId, myProjectPath); return buildProjectPhasesNodes(myProjectPath, tasksActivation, this); } | buildChildren |
276,953 | void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(AllIcons.Nodes.ConfigFolder); } | update |
276,954 | boolean () { return true; } | isAutoExpandNode |
276,955 | MyNode[] () { return ContainerUtil.map2Array(myTaskActivationState.getTasks(myPhase), MyNode.class, taskName -> new TaskNode(taskName, this)); } | buildChildren |
276,956 | String () { return myPhase.toString(); } | getName |
276,957 | void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(uiAware.getTaskIcon()); } | update |
276,958 | MyNode[] () { return new MyNode[0]; } | buildChildren |
276,959 | String () { return myTaskName; } | getName |
276,960 | boolean () { return true; } | isAlwaysLeaf |
276,961 | ExternalSystemNodeDescriptor<T> () { return (ExternalSystemNodeDescriptor<T>)getUserObject(); } | getDescriptor |
276,962 | void (@NotNull String name) { myName = name; } | setName |
276,963 | void (@NotNull PresentationData presentation) { presentation.setPresentableText(myName); presentation.setIcon(getIcon()); presentation.setTooltip(myDescription); } | update |
276,964 | T () { return myElement; } | getElement |
276,965 | String (@NotNull ExternalTaskExecutionInfo taskInfo) { return taskInfo.getSettings().getTaskNames().get(0); } | getTaskName |
276,966 | ExternalSystemNode<ExternalProjectPojo> (@NotNull ExternalProjectPojo project) { ExternalSystemNode<?> root = getRoot(); // Remove outdated projects. for (int i = root.getChildCount() - 1; i >= 0; i--) { ExternalSystemNode<?> child = root.getChildAt(i); ExternalSystemNodeDescriptor<?> descriptor = child.getDescriptor(); Object element = descriptor.getElement(); if (element instanceof ExternalProjectPojo pojo) { if (pojo.getPath().equals(project.getPath())) { if (!pojo.getName().equals(project.getName())) { pojo.setName(project.getName()); descriptor.setName(project.getName()); nodeChanged(child); } return (ExternalSystemNode<ExternalProjectPojo>)child; } } } ExternalProjectPojo element = new ExternalProjectPojo(project.getName(), project.getPath()); ExternalSystemNodeDescriptor<ExternalProjectPojo> descriptor = descriptor(element, myUiAware.getProjectIcon()); ExternalSystemNode<ExternalProjectPojo> result = new ExternalSystemNode<>(descriptor); insertNodeInto(result, root); return result; } | ensureProjectNodeExists |
276,967 | void (@NotNull Object payload) { Deque<ExternalSystemNode<?>> toProcess = new ArrayDeque<>(); toProcess.addFirst(getRoot()); while (!toProcess.isEmpty()) { ExternalSystemNode<?> node = toProcess.removeLast(); if (payload.equals(node.getDescriptor().getElement())) { removeNodeFromParent(node); } else { for (int i = 0; i < node.getChildCount(); i++) { toProcess.addFirst(node.getChildAt(i)); } } } } | pruneNodes |
276,968 | void (@NotNull ExternalProjectPojo topLevelProject, @NotNull Collection<? extends ExternalProjectPojo> subProjects) { ExternalSystemNode<ExternalProjectPojo> topLevelProjectNode = ensureProjectNodeExists(topLevelProject); Map<String/*config path*/, ExternalProjectPojo> toAdd = new HashMap<>(); for (ExternalProjectPojo subProject : subProjects) { toAdd.put(subProject.getPath(), subProject); } toAdd.remove(topLevelProject.getPath()); for (int i = 0; i < topLevelProjectNode.getChildCount(); i++) { ExternalSystemNode<?> child = topLevelProjectNode.getChildAt(i); Object childElement = child.getDescriptor().getElement(); if (childElement instanceof ExternalTaskExecutionInfo) { continue; } if (toAdd.remove(((ExternalProjectPojo)childElement).getPath()) == null) { removeNodeFromParent(child); //noinspection AssignmentToForLoopParameter i--; } } if (!toAdd.isEmpty()) { for (Map.Entry<String, ExternalProjectPojo> entry : toAdd.entrySet()) { ExternalProjectPojo element = new ExternalProjectPojo(entry.getValue().getName(), entry.getValue().getPath()); insertNodeInto(new ExternalSystemNode<>(descriptor(element, myUiAware.getProjectIcon())), topLevelProjectNode); } } } | ensureSubProjectsStructure |
276,969 | void (@NotNull String externalProjectConfigPath, @NotNull Collection<? extends ExternalTaskPojo> tasks) { if (tasks.isEmpty()) { return; } ExternalSystemNode<ExternalProjectPojo> moduleNode = findProjectNode(externalProjectConfigPath); if (moduleNode == null) { // LOG.warn(String.format( // "Can't proceed tasks for module which external config path is '%s'. Reason: no such module node is found. Tasks: %s", // externalProjectConfigPath, tasks // )); return; } Set<ExternalTaskExecutionInfo> toAdd = new HashSet<>(); for (ExternalTaskPojo task : tasks) { toAdd.add(buildTaskInfo(task)); } for (int i = 0; i < moduleNode.getChildCount(); i++) { ExternalSystemNode<?> childNode = moduleNode.getChildAt(i); Object element = childNode.getDescriptor().getElement(); if (element instanceof ExternalTaskExecutionInfo) { if (!toAdd.remove(element)) { removeNodeFromParent(childNode); //noinspection AssignmentToForLoopParameter i--; } } } if (!toAdd.isEmpty()) { for (ExternalTaskExecutionInfo taskInfo : toAdd) { insertNodeInto( new ExternalSystemNode<>(descriptor(taskInfo, taskInfo.getDescription(), myUiAware.getTaskIcon())), moduleNode); } } } | ensureTasks |
276,970 | ExternalTaskExecutionInfo (@NotNull ExternalTaskPojo task) { ExternalSystemTaskExecutionSettings settings = new ExternalSystemTaskExecutionSettings(); settings.setExternalProjectPath(task.getLinkedExternalProjectPath()); settings.setTaskNames(Collections.singletonList(task.getName())); settings.setTaskDescriptions(Collections.singletonList(task.getDescription())); settings.setExternalSystemIdString(myExternalSystemId.toString()); return new ExternalTaskExecutionInfo(settings, DefaultRunExecutor.EXECUTOR_ID); } | buildTaskInfo |
276,971 | ExternalSystemNode<ExternalProjectPojo> (@NotNull String configPath) { for (int i = getRoot().getChildCount() - 1; i >= 0; i--) { ExternalSystemNode<?> child = getRoot().getChildAt(i); Object childElement = child.getDescriptor().getElement(); if (childElement instanceof ExternalProjectPojo && ((ExternalProjectPojo)childElement).getPath().equals(configPath)) { return (ExternalSystemNode<ExternalProjectPojo>)child; } for (int j = child.getChildCount() - 1; j >= 0; j--) { ExternalSystemNode<?> grandChild = child.getChildAt(j); Object grandChildElement = grandChild.getDescriptor().getElement(); if (grandChildElement instanceof ExternalProjectPojo && ((ExternalProjectPojo)grandChildElement).getPath().equals(configPath)) { return (ExternalSystemNode<ExternalProjectPojo>)grandChild; } } } return null; } | findProjectNode |
276,972 | void (MutableTreeNode child, MutableTreeNode parent) { int index = findIndexFor(child, parent); super.insertNodeInto(child, parent, index); } | insertNodeInto |
276,973 | void (MutableTreeNode child, MutableTreeNode parent, int i) { insertNodeInto(child, parent); } | insertNodeInto |
276,974 | int (MutableTreeNode child, MutableTreeNode parent) { int childCount = parent.getChildCount(); if (childCount == 0) { return 0; } if (childCount == 1) { return NODE_COMPARATOR.compare(child, parent.getChildAt(0)) <= 0 ? 0 : 1; } return findIndexFor(child, parent, 0, childCount - 1); } | findIndexFor |
276,975 | int (MutableTreeNode child, MutableTreeNode parent, int i1, int i2) { if (i1 == i2) { return NODE_COMPARATOR.compare(child, parent.getChildAt(i1)) <= 0 ? i1 : i1 + 1; } int half = (i1 + i2) / 2; if (NODE_COMPARATOR.compare(child, parent.getChildAt(half)) <= 0) { return findIndexFor(child, parent, i1, half); } return findIndexFor(child, parent, half + 1, i2); } | findIndexFor |
276,976 | void () { myAlarm.cancelAllRequests(); } | dispose |
276,977 | boolean (@NotNull ExternalSystemTaskType type, @NotNull Project project) { String projectId = ExternalSystemTaskId.getProjectId(project); for (ExternalSystemTaskId id : myTasksInProgress.keySet()) { if (type.equals(id.getType()) && projectId.equals(id.getIdeProjectId())) { return true; } } return false; } | hasTaskOfTypeInProgress |
276,978 | List<ExternalSystemTask> (@NotNull ProjectSystemId projectSystemId, ExternalSystemTaskState @NotNull ... taskStates) { List<ExternalSystemTask> result = new SmartList<>(); for (ExternalSystemTask task : myTasksDetails.values()) { if (task instanceof AbstractExternalSystemTask externalSystemTask) { if (externalSystemTask.getExternalSystemId().getId().equals(projectSystemId.getId()) && ArrayUtil.contains(externalSystemTask.getState(), taskStates)) { result.add(task); } } } return result; } | findTasksOfState |
276,979 | void (@NotNull ExternalSystemTask task) { myTasksDetails.put(task.getId(), task); } | add |
276,980 | void (@NotNull ExternalSystemTaskId id) { myTasksDetails.remove(id); } | release |
276,981 | void (@NotNull ExternalSystemTaskId id, String workingDir) { myTasksInProgress.put(id, System.currentTimeMillis() + TOO_LONG_EXECUTION_MS); if (myAlarm.isEmpty()) { myAlarm.addRequest(() -> update(), TOO_LONG_EXECUTION_MS); } } | onStart |
276,982 | void (@NotNull ExternalSystemTaskId id) { myTasksInProgress.put(id, System.currentTimeMillis() + TOO_LONG_EXECUTION_MS); } | onStart |
276,983 | void (@NotNull ExternalSystemTaskNotificationEvent event) { myTasksInProgress.put(event.getId(), System.currentTimeMillis() + TOO_LONG_EXECUTION_MS); } | onStatusChange |
276,984 | void (@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) { myTasksInProgress.put(id, System.currentTimeMillis() + TOO_LONG_EXECUTION_MS); } | onTaskOutput |
276,985 | void (@NotNull ExternalSystemTaskId id) { myTasksInProgress.remove(id); if (myTasksInProgress.isEmpty()) { myAlarm.cancelAllRequests(); } } | onEnd |
276,986 | void (@NotNull ExternalSystemTaskId id) { } | onSuccess |
276,987 | void (@NotNull ExternalSystemTaskId id, @NotNull Exception e) { } | onFailure |
276,988 | void (@NotNull ExternalSystemTaskId id) { } | beforeCancel |
276,989 | void (@NotNull ExternalSystemTaskId id) { } | onCancel |
276,990 | void () { long delay = TOO_LONG_EXECUTION_MS; Map<ExternalSystemTaskId, Long> newState = new HashMap<>(); Map<ExternalSystemTaskId, Long> currentState = new HashMap<>(myTasksInProgress); if (currentState.isEmpty()) { return; } for (Map.Entry<ExternalSystemTaskId, Long> entry : currentState.entrySet()) { long diff = System.currentTimeMillis() - entry.getValue(); if (diff > 0) { delay = Math.min(delay, diff); newState.put(entry.getKey(), entry.getValue()); } else { // Perform explicit check on whether the task is still alive. if (myFacadeManager.isTaskActive(entry.getKey())) { newState.put(entry.getKey(), System.currentTimeMillis() + TOO_LONG_EXECUTION_MS); } } } myTasksInProgress.clear(); myTasksInProgress.putAll(newState); if (!newState.isEmpty()) { myAlarm.cancelAllRequests(); myAlarm.addRequest(() -> update(), delay); } } | update |
276,991 | ExternalSystemProcessingManager () { Application application = ApplicationManager.getApplication(); return application.getService(ExternalSystemProcessingManager.class); } | getInstance |
276,992 | List<String> () { return myTasksToExecute; } | getTasksToExecute |
276,993 | String () { return myVmOptions; } | getVmOptions |
276,994 | String () { return myArguments; } | getArguments |
276,995 | void (@NotNull String arguments) { myArguments = myArguments == null ? arguments : myArguments + ' ' + arguments; } | appendArguments |
276,996 | List<String> (@Nullable String cmdArgsLine) { return cmdArgsLine != null ? ParametersListUtil.parse(cmdArgsLine, false, true) : new ArrayList<>(); } | parseCmdParameters |
276,997 | DataNode<ProjectData> (ExternalSystemTaskId id, RemoteExternalSystemProjectResolver resolver, ExternalSystemExecutionSettings settings) { String title = ExternalSystemBundle.message("progress.refresh.text", myProjectName, getExternalSystemId().getReadableName()); Ref<DataNode<ProjectData>> projectRef = new Ref<>(); UnindexedFilesScannerExecutor.getInstance(getIdeProject()).suspendScanningAndIndexingThenRun(title, () -> { try { projectRef.set(resolver.resolveProjectInfo(id, myProjectPath, myIsPreviewMode, settings, myResolverPolicy)); } catch (RemoteException e) { throw new RuntimeException(e); } }); return projectRef.get(); } | pauseIndexingAndResolveProjectNode |
276,998 | String (@NotNull String text) { return ExternalSystemBundle.message("progress.update.text", getExternalSystemId().getReadableName(), text); } | wrapProgressText |
276,999 | boolean () { return myIsPreviewMode; } | isPreviewMode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.