Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
276,800
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; return !getProjectNodes(e).isEmpty(); }
isEnabled
276,801
boolean (@NotNull AnActionEvent e) { return ContainerUtil.exists(getProjectNodes(e), projectNode -> projectNode.isIgnored()); }
doIsSelected
276,802
List<ExternalSystemNode<ExternalConfigPathAware>> (@NotNull AnActionEvent e) { final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null || selectedNodes.isEmpty()) return Collections.emptyList(); return selectedNodes.stream() .map(node -> (node instanceof ModuleNode || node instanceof ProjectNode) ? (ExternalSystemNode<ExternalConfigPathAware>)node : null) .filter(Objects::nonNull) .collect(Collectors.toList()); }
getProjectNodes
276,803
void (@NotNull AnActionEvent e) { Presentation p = e.getPresentation(); final boolean visible = isVisible(e); p.setVisible(visible); p.setEnabled(visible && isEnabled(e)); }
update
276,804
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,805
boolean (@NotNull AnActionEvent e) { return hasProject(e) && getSystemId(e) != null; }
isEnabled
276,806
boolean (@NotNull AnActionEvent e) { return true; }
isVisible
276,807
Project (@NotNull AnActionEvent e) { return e.getProject(); }
getProject
276,808
ProjectSystemId (@NotNull AnActionEvent e) { return e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID); }
getSystemId
276,809
boolean (@NotNull AnActionEvent e) { return getProject(e) != null; }
hasProject
276,810
void (@NlsActions.ActionText String message) { getTemplatePresentation().setText(message); }
setText
276,811
void (@NlsActions.ActionDescription String message) { getTemplatePresentation().setDescription(message); }
setDescription
276,812
void (@NotNull AnActionEvent e, @NlsActions.ActionText String message) { e.getPresentation().setText(message); }
setText
276,813
void (@NotNull AnActionEvent e) { final Project project = e.getProject(); if (project == null) { e.getPresentation().setEnabled(false); return; } final List<ProjectSystemId> systemIds = getSystemIds(e); if (systemIds.isEmpty()) { e.getPresentation().setEnabled(false); return; } final String name = StringUtil.join(systemIds, projectSystemId -> projectSystemId.getReadableName(), ","); e.getPresentation().setText(ExternalSystemBundle.messagePointer("action.refresh.all.projects.text", name)); e.getPresentation().setDescription(ExternalSystemBundle.messagePointer("action.refresh.all.projects.description", name)); ExternalSystemProcessingManager processingManager = ApplicationManager.getApplication().getService(ExternalSystemProcessingManager.class); e.getPresentation().setEnabled(!processingManager.hasTaskOfTypeInProgress(ExternalSystemTaskType.RESOLVE_PROJECT, project)); }
update
276,814
void (@NotNull AnActionEvent e) { final Project project = e.getProject(); if (project == null) { e.getPresentation().setEnabled(false); return; } final List<ProjectSystemId> systemIds = getSystemIds(e); if (systemIds.isEmpty()) { e.getPresentation().setEnabled(false); return; } // 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(); if (ExternalSystemUtil.confirmLoadingUntrustedProject(project, systemIds)) { for (ProjectSystemId externalSystemId : systemIds) { ExternalSystemActionsCollector.trigger(project, externalSystemId, this, e); ExternalSystemUtil.refreshProjects(new ImportSpecBuilder(project, externalSystemId)); } } }
actionPerformed
276,815
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,816
List<ProjectSystemId> (@NotNull AnActionEvent e) { List<ProjectSystemId> systemIds = new ArrayList<>(); ProjectSystemId externalSystemId = e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID); if (externalSystemId == null) { ExternalSystemManager.EP_NAME.forEachExtensionSafe(manager -> systemIds.add(manager.getSystemId())); } else { systemIds.add(externalSystemId); } return systemIds; }
getSystemIds
276,817
boolean (@NotNull AnActionEvent e) { return super.isEnabled(e) && getSystemId(e) != null && getExternalData(e, myExternalDataClazz) != null; }
isEnabled
276,818
void (@NotNull AnActionEvent e) { final Project project = getProject(e); if (project == null) return; ProjectSystemId projectSystemId = getSystemId(e); if (projectSystemId == null) return; final T data = getExternalData(e, myExternalDataClazz); if (data == null) return; ExternalSystemActionsCollector.trigger(project, projectSystemId, this, e); perform(project, projectSystemId, data, e); }
actionPerformed
276,819
ExternalSystemUiAware (@NotNull AnActionEvent e) { return e.getData(ExternalSystemDataKeys.UI_AWARE); }
getExternalSystemUiAware
276,820
boolean (@NotNull AnActionEvent e) { ExternalSystemNode node = ContainerUtil.getFirstItem(e.getData(ExternalSystemDataKeys.SELECTED_NODES)); return node != null && myExternalDataClazz.isInstance(node.getData()) && node.isIgnored(); }
isIgnoredNode
276,821
VirtualFile (@NotNull ExternalConfigPathAware data, ProjectSystemId externalSystemId) { String path = data.getLinkedExternalProjectPath(); LocalFileSystem fileSystem = LocalFileSystem.getInstance(); VirtualFile externalSystemConfigPath = fileSystem.refreshAndFindFileByPath(path); if (externalSystemConfigPath == null) { return null; } VirtualFile toOpen = externalSystemConfigPath; for (ExternalSystemConfigLocator locator : ExternalSystemConfigLocator.EP_NAME.getExtensions()) { if (externalSystemId.equals(locator.getTargetExternalSystemId())) { toOpen = locator.adjust(toOpen); if (toOpen == null) { return null; } break; } } return toOpen.isDirectory() ? null : toOpen; }
getExternalConfig
276,822
void (@NotNull AnActionEvent e) { for (AnAction action : getChildActionsOrStubs()) { if (action instanceof ExecuteExternalSystemRunConfigurationAction) { remove(action); } } Project project = e.getProject(); List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode runConfigurationNode)) { return; } final RunnerAndConfigurationSettings settings = runConfigurationNode.getSettings(); if (settings == null || project == null) return; ProjectSystemId projectSystemId = e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID); @SuppressWarnings("DuplicatedCode") final List<Executor> executors = new ArrayList<>(); for (final Executor executor: Executor.EXECUTOR_EXTENSION_NAME.getExtensionList()) { if (executor instanceof ExecutorGroup) { executors.addAll(((ExecutorGroup<?>)executor).childExecutors()); } else { executors.add(executor); } } for (int i = executors.size(); --i >= 0; ) { Executor executor = executors.get(i); if (!executor.isApplicable(project)) { continue; } ProgramRunner<?> runner = ProgramRunner.getRunner(executor.getId(), settings.getConfiguration()); AnAction action = new ExecuteExternalSystemRunConfigurationAction(executor, runner != null, project, projectSystemId, settings); addAction(action, Constraints.FIRST); } super.update(e); }
update
276,823
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,824
void (@NotNull AnActionEvent event) { if (myEnabled) { ExternalSystemActionsCollector.trigger(myProject, mySystemId, this, event); ProgramRunnerUtil.executeConfiguration(mySettings, myExecutor); RunManager.getInstance(myProject).setSelectedConfiguration(mySettings); } }
actionPerformed
276,825
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(myEnabled); }
update
276,826
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,827
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(); ProjectSystemId projectSystemId = getSystemId(e); e.getPresentation().setText(ExternalSystemBundle.messagePointer("external.system.task.activation.title")); e.getPresentation().setDescription( ExternalSystemBundle.messagePointer("external.system.task.activation.description", projectSystemId.getReadableName())); final boolean isProjectNode = externalData instanceof ProjectData || externalData instanceof ModuleData; return isProjectNode && StringUtil.isNotEmpty(((ExternalConfigPathAware) externalData).getLinkedExternalProjectPath()); }
isEnabled
276,828
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; new ConfigureTasksActivationDialog(project, projectSystemId, externalConfigPathAware.getLinkedExternalProjectPath()).showAndGet(); }
perform
276,829
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,830
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); RunManager.getInstance(project).setSelectedConfiguration(settings); EditConfigurationsDialog dialog = new EditConfigurationsDialog(project); dialog.show(); }
actionPerformed
276,831
void (@NotNull AnActionEvent e) { final Project project = getProject(e); final ProjectSystemId projectSystemId = getSystemId(e); ExternalSystemActionsCollector.trigger(project, projectSystemId, this, e); final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); final ExternalProjectInfo projectInfo; final ExternalSystemNode<?> externalSystemNode = ContainerUtil.getFirstItem(selectedNodes); if (externalSystemNode == null) { projectInfo = ContainerUtil.getFirstItem(ProjectDataManager.getInstance().getExternalProjectsData(project, projectSystemId)); } else { final ProjectNode projectNode = externalSystemNode instanceof ProjectNode ? (ProjectNode)externalSystemNode : externalSystemNode.findParent(ProjectNode.class); assert projectNode != null; final ProjectData projectData = projectNode.getData(); assert projectData != null; projectInfo = ProjectDataManager.getInstance().getExternalProjectData(project, projectSystemId, projectData.getLinkedExternalProjectPath()); } final ExternalProjectDataSelectorDialog dialog; if (projectInfo != null) { dialog = new ExternalProjectDataSelectorDialog(project, projectInfo, externalSystemNode != null ? externalSystemNode.getData() : null); dialog.showAndGet(); } }
actionPerformed
276,832
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; ProjectSystemId systemId = getSystemId(e); if (systemId == null) return false; e.getPresentation().setText(ExternalSystemBundle.messagePointer("action.open.settings.text", systemId.getReadableName())); e.getPresentation().setDescription(ExternalSystemBundle.messagePointer("action.open.settings.description", systemId.getReadableName())); return true; }
isEnabled
276,833
void (@NotNull AnActionEvent e) { final ProjectSystemId systemId = getSystemId(e); if (systemId != null) { Project project = getProject(e); ExternalSystemActionsCollector.trigger(project, systemId, this, e); showSettingsFor(project, systemId); } }
actionPerformed
276,834
void (Project project, @NotNull ProjectSystemId systemId) { ShowSettingsUtil.getInstance().showSettingsDialog(project, systemId.getReadableName()); }
showSettingsFor
276,835
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
276,836
boolean (@NotNull AnActionEvent e) { if (!super.isEnabled(e)) return false; return getView() != null; }
isEnabled
276,837
boolean (@NotNull AnActionEvent e) { final ExternalProjectsViewImpl view = getView(); return view != null && isSelected(view); }
doIsSelected
276,838
void (@NotNull AnActionEvent e, boolean state) { final ExternalProjectsViewImpl view = getView(); if (view != null){ // es system id does not available in the action context, get it from the view ProjectSystemId systemId = view.getSystemId(); ExternalSystemActionsCollector.trigger(getProject(e), systemId, this, e); setSelected(view, state); } }
setSelected
276,839
ExternalProjectsViewImpl () { return myView; }
getView
276,840
void (ExternalProjectsViewImpl view) { myView = view; }
setView
276,841
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,842
void (@NotNull AnActionEvent e) { Project project = getProject(e); assert project != null; ExternalSystemActionsCollector.trigger(project, getSystemId(e), this, e); 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; ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration)settings.getConfiguration(); String actionIdPrefix = getActionPrefix(project, runConfiguration.getSettings().getExternalProjectPath()); String actionId = actionIdPrefix + settings.getName(); AnAction action = ActionManager.getInstance().getAction(actionId); if (action == null) { ExternalSystemKeymapExtension.getOrRegisterAction(project, settings); } new EditKeymapsDialog(project, actionId).show(); }
actionPerformed
276,843
boolean (@NotNull AnActionEvent e) { return super.isEnabled(e) && !getTasks(e).isEmpty(); }
isEnabled
276,844
boolean (@NotNull AnActionEvent e) { return hasTask(getTaskActivator(e), getTasks(e).get(0)); }
doIsSelected
276,845
void (@NotNull AnActionEvent e, boolean state) { ExternalSystemActionsCollector.trigger(getProject(e), getSystemId(e), this, e); List<TaskData> tasks = getTasks(e); if (state) { addTasks(getTaskActivator(e), tasks); } else { removeTasks(getTaskActivator(e), tasks); } }
setSelected
276,846
List<TaskData> (@NotNull AnActionEvent e) { final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null) return Collections.emptyList(); List<TaskData> tasks = new SmartList<>(); for (ExternalSystemNode node : selectedNodes) { if (node instanceof TaskNode && !node.isIgnored()) { tasks.add((TaskData)node.getData()); } else if (node instanceof RunConfigurationNode) { final RunnerAndConfigurationSettings configurationSettings = ((RunConfigurationNode)node).getSettings(); final ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration)configurationSettings.getConfiguration(); final ExternalSystemTaskExecutionSettings taskExecutionSettings = runConfiguration.getSettings(); tasks.add(new TaskData(taskExecutionSettings.getExternalSystemId(), RUN_CONFIGURATION_TASK_PREFIX + configurationSettings.getName(), taskExecutionSettings.getExternalProjectPath(), null)); } else { return Collections.emptyList(); } } return tasks; }
getTasks
276,847
boolean (ExternalSystemTaskActivator manager, TaskData taskData) { if (taskData == null) return false; return manager.isTaskOfPhase(taskData, myPhase); }
hasTask
276,848
void (ExternalSystemTaskActivator taskActivator, List<TaskData> tasks) { taskActivator.addTasks(tasks, myPhase); }
addTasks
276,849
void (ExternalSystemTaskActivator taskActivator, List<TaskData> tasks) { taskActivator.removeTasks(tasks, myPhase); }
removeTasks
276,850
ExternalSystemTaskActivator (@NotNull AnActionEvent e) { return ExternalProjectsManagerImpl.getInstance(getProject(e)).getTaskActivator(); }
getTaskActivator
276,851
boolean (@NotNull AnActionEvent e) { return super.isEnabled(e) && !isIgnoredNode(e); }
isEnabled
276,852
void (@NotNull Project project, @NotNull ProjectSystemId projectSystemId, @NotNull TaskData taskData, @NotNull AnActionEvent e) { ExternalSystemActionsCollector.trigger(project, projectSystemId, this, e); final ExternalSystemShortcutsManager shortcutsManager = ExternalProjectsManagerImpl.getInstance(project).getShortcutsManager(); final String actionId = shortcutsManager.getActionId(taskData.getLinkedExternalProjectPath(), taskData.getName()); AnAction action = ActionManager.getInstance().getAction(actionId); if (action == null) { ExternalSystemNode<?> taskNode = ContainerUtil.getFirstItem(e.getData(ExternalSystemDataKeys.SELECTED_NODES)); assert taskNode != null; final String group; final ModuleNode moduleDataNode = taskNode.findParent(ModuleNode.class); if (moduleDataNode != null) { ModuleData moduleData = moduleDataNode.getData(); group = moduleData != null ? moduleData.getInternalName() : null; } else { ProjectNode projectNode = taskNode.findParent(ProjectNode.class); ProjectData projectData = projectNode != null ? projectNode.getData() : null; group = projectData != null ? projectData.getInternalName() : null; } if (group != null) { ExternalSystemKeymapExtension.getOrRegisterAction(project, group, taskData); } } new EditKeymapsDialog(project, actionId).show(); }
perform
276,853
boolean (@NotNull ExternalProjectsViewImpl view) { return view.getGroupModules(); }
isSelected
276,854
void (@NotNull ExternalProjectsViewImpl view, boolean value) { view.setGroupModules(value); }
setSelected
276,855
boolean (@NotNull ExternalProjectsViewImpl view) { return view.getGroupTasks(); }
isSelected
276,856
void (@NotNull ExternalProjectsViewImpl view, boolean value) { view.setGroupTasks(value); }
setSelected
276,857
void (@NotNull Project project, @NotNull ProjectSystemId projectSystemId, @NotNull TaskData taskData, @NotNull AnActionEvent e) { final ExternalTaskExecutionInfo taskExecutionInfo = ExternalSystemActionUtil.buildTaskInfo(taskData); final ConfigurationContext context = ConfigurationContext.getFromContext(e.getDataContext(), e.getPlace()); RunnerAndConfigurationSettings configuration = findOrGet(context); if (configuration == null || !runTaskAsExistingConfiguration(project, projectSystemId, taskExecutionInfo, configuration)) { runTaskAsNewRunConfiguration(project, projectSystemId, taskExecutionInfo); configuration = findOrGet(context); // if created during runTaskAsNewRunConfiguration } context.getRunManager().setSelectedConfiguration(configuration); }
perform
276,858
RunnerAndConfigurationSettings (@NotNull ConfigurationContext context) { RunnerAndConfigurationSettings result = context.findExisting(); if (result == null) { result = context.getConfiguration(); if (result != null) { context.getRunManager().setTemporaryConfiguration(result); RunConfigurationOptionUsagesCollector.logAddNew(context.getProject(), result.getType().getId(), context.getPlace()); } } return result; }
findOrGet
276,859
boolean (@NotNull Project project, @NotNull ProjectSystemId projectSystemId, @NotNull ExternalTaskExecutionInfo taskExecutionInfo, @NotNull RunnerAndConfigurationSettings configuration) { final String executorId = taskExecutionInfo.getExecutorId(); String runnerId = ExternalSystemUtil.getRunnerId(executorId); if (runnerId == null) { return false; } Executor executor = ExecutorRegistry.getInstance().getExecutorById(executorId); ProgramRunner<?> runner = ProgramRunner.findRunnerById(runnerId); if (executor == null || runner == null) { return false; } ExecutionEnvironment environment = new ExecutionEnvironment(executor, runner, configuration, project); ApplicationManager.getApplication().invokeLater(() -> { try { environment.getRunner().execute(environment); } catch (ExecutionException exception) { LOG.error("Failed to execute " + projectSystemId.getReadableName() + " task.", exception); } }); return true; }
runTaskAsExistingConfiguration
276,860
void (@NotNull Project project, @NotNull ProjectSystemId projectSystemId, @NotNull ExternalTaskExecutionInfo taskExecutionInfo) { ExternalSystemUtil.runTask(taskExecutionInfo.getSettings(), taskExecutionInfo.getExecutorId(), project, projectSystemId); }
runTaskAsNewRunConfiguration
276,861
boolean (@NotNull ExternalProjectsViewImpl view) { return view.getShowIgnored(); }
isSelected
276,862
void (@NotNull ExternalProjectsViewImpl view, boolean value) { view.setShowIgnored(value); }
setSelected
276,863
boolean (@NotNull ExternalProjectsViewImpl view) { return view.showInheritedTasks(); }
isSelected
276,864
void (@NotNull ExternalProjectsViewImpl view, boolean value) { view.setShowInheritedTasks(value); }
setSelected
276,865
ExternalSystemSyncDiagnostic () { try { lock.acquire(); if (instance != null) return instance; instance = new ExternalSystemSyncDiagnostic(); } catch (InterruptedException e) { lock.release(); } finally { lock.release(); } return instance; }
getInstance
276,866
String () { return data; }
getJsonString
276,867
Object (@NotNull String query) { if (StringUtil.isEmpty(query)) return null; Object jsonObject = getJsonObject(); for (String part : StringUtil.split(query, ".")) { if (jsonObject instanceof Map) { jsonObject = ((Map<?, ?>)jsonObject).get(part); } else { return null; } } return jsonObject; }
find
276,868
Object () { if (myJsonObject == null) { JsonReaderEx reader = new JsonReaderEx(data); reader.setLenient(true); myJsonObject = JsonUtil.nextAny(reader); } return myJsonObject; }
getJsonObject
276,869
ProjectSystemId () { return projectSystemId; }
getProjectSystemId
276,870
String () { return externalProjectPath; }
getExternalProjectPath
276,871
String () { return externalProjectPath; }
getNullSafeExternalProjectPath
276,872
DataNode<ProjectData> () { return externalProjectStructure; }
getExternalProjectStructure
276,873
long () { return lastSuccessfulImportTimestamp; }
getLastSuccessfulImportTimestamp
276,874
long () { return lastImportTimestamp; }
getLastImportTimestamp
276,875
void (long value) { lastSuccessfulImportTimestamp = value; }
setLastSuccessfulImportTimestamp
276,876
void (long value) { lastImportTimestamp = value; }
setLastImportTimestamp
276,877
String () { return buildNumber; }
getBuildNumber
276,878
ExternalProjectInfo () { InternalExternalProjectInfo copy = new InternalExternalProjectInfo( projectSystemId, externalProjectPath, externalProjectStructure != null ? externalProjectStructure.graphCopy() : null ); copy.setLastImportTimestamp(lastImportTimestamp); copy.setLastSuccessfulImportTimestamp(lastSuccessfulImportTimestamp); return copy; }
copy
276,879
String () { return "InternalExternalProjectInfo{" + "myProjectSystemId=" + projectSystemId + ", externalProjectPath='" + externalProjectPath + '\'' + ", externalProjectStructure=" + externalProjectStructure + ", lastSuccessfulImportTimestamp=" + lastSuccessfulImportTimestamp + ", lastImportTimestamp=" + lastImportTimestamp + '}'; }
toString
276,880
Color () { return myColor; }
getColor
276,881
void () { }
fireModificationCountChanged
276,882
String (@NotNull Object o) { return RemoteExternalSystemFacade.class.getName(); }
getName
276,883
RunProfileState (@NotNull Object o, @NotNull String configuration, @NotNull Executor executor) { return createRunProfileState(configuration); }
getRunProfileState
276,884
RunProfileState (final String configuration) { return new RunProfileState() { private SimpleJavaParameters createJavaParameters() throws ExecutionException { final SimpleJavaParameters params = new SimpleJavaParameters(); params.setJdk(new SimpleJavaSdkType().createJdk("tmp", SystemProperties.getJavaHome())); File myWorkingDirectory = new File(configuration); params.setWorkingDirectory(myWorkingDirectory.isDirectory() ? myWorkingDirectory.getPath() : PathManager.getBinPath()); // IDE jars. Collection<String> classPath = new LinkedHashSet<>(ClassPathUtil.getUtilClassPath()); ContainerUtil.addIfNotNull(classPath, getJarPathForClass(Project.class)); //intellij.platform.core ContainerUtil.addIfNotNull(classPath, getJarPathForClass(PlaceHolder.class)); //intellij.platform.editor ContainerUtil.addIfNotNull(classPath, getJarPathForClass(DependencyScope.class)); //intellij.platform.projectModel ContainerUtil.addIfNotNull(classPath, getJarPathForClass(ProjectExtension.class)); //intellij.platform.projectModel.impl ContainerUtil.addIfNotNull(classPath, getJarPathForClass(Alarm.class)); //intellij.platform.ide ContainerUtil.addIfNotNull(classPath, getJarPathForClass(ExtensionPointName.class)); //intellij.platform.extensions ContainerUtil.addIfNotNull(classPath, getJarPathForClass(StorageUtilKt.class)); //intellij.platform.ide.impl ContainerUtil.addIfNotNull(classPath, getJarPathForClass(ExternalSystemTaskNotificationListener.class)); //intellij.platform.externalSystem ContainerUtil.addIfNotNull(classPath, getJarPathForClass(AtomicFieldUpdater.class)); //intellij.platform.concurrency // java plugin jar if it's installed Class<? extends SdkType> javaSdkClass = ExternalSystemJdkProvider.getInstance().getJavaSdkType().getClass(); ContainerUtil.addIfNotNull(classPath, getJarPathForClass(javaSdkClass)); ContainerUtil.addIfNotNull(classPath, getJarPathForClass(ModuleType.class)); ContainerUtil.addIfNotNull(classPath, getJarPathForClass(EmptyModuleType.class)); // add Kotlin runtime ContainerUtil.addIfNotNull(classPath, getJarPathForClass(Unit.class)); ContainerUtil.addIfNotNull(classPath, getJarPathForClass(NoSuchPropertyException.class)); // External system module jars ContainerUtil.addIfNotNull(classPath, getJarPathForClass(getClass())); // external-system-rt.jar ContainerUtil.addIfNotNull(classPath, getJarPathForClass(ExternalSystemException.class)); // com.intellij.openapi.externalSystem.model.FSTSerializer dependencies ContainerUtil.addIfNotNull(classPath, getJarPathForClass(ObjectSerializer.class)); params.getClassPath().addAll(new ArrayList<>(classPath)); params.setMainClass(MAIN_CLASS_NAME); params.getVMParametersList().addParametersString("-Djava.awt.headless=true"); // It may take a while for external system api to resolve external dependencies. Default RMI timeout // is 15 seconds (http://download.oracle.com/javase/6/docs/technotes/guides/rmi/sunrmiproperties.html#connectionTimeout), // we don't want to get EOFException because of that. params.getVMParametersList().addParametersString( "-Dsun.rmi.transport.connectionTimeout=" + TimeUnit.HOURS.toMillis(1) ); final String debugPort = System.getProperty(ExternalSystemConstants.EXTERNAL_SYSTEM_REMOTE_COMMUNICATION_MANAGER_DEBUG_PORT); if (debugPort != null) { params.getVMParametersList().addParametersString("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=" + debugPort); } ProjectSystemId externalSystemId = myTargetExternalSystemId.get(); if (externalSystemId != null) { ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId); if (manager != null) { params.getClassPath().add(getJarPathForClass(manager.getProjectResolverClass())); params.getClassPath().add(getJarPathForClass(manager.getClass().getSuperclass())); params.getProgramParametersList().add(manager.getProjectResolverClass().getName()); params.getProgramParametersList().add(manager.getTaskManagerClass().getName()); manager.enhanceRemoteProcessing(params); } } return params; } @Override @NotNull public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner<?> runner) throws ExecutionException { ProcessHandler processHandler = startProcess(); return new DefaultExecutionResult(processHandler); } @NotNull private OSProcessHandler startProcess() throws ExecutionException { SimpleJavaParameters params = createJavaParameters(); GeneralCommandLine commandLine = params.toCommandLine(); OSProcessHandler processHandler = new OSProcessHandler(commandLine); ProcessTerminatedListener.attach(processHandler); return processHandler; } }; }
createRunProfileState
276,885
RemoteExternalSystemFacade (@NotNull RemoteExternalSystemFacade facade) { return new ResolverDeserializationWrapper(facade); }
wrapResolverDeserialization
276,886
void (@NotNull String id, @NotNull ProjectSystemId externalSystemId) { mySupport.release(this, id); }
release
276,887
boolean (@NotNull RemoteExternalSystemFacade facade) { RemoteExternalSystemFacade toCheck = facade; if (facade instanceof ExternalSystemFacadeWrapper) { toCheck = ((ExternalSystemFacadeWrapper)facade).getDelegate(); } if (toCheck instanceof InProcessExternalSystemFacadeImpl) { return false; } try { facade.getResolver(); return true; } catch (RemoteException e) { return false; } }
isAlive
276,888
void () { mySupport.stopAll(true); }
clear
276,889
void () { shutdown(false); }
dispose
276,890
Project (@NotNull IntegrationKey key) { final ProjectManager projectManager = ProjectManager.getInstance(); for (Project project : projectManager.getOpenProjects()) { if (key.getIdeProjectName().equals(project.getName()) && key.getIdeProjectLocationHash().equals(project.getLocationHash())) { return project; } } return projectManager.getDefaultProject(); }
findProject
276,891
void (@NotNull String oldName, @NotNull String newName) { onProjectRename(myFacadeWrappers, oldName, newName); onProjectRename(myRemoteFacades, oldName, newName); }
onProjectRename
276,892
RemoteExternalSystemFacade (@Nullable Project project, @NotNull String externalProjectPath, @NotNull ProjectSystemId externalSystemId) { if (project == null) { project = ProjectManager.getInstance().getDefaultProject(); } IntegrationKey key = new IntegrationKey(project, externalSystemId, externalProjectPath); final RemoteExternalSystemFacade facade = myFacadeWrappers.get(key); if (facade == null) { final RemoteExternalSystemFacade newFacade = (RemoteExternalSystemFacade)Proxy.newProxyInstance( ExternalSystemFacadeManager.class.getClassLoader(), new Class[]{RemoteExternalSystemFacade.class, Consumer.class}, new MyHandler(key) ); myFacadeWrappers.putIfAbsent(key, newFacade); } return myFacadeWrappers.get(key); }
getFacade
276,893
ExternalSystemCommunicationManager (@NotNull ProjectSystemId externalSystemId) { final boolean currentInProcess = ExternalSystemApiUtil.isInProcessMode(externalSystemId); return currentInProcess ? myInProcessCommunicationManager : myRemoteCommunicationManager; }
getCommunicationManager
276,894
void () { myFacadeWrappers.clear(); myRemoteFacades.clear(); }
dispose
276,895
boolean (@NotNull ExternalSystemCommunicationManager communicationManager, @NotNull Project project, @NotNull IntegrationKey key, @NotNull Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings> pair) { if (!communicationManager.isAlive(pair.first)) { return false; } try { ExternalSystemExecutionSettings currentSettings = ExternalSystemApiUtil.getExecutionSettings(project, key.getExternalProjectConfigPath(), key.getExternalSystemId()); if (!currentSettings.equals(pair.second)) { pair.first.applySettings(currentSettings); myRemoteFacades.put(key, Pair.create(pair.first, currentSettings)); } return true; } catch (RemoteException e) { return false; } }
prepare
276,896
boolean (@NotNull ExternalSystemTaskId id) { Map<IntegrationKey, Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings>> copy = new HashMap<>(myRemoteFacades); for (Map.Entry<IntegrationKey, Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings>> entry : copy.entrySet()) { try { if (entry.getValue().first.isTaskInProgress(id)) { return true; } } catch (RemoteException e) { myLock.lock(); try { myRemoteFacades.remove(entry.getKey()); myFacadeWrappers.remove(entry.getKey()); } finally { myLock.unlock(); } } } return false; }
isTaskActive
276,897
void () { myShutdownFuture.cancel(false); myShutdownFuture = AppExecutorUtil.getAppScheduledExecutorService().schedule(() -> { if (myCallsInProgressNumber.get() > 0) { updateAutoShutdownTime(); return; } System.exit(0); }, (int)myTtlMs.get(), TimeUnit.MILLISECONDS); }
updateAutoShutdownTime
276,898
void (int b) { char c = (char)b; myBuffer.append(c); if (c == '\n') { doFlush(); } }
write
276,899
void (byte[] b, int off, int len) { int start = off; int maxOffset = off + len; for (int i = off; i < maxOffset; i++) { if (b[i] == '\n') { myBuffer.append(new String(b, start, i - start + 1, StandardCharsets.UTF_8)); doFlush(); start = i + 1; } } if (start < maxOffset) { myBuffer.append(new String(b, start, maxOffset - start, StandardCharsets.UTF_8)); } }
write