Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
276,700
boolean () { return myIsRoot; }
isRoot
276,701
void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(getUiAware().getProjectIcon()); String hint = null; if (myIsRoot) { hint = "root"; } final String tooltip = myData.toString() + (myData.getDescription() != null ? "<br>" + myData.getDescription() : ""); setNameAndTooltip(presentation, getName(), tooltip, hint); }
update
276,702
String () { return "ExternalSystemView.ModuleMenu"; }
getMenuId
276,703
int (@NotNull ExternalSystemNode node) { return myIsRoot ? -1 : (node instanceof ModuleNode && ((ModuleNode)node).myIsRoot) ? 1 : super.compareTo(node); }
compareTo
276,704
void () { myRunConfigurationsNode.updateRunConfigurations(); childrenChanged(); getExternalProjectsView().updateUpTo(this); getExternalProjectsView().updateUpTo(myRunConfigurationsNode); }
updateRunConfigurations
276,705
String () { if (getExternalProjectsView().getGroupModules()) { return myData.getExternalName(); } return super.getName(); }
getName
276,706
String () { ModuleData data = getData(); if (data == null) return null; return data.getIdeGrouping(); }
getIdeGrouping
276,707
String () { ModuleData data = getData(); if (data == null) return null; return data.getIdeParentGrouping(); }
getIdeParentGrouping
276,708
void (ExternalSystemNode<ModuleData> node) { super.mergeWith(node); ModuleNode moduleNode = node instanceof ModuleNode ? ((ModuleNode)node) : null; if (moduleNode != null) { myAllModules = moduleNode.myAllModules; } }
mergeWith
276,709
ExternalSystemUiAware () { return delegate.getUiAware(); }
getUiAware
276,710
ExternalProjectsStructure () { return delegate.getStructure(); }
getStructure
276,711
ExternalSystemShortcutsManager () { return delegate.getShortcutsManager(); }
getShortcutsManager
276,712
ExternalSystemTaskActivator () { return delegate.getTaskActivator(); }
getTaskActivator
276,713
void (ExternalSystemNode node) { delegate.updateUpTo(node); }
updateUpTo
276,714
Project () { return delegate.getProject(); }
getProject
276,715
boolean () { return delegate.showInheritedTasks(); }
showInheritedTasks
276,716
boolean () { return delegate.getGroupTasks(); }
getGroupTasks
276,717
boolean () { return delegate.getGroupModules(); }
getGroupModules
276,718
boolean () { return delegate.useTasksNode(); }
useTasksNode
276,719
ProjectSystemId () { return delegate.getSystemId(); }
getSystemId
276,720
void (@NotNull ExternalSystemNode node, @Nullable String actionId, InputEvent inputEvent) { delegate.handleDoubleClickOrEnter(node, actionId, inputEvent); }
handleDoubleClickOrEnter
276,721
void (@NotNull Listener listener) { delegate.addListener(listener); }
addListener
276,722
boolean () { return delegate.getShowIgnored(); }
getShowIgnored
276,723
String (DataNode node) { return delegate.getDisplayName(node); }
getDisplayName
276,724
ProjectSystemId () { return ProjectSystemId.IDE; }
getSystemId
276,725
String (@NotNull DataNode node) { return getNodeDisplayName(node); }
getDisplayName
276,726
void (@NotNull ExternalProjectsView externalProjectsView, @NotNull MultiMap<Key<?>, DataNode<?>> dataNodes, @NotNull List<? super ExternalSystemNode<?>> result) { final Collection<DataNode<?>> depsGraph = dataNodes.get(ProjectKeys.DEPENDENCIES_GRAPH); if (!depsGraph.isEmpty()) { final ExternalSystemNode<?> depNode = new MyDependenciesNode(externalProjectsView); for (DataNode<?> dataNode : depsGraph) { if (!(dataNode.getData() instanceof ProjectDependencies projectDependencies)) continue; for (ComponentDependencies componentDependencies : projectDependencies.getComponentsDependencies()) { depNode.add(new DependencyScopeExternalSystemNode(externalProjectsView, componentDependencies.getCompileDependenciesGraph())); depNode.add(new DependencyScopeExternalSystemNode(externalProjectsView, componentDependencies.getRuntimeDependenciesGraph())); } } if (depNode.hasChildren()) { result.add(depNode); } return; } final Collection<DataNode<?>> moduleDeps = dataNodes.get(ProjectKeys.MODULE_DEPENDENCY); final Collection<DataNode<?>> libDeps = dataNodes.get(ProjectKeys.LIBRARY_DEPENDENCY); if (!moduleDeps.isEmpty() || !libDeps.isEmpty()) { //noinspection rawtypes List<ExternalSystemNode<? extends DependencyData>> depNodeChildren = new ArrayList<>(); for (DataNode<?> dataNode : moduleDeps) { if (!(dataNode.getData() instanceof ModuleDependencyData)) continue; //noinspection unchecked ModuleDependencyDataExternalSystemNode moduleDependencyDataExternalSystemNode = new ModuleDependencyDataExternalSystemNode(externalProjectsView, (DataNode<ModuleDependencyData>)dataNode); if (dataNode.getParent() != null && dataNode.getParent().getData() instanceof AbstractDependencyData) { result.add(moduleDependencyDataExternalSystemNode); } else { depNodeChildren.add(moduleDependencyDataExternalSystemNode); } } for (DataNode<?> dataNode : libDeps) { if (!(dataNode.getData() instanceof LibraryDependencyData)) continue; //noinspection unchecked final ExternalSystemNode<LibraryDependencyData> libraryDependencyDataExternalSystemNode = new LibraryDependencyDataExternalSystemNode(externalProjectsView, (DataNode<LibraryDependencyData>)dataNode); if (((LibraryDependencyData)dataNode.getData()).getTarget().isUnresolved()) { libraryDependencyDataExternalSystemNode.setErrorLevel( ExternalProjectsStructure.ErrorLevel.ERROR, "Unable to resolve " + ((LibraryDependencyData)dataNode.getData()).getTarget().getExternalName()); } else { libraryDependencyDataExternalSystemNode.setErrorLevel(ExternalProjectsStructure.ErrorLevel.NONE); } if (dataNode.getParent() != null && dataNode.getParent().getData() instanceof ModuleData) { depNodeChildren.add(libraryDependencyDataExternalSystemNode); } else { result.add(libraryDependencyDataExternalSystemNode); } } if (!depNodeChildren.isEmpty()) { final ExternalSystemNode<?> depNode = new MyDependenciesNode(externalProjectsView); depNode.addAll(depNodeChildren); result.add(depNode); } } }
addDependenciesNode
276,727
void (@NotNull ExternalProjectsView externalProjectsView, @NotNull MultiMap<Key<?>, DataNode<?>> dataNodes, @NotNull List<? super ExternalSystemNode<?>> result) { final Collection<DataNode<?>> moduleDataNodes = dataNodes.get(ProjectKeys.MODULE); if (!moduleDataNodes.isEmpty()) { final AbstractExternalSystemSettings systemSettings = ExternalSystemApiUtil.getSettings(externalProjectsView.getProject(), externalProjectsView.getSystemId()); final Map<String, ModuleNode> groupToModule = new HashMap<>(moduleDataNodes.size()); List<ModuleNode> moduleNodes = new ArrayList<>(); for (DataNode<?> dataNode : moduleDataNodes) { final ModuleData data = (ModuleData)dataNode.getData(); final ExternalProjectSettings projectSettings = systemSettings.getLinkedProjectSettings(data.getLinkedExternalProjectPath()); DataNode<ProjectData> projectDataNode = ExternalSystemApiUtil.findParent(dataNode, ProjectKeys.PROJECT); final boolean isRoot = projectSettings != null && data.getLinkedExternalProjectPath().equals(projectSettings.getExternalProjectPath()) && projectDataNode != null && projectDataNode.getData().getInternalName().equals(data.getInternalName()); //noinspection unchecked final ModuleNode moduleNode = new ModuleNode(externalProjectsView, (DataNode<ModuleData>)dataNode, null, isRoot); moduleNodes.add(moduleNode); String group = moduleNode.getIdeGrouping(); if (group != null) { groupToModule.put(group, moduleNode); } } for (ModuleNode moduleNode : moduleNodes) { moduleNode.setAllModules(moduleNodes); String parentGroup = moduleNode.getIdeParentGrouping(); ModuleNode parent = parentGroup != null ? groupToModule.get(parentGroup) : null; if (parent == null) { continue; } moduleNode.setParent(parent); } result.addAll(moduleNodes); } }
addModuleNodes
276,728
void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(AllIcons.Nodes.PpLibFolder); }
update
276,729
String () { return "Dependencies"; }
getName
276,730
String () { return myDependenciesGraph.getScope(); }
getName
276,731
void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(AllIcons.Nodes.PpLibFolder); String description = myDependenciesGraph.getDescription(); if (description != null) { setNameAndTooltip(presentation, getName(), description, (String)null); } }
update
276,732
void (@NotNull Long2ObjectMap<DependencyNode> dependencyNodeMap, @NotNull DependencyNode node) { for (DependencyNode child : node.getDependencies()) { if (child instanceof ReferenceNode) continue; dependencyNodeMap.put(child.getId(), child); buildNodesMap(dependencyNodeMap, child); } }
buildNodesMap
276,733
String () { return myName; }
getName
276,734
String () { return "ExternalSystemView.DependencyMenu"; }
getMenuId
276,735
DependencyNode () { return ObjectUtils.chooseNotNull(myReferencedNode, myDependencyNode); }
getDependencyNode
276,736
void (@NotNull PresentationData presentation) { super.update(presentation); boolean isProjectDependency = myDependencyNode instanceof ProjectDependencyNode || myReferencedNode instanceof ProjectDependencyNode; presentation.setIcon(isProjectDependency ? getUiAware().getProjectIcon() : AllIcons.Nodes.PpLib); String tooltip; if (myReferencedNode != null) { tooltip = ExternalSystemBundle.message("external.system.view.nodes.dependency_reference_node_tooltip"); } else { if (myDependencyNode instanceof FileCollectionDependencyNode) { String path = ((FileCollectionDependencyNode)myDependencyNode).getPath(); tooltip = StringUtil.join(path.split(File.pathSeparator), s -> Strings.escapeXmlEntities(s) + "<br/>" , ""); } else { tooltip = null; } } setNameAndTooltip(presentation, getName(), tooltip, (String)null); }
update
276,737
void (SimpleTree tree, InputEvent inputEvent) { if (myReferencedNode == null) { super.handleDoubleClickOrEnter(tree, inputEvent); } else { selectAndExpandReferencedNode(); } }
handleDoubleClickOrEnter
276,738
void () { ExternalProjectsStructure structure = getStructure(); if (structure == null) return; DependencyScopeExternalSystemNode scopeNode = findParent(DependencyScopeExternalSystemNode.class); if (scopeNode == null) return; DependencyExternalSystemNode referencedNode = findReferencedNode(scopeNode); if (referencedNode != null) { structure.select(referencedNode); structure.expand(referencedNode); } }
selectAndExpandReferencedNode
276,739
DependencyExternalSystemNode (ExternalSystemNode<?> node) { for (ExternalSystemNode<?> child : node.getChildren()) { if (child instanceof DependencyExternalSystemNode && ((DependencyExternalSystemNode)child).myDependencyNode == myReferencedNode) { return (DependencyExternalSystemNode)child; } DependencyExternalSystemNode referencedNode = findReferencedNode(child); if (referencedNode != null) return referencedNode; } return null; }
findReferencedNode
276,740
Navigatable () { return myNavigatable; }
getNavigatable
276,741
OrderEntry () { final T data = getData(); if (data == null) return null; final Project project = getProject(); if (project == null) return null; return new IdeModelsProviderImpl(project).findIdeModuleOrderEntry(data); }
getOrderEntry
276,742
int (@NotNull ExternalSystemNode node) { final T myData = getData(); final Object thatData = node.getData(); if (myData instanceof OrderAware && thatData instanceof OrderAware) { int order1 = ((OrderAware)myData).getOrder(); int order2 = ((OrderAware)thatData).getOrder(); if (order1 != order2) { return order1 < order2 ? -1 : 1; } } String dependencyName = getDependencySimpleName(this); String thatDependencyName = getDependencySimpleName(node); return StringUtil.compare(dependencyName, thatDependencyName, true); }
compareTo
276,743
String (@NotNull ExternalSystemNode<?> node) { Object thatData = node.getData(); if (thatData instanceof LibraryDependencyData dependencyData) { String externalName = dependencyData.getExternalName(); if (StringUtil.isEmpty(externalName)) { Set<String> paths = dependencyData.getTarget().getPaths(LibraryPathType.BINARY); if (paths.size() == 1) { return new File(paths.iterator().next()).getName(); } } } return node.getName(); }
getDependencySimpleName
276,744
void (boolean requestFocus) { if (myOrderEntry != null && myProject != null) { ProjectSettingsService.getInstance(myProject).openModuleDependenciesSettings(myOrderEntry.getOwnerModule(), myOrderEntry); } }
navigate
276,745
boolean () { myOrderEntry = myProvider.get(); return myOrderEntry != null; }
canNavigate
276,746
boolean () { return true; }
canNavigateToSource
276,747
void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(getUiAware().getProjectIcon()); final ModuleDependencyData data = getData(); if (data != null) { setNameAndTooltip(presentation, getName(), null, data.getScope().getDisplayName()); } }
update
276,748
void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(AllIcons.Nodes.PpLib); final LibraryDependencyData data = getData(); if (data != null) { setNameAndTooltip(presentation, getName(), null, data.getScope().getDisplayName()); } }
update
276,749
String (@NotNull DataNode<?> node) { Object data = node.getData(); if (data instanceof LibraryDependencyData libraryDependencyData) { String externalName = libraryDependencyData.getExternalName(); if (StringUtil.isEmpty(externalName)) { Set<String> paths = libraryDependencyData.getTarget().getPaths(LibraryPathType.BINARY); if (paths.size() == 1) { String relativePathToRoot = null; String path = ExternalSystemApiUtil.toCanonicalPath(paths.iterator().next()); DataNode<ProjectData> projectDataDataNode = ExternalSystemApiUtil.findParent(node, ProjectKeys.PROJECT); if (projectDataDataNode != null) { relativePathToRoot = FileUtil.getRelativePath(projectDataDataNode.getData().getLinkedExternalProjectPath(), path, '/'); relativePathToRoot = relativePathToRoot != null && StringUtil.startsWith(relativePathToRoot, "../../") ? new File(relativePathToRoot).getName() : relativePathToRoot; } return ObjectUtils.notNull(relativePathToRoot, path); } else { return "<file set>"; } } return externalName; } if (data instanceof Named) { return ((Named)data).getExternalName(); } if (data instanceof TaskData) { return ((TaskData)data).getName(); } return StringUtil.notNullize(node.toString()); }
getNodeDisplayName
276,750
void (@NotNull PresentationData presentation) { super.update(presentation); presentation.setIcon(AllIcons.Nodes.ConfigFolder); }
update
276,751
String () { return message("external.system.view.nodes.run_configurations.name"); }
getName
276,752
boolean () { return super.isVisible() && hasChildren(); }
isVisible
276,753
void () { cleanUpCache(); getExternalProjectsView().updateUpTo(this); }
updateRunConfigurations
276,754
StateStorage (@NotNull StateStorageManager storageManager) { ComponentManager componentManager = storageManager.getComponentManager(); assert componentManager != null; if (path.equals(StoragePathMacros.MODULE_FILE)) { return new ExternalModuleStorage((Module)componentManager, storageManager); } Project project = (Project)componentManager; if (inProjectStateSpec == null) { return new ExternalProjectStorage(path, project, storageManager); } else { return new ExternalProjectFilteringStorage(path, project, storageManager, inProjectStateSpec.name(), (DirectoryBasedStorage)storageManager.getStateStorage(inProjectStateSpec.storages()[0])); } }
create
276,755
String () { return "external//" + path; }
getKey
276,756
Icon (@NotNull DataNode node, @NotNull ExternalSystemUiAware uiAware) { if(ProjectKeys.PROJECT.equals(node.getKey())) { return uiAware.getProjectIcon(); } else if(ProjectKeys.MODULE.equals(node.getKey())) { return uiAware.getProjectIcon(); } return null; }
suggestIcon
276,757
void (String moduleName, String groupId, String artifactId, String version) { myState.moduleMapping.add(String.join(":", moduleName, groupId, artifactId, version)); }
addMapping
276,758
void (@NotNull State state) { myState = state; }
loadState
276,759
void (@NotNull AnActionEvent e) { super.update(e); if(this.getClass() != DetachExternalProjectAction.class) return; ProjectSystemId systemId = getSystemId(e); final String systemIdName = systemId != null ? systemId.getReadableName() : "External"; Presentation presentation = e.getPresentation(); presentation.setText(ExternalSystemBundle.messagePointer("action.detach.external.project.text", systemIdName)); }
update
276,760
ActionUpdateThread () { return super.getActionUpdateThread(); }
getActionUpdateThread
276,761
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; return e.getData(ExternalSystemDataKeys.SELECTED_PROJECT_NODE) != null; }
isEnabled
276,762
void (@NotNull final Project project, @NotNull ProjectSystemId projectSystemId, @NotNull ProjectData projectData, @NotNull AnActionEvent e) { e.getPresentation().setText( ExternalSystemBundle.messagePointer("action.detach.external.project.text", projectSystemId.getReadableName()) ); final ProjectNode projectNode = e.getData(ExternalSystemDataKeys.SELECTED_PROJECT_NODE); assert projectNode != null; detachProject(project, projectSystemId, projectData, projectNode); }
perform
276,763
void (@NotNull final Project project, @NotNull ProjectSystemId projectSystemId, @NotNull ProjectData projectData, ProjectNode projectNode) { ExternalSystemApiUtil.getLocalSettings(project, projectSystemId). forgetExternalProjects(Collections.singleton(projectData.getLinkedExternalProjectPath())); ExternalSystemApiUtil.getSettings(project, projectSystemId).unlinkExternalProject(projectData.getLinkedExternalProjectPath()); ExternalProjectsManagerImpl.getInstance(project).forgetExternalProjectData(projectSystemId, projectData.getLinkedExternalProjectPath()); // Process orphan modules. List<Module> orphanModules = new ArrayList<>(); for (Module module : ModuleManager.getInstance(project).getModules()) { if (!ExternalSystemApiUtil.isExternalSystemAwareModule(projectSystemId, module)) continue; String path = ExternalSystemApiUtil.getExternalRootProjectPath(module); if (projectData.getLinkedExternalProjectPath().equals(path)) { orphanModules.add(module); } } if (!orphanModules.isEmpty()) { if (projectNode != null) { projectNode.getGroup().remove(projectNode); } ProjectDataManagerImpl.getInstance().removeData( ProjectKeys.MODULE, orphanModules, Collections.emptyList(), projectData, project, false); } }
detachProject
276,764
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
276,765
boolean (@NotNull AnActionEvent e) { return super.isEnabled(e) && getTree(e) != null; }
isEnabled
276,766
JTree (@NotNull AnActionEvent e) { return e.getData(ExternalSystemDataKeys.PROJECTS_TREE); }
getTree
276,767
void (@NotNull AnActionEvent e) { JTree tree = getTree(e); if (tree == null) return; TreeUtil.collapseAll(tree, -1); }
actionPerformed
276,768
void (@NotNull AnActionEvent e) { JTree tree = getTree(e); if (tree == null) return; TreeUtil.expandAll(tree); }
actionPerformed
276,769
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; final ExternalEntityData externalData = getExternalData(e, ExternalEntityData.class); if (!(externalData instanceof ExternalConfigPathAware)) return false; VirtualFile config = getExternalConfig((ExternalConfigPathAware)externalData, externalData.getOwner()); if (config == null) return false; ProjectSystemId externalSystemId = getSystemId(e); e.getPresentation().setText(ExternalSystemBundle.messagePointer("action.open.config.text", externalSystemId.getReadableName())); e.getPresentation().setDescription(ExternalSystemBundle.messagePointer("action.open.config.description", externalSystemId.getReadableName())); final ExternalSystemUiAware uiAware = getExternalSystemUiAware(e); if (uiAware != null) { e.getPresentation().setIcon(uiAware.getProjectIcon()); } return true; }
isEnabled
276,770
void (@NotNull Project project, @NotNull ProjectSystemId systemId, @NotNull ExternalConfigPathAware configPathAware, @NotNull AnActionEvent e) { VirtualFile configFile = getExternalConfig(configPathAware, systemId); if (configFile != null) { OpenFileDescriptor descriptor = new OpenFileDescriptor(project, configFile); FileEditorManager.getInstance(project).openTextEditor(descriptor, true); } }
perform
276,771
void (final String actionId, final InputEvent e) { executeAction(actionId, "", e); }
executeAction
276,772
void (final String actionId, @NotNull final String place, final InputEvent e) { final ActionManager actionManager = ActionManager.getInstance(); final AnAction action = actionManager.getAction(actionId); if (action != null) { ActionUtil.invokeAction(action, e.getComponent(), place, e, null); } }
executeAction
276,773
Module (DataContext context) { final Module module = PlatformCoreDataKeys.MODULE.getData(context); return module != null ? module : LangDataKeys.MODULE_CONTEXT.getData(context); }
getModule
276,774
void (final SimpleTree tree, final CheckboxHandler handler) { final JCheckBox checkbox = new JCheckBox(); final JPanel panel = new JPanel(new BorderLayout()); panel.add(checkbox, BorderLayout.WEST); final TreeCellRenderer baseRenderer = tree.getCellRenderer(); tree.setCellRenderer(new TreeCellRenderer() { @Override public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { final Component baseComponent = baseRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); final Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); if (!handler.isVisible(userObject)) { return baseComponent; } Color foreground = UIUtil.getTreeForeground(selected, hasFocus); Color background = UIUtil.getTreeBackground(selected, hasFocus); panel.add(baseComponent, BorderLayout.CENTER); panel.setBackground(background); panel.setForeground(foreground); CheckBoxState state = handler.getState(userObject); checkbox.setSelected(state != CheckBoxState.UNCHECKED); checkbox.setEnabled(state != CheckBoxState.PARTIAL); checkbox.setBackground(background); checkbox.setForeground(foreground); return panel; } }); tree.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { int row = tree.getRowForLocation(e.getX(), e.getY()); if (row >= 0) { TreePath path = tree.getPathForRow(row); if (!isCheckboxEnabledFor(path, handler)) return; Rectangle checkBounds = checkbox.getBounds(); checkBounds.setLocation(tree.getRowBounds(row).getLocation()); if (checkBounds.contains(e.getPoint())) { handler.toggle(path, e); e.consume(); tree.setSelectionRow(row); } } } }); tree.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { TreePath[] treePaths = tree.getSelectionPaths(); if (treePaths != null) { for (TreePath treePath : treePaths) { if (!isCheckboxEnabledFor(treePath, handler)) continue; handler.toggle(treePath, e); } e.consume(); } } } }); }
installCheckboxRenderer
276,775
Component (final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { final Component baseComponent = baseRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); final Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); if (!handler.isVisible(userObject)) { return baseComponent; } Color foreground = UIUtil.getTreeForeground(selected, hasFocus); Color background = UIUtil.getTreeBackground(selected, hasFocus); panel.add(baseComponent, BorderLayout.CENTER); panel.setBackground(background); panel.setForeground(foreground); CheckBoxState state = handler.getState(userObject); checkbox.setSelected(state != CheckBoxState.UNCHECKED); checkbox.setEnabled(state != CheckBoxState.PARTIAL); checkbox.setBackground(background); checkbox.setForeground(foreground); return panel; }
getTreeCellRendererComponent
276,776
void (MouseEvent e) { int row = tree.getRowForLocation(e.getX(), e.getY()); if (row >= 0) { TreePath path = tree.getPathForRow(row); if (!isCheckboxEnabledFor(path, handler)) return; Rectangle checkBounds = checkbox.getBounds(); checkBounds.setLocation(tree.getRowBounds(row).getLocation()); if (checkBounds.contains(e.getPoint())) { handler.toggle(path, e); e.consume(); tree.setSelectionRow(row); } } }
mousePressed
276,777
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { TreePath[] treePaths = tree.getSelectionPaths(); if (treePaths != null) { for (TreePath treePath : treePaths) { if (!isCheckboxEnabledFor(treePath, handler)) continue; handler.toggle(treePath, e); } e.consume(); } } }
keyPressed
276,778
boolean (TreePath path, CheckboxHandler handler) { Object userObject = ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject(); return handler.isVisible(userObject); }
isCheckboxEnabledFor
276,779
ExternalTaskExecutionInfo (@NotNull TaskData task) { ExternalSystemTaskExecutionSettings settings = new ExternalSystemTaskExecutionSettings(); settings.setExternalProjectPath(task.getLinkedExternalProjectPath()); settings.setTaskNames(Collections.singletonList(task.getName())); settings.setTaskDescriptions(Collections.singletonList(task.getDescription())); settings.setExternalSystemIdString(task.getOwner().toString()); return new ExternalTaskExecutionInfo(settings, DefaultRunExecutor.EXECUTOR_ID); }
buildTaskInfo
276,780
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null || selectedNodes.size() != 1) return false; return selectedNodes.get(0) instanceof RunConfigurationNode; }
isEnabled
276,781
void (@NotNull AnActionEvent e) { Project project = getProject(e); assert project != null; final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode)) return; RunnerAndConfigurationSettings settings = ((RunConfigurationNode)selectedNodes.get(0)).getSettings(); assert settings != null; ExternalSystemActionsCollector.trigger(project, getSystemId(e), this, e); int res = Messages.showYesNoDialog(project, ExternalSystemBundle.message("delete.0", settings.getName()), ExternalSystemBundle.message("confirmation"), Messages.getQuestionIcon()); if (res == Messages.YES) { RunManager.getInstance(project).removeConfiguration(settings); RunConfigurationOptionUsagesCollector.logRemove(project, settings.getFactory().getType().getId(), e.getPlace()); } }
actionPerformed
276,782
void (@NotNull AnActionEvent e) { super.update(e); if(this.getClass() != RefreshExternalProjectAction.class) return; ProjectSystemId systemId = getSystemId(e); final String systemIdNameText = systemId != null ? systemId.getReadableName() : "External"; final String systemIdNameDescription = systemId != null ? systemId.getReadableName() : "external"; Presentation presentation = e.getPresentation(); presentation.setText(ExternalSystemBundle.messagePointer("action.refresh.project.text", systemIdNameText)); presentation.setDescription(ExternalSystemBundle.messagePointer("action.refresh.project.description", systemIdNameDescription)); }
update
276,783
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null || selectedNodes.size() != 1) return false; final Object externalData = selectedNodes.get(0).getData(); return (externalData instanceof ProjectData || externalData instanceof ModuleData); }
isEnabled
276,784
void (@NotNull final Project project, @NotNull ProjectSystemId projectSystemId, @NotNull AbstractExternalEntityData externalEntityData, @NotNull AnActionEvent e) { final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); final ExternalSystemNode<?> externalSystemNode = ContainerUtil.getFirstItem(selectedNodes); assert externalSystemNode != null; final ExternalConfigPathAware externalConfigPathAware = externalSystemNode.getData() instanceof ExternalConfigPathAware ? (ExternalConfigPathAware)externalSystemNode.getData() : null; assert externalConfigPathAware != null; // We save all documents because there is a possible case that there is an external system config file changed inside the ide. FileDocumentManager.getInstance().saveAllDocuments(); final ExternalProjectSettings linkedProjectSettings = ExternalSystemApiUtil.getSettings( project, projectSystemId).getLinkedProjectSettings(externalConfigPathAware.getLinkedExternalProjectPath()); final String externalProjectPath = linkedProjectSettings == null ? externalConfigPathAware.getLinkedExternalProjectPath() : linkedProjectSettings.getExternalProjectPath(); ImportSpecBuilder importSpec = new ImportSpecBuilder(project, projectSystemId); if (ExternalSystemUtil.confirmLoadingUntrustedProject(project, projectSystemId)) { ExternalSystemUtil.refreshProject(externalProjectPath, importSpec); } }
perform
276,785
void (@NotNull AnActionEvent e) { super.update(e); Presentation p = e.getPresentation(); final boolean visible = isVisible(e); p.setVisible(visible); p.setEnabled(visible && isEnabled(e)); }
update
276,786
boolean (@NotNull AnActionEvent e) { return hasProject(e); }
isEnabled
276,787
boolean (@NotNull AnActionEvent e) { return true; }
isVisible
276,788
boolean (@NotNull AnActionEvent e) { if (!isEnabled(e)) return false; return doIsSelected(e); }
isSelected
276,789
Project (@NotNull AnActionEvent e) { return e.getProject(); }
getProject
276,790
boolean (@NotNull AnActionEvent e) { return getProject(e) != null; }
hasProject
276,791
ProjectSystemId (@NotNull AnActionEvent e) { return e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID); }
getSystemId
276,792
void (@NlsActions.ActionText String message) { getTemplatePresentation().setText(message); }
setText
276,793
void (@NlsActions.ActionDescription String message) { getTemplatePresentation().setDescription(message); }
setDescription
276,794
void (@NotNull AnActionEvent e, @NlsActions.ActionText String message) { e.getPresentation().setText(message); }
setText
276,795
void (@NotNull AnActionEvent e, @NlsActions.ActionDescription String message) { e.getPresentation().setDescription(message); }
setDescription
276,796
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,797
void (@NotNull AnActionEvent e, boolean state) { final ProjectSystemId projectSystemId = getSystemId(e); final List<ExternalSystemNode<ExternalConfigPathAware>> projectNodes = getProjectNodes(e); if (projectNodes.isEmpty()) return; final Project project = getProject(e); ExternalSystemActionsCollector.trigger(project, projectSystemId, this, e); projectNodes.forEach(projectNode -> projectNode.setIgnored(state)); Set<DataNode<ProjectData>> uniqueExternalProjects = projectNodes.stream() .map( projectNode -> { final String externalProjectPath = projectNode.getData().getLinkedExternalProjectPath(); final ExternalProjectInfo externalProjectInfo = ExternalSystemUtil.getExternalProjectInfo(project, projectSystemId, externalProjectPath); final DataNode<ProjectData> projectDataNode = externalProjectInfo == null ? null : externalProjectInfo.getExternalProjectStructure(); if (projectDataNode == null && LOG.isDebugEnabled()) { LOG.debug(String.format("external project data not found, path: %s, data: %s", externalProjectPath, externalProjectInfo)); } return projectDataNode; } ) .filter(Objects::nonNull) .collect(Collectors.toSet()); // async import to not block UI on big projects ProgressManager.getInstance().run(new Task.Backgroundable(project, e.getPresentation().getText(), false) { @Override public void run(@NotNull ProgressIndicator indicator) { uniqueExternalProjects.forEach( externalProjectInfo -> ProjectDataManager.getInstance().importData(externalProjectInfo, project) ); } }); }
setSelected
276,798
void (@NotNull ProgressIndicator indicator) { uniqueExternalProjects.forEach( externalProjectInfo -> ProjectDataManager.getInstance().importData(externalProjectInfo, project) ); }
run
276,799
boolean (@NotNull AnActionEvent e) { boolean selected = super.isSelected(e); ProjectSystemId systemId = getSystemId(e); final String systemIdNameText = systemId != null ? systemId.getReadableName() : "External"; final String systemIdNameDescription = systemId != null ? systemId.getReadableName() : "external"; int size = getProjectNodes(e).size(); if (selected) { setText(e, ExternalSystemBundle.message("action.unignore.external.projects.text", systemIdNameText, size)); setDescription(e, ExternalSystemBundle.message("action.unignore.external.projects.description", systemIdNameDescription, size)); } else { setText(e, ExternalSystemBundle.message("action.ignore.external.projects.text", systemIdNameText, size)); setDescription(e, ExternalSystemBundle.message("action.ignore.external.projects.description", systemIdNameDescription, size)); } return selected; }
isSelected