use of com.intellij.openapi.externalSystem.model.ProjectSystemId in project intellij-community by JetBrains.
the class ExternalSystemProjectsWatcher method onQueued.
@Override
public void onQueued(@NotNull ExternalSystemTaskId id, String workingDir) {
if (id.getType() == ExternalSystemTaskType.RESOLVE_PROJECT) {
final ProjectSystemId systemId = id.getProjectSystemId();
for (String filePath : ContainerUtil.newArrayList(myKnownAffectedFiles.get(workingDir))) {
VirtualFile file = VfsUtil.findFileByIoFile(new File(filePath), false);
if (file != null && !file.isDirectory()) {
file.putUserData(CRC_WITHOUT_SPACES_BEFORE_LAST_IMPORT, file.getUserData(CRC_WITHOUT_SPACES_CURRENT));
}
}
myUpdatesQueue.queue(new Update(Pair.create(systemId, workingDir)) {
public void run() {
doUpdateNotifications(true, systemId, workingDir);
}
});
}
}
use of com.intellij.openapi.externalSystem.model.ProjectSystemId in project intellij-community by JetBrains.
the class ExternalSystemSelectProjectDataToImportAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = getProject(e);
final ProjectSystemId projectSystemId = getSystemId(e);
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
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();
}
}
use of com.intellij.openapi.externalSystem.model.ProjectSystemId in project intellij-community by JetBrains.
the class IgnoreExternalProjectAction method setSelected.
@Override
public void setSelected(AnActionEvent e, boolean state) {
final ProjectSystemId projectSystemId = getSystemId(e);
final ExternalSystemNode<ExternalConfigPathAware> projectNode = getProjectNode(e);
if (projectSystemId == null || projectNode == null || projectNode.getData() == null)
return;
projectNode.setIgnored(state);
final Project project = getProject(e);
final String externalProjectPath = projectNode.getData().getLinkedExternalProjectPath();
final ExternalProjectInfo externalProjectInfo = ExternalSystemUtil.getExternalProjectInfo(project, projectSystemId, externalProjectPath);
if (externalProjectInfo == null || externalProjectInfo.getExternalProjectStructure() == null) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("external project data not found, path: %s, data: %s", externalProjectPath, externalProjectInfo));
}
return;
}
final DataNode<ProjectData> projectDataNode = externalProjectInfo.getExternalProjectStructure();
ServiceManager.getService(ProjectDataManager.class).importData(projectDataNode, project, true);
}
use of com.intellij.openapi.externalSystem.model.ProjectSystemId in project intellij-community by JetBrains.
the class IgnoreExternalProjectAction method isSelected.
@Override
public boolean isSelected(AnActionEvent e) {
boolean selected = super.isSelected(e);
ProjectSystemId systemId = getSystemId(e);
final String systemIdName = systemId != null ? systemId.getReadableName() : "external";
if (selected) {
setText(e, ExternalSystemBundle.message("action.unignore.external.project.text", systemIdName));
setDescription(e, ExternalSystemBundle.message("action.unignore.external.project.description", systemIdName));
} else {
setText(e, ExternalSystemBundle.message("action.ignore.external.project.text", systemIdName));
setDescription(e, ExternalSystemBundle.message("action.ignore.external.project.description", systemIdName));
}
return selected;
}
use of com.intellij.openapi.externalSystem.model.ProjectSystemId in project intellij-community by JetBrains.
the class RefreshExternalProjectAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
if (this.getClass() != RefreshExternalProjectAction.class)
return;
ProjectSystemId systemId = getSystemId(e);
final String systemIdName = systemId != null ? systemId.getReadableName() : "external";
Presentation presentation = e.getPresentation();
presentation.setText(ExternalSystemBundle.message("action.refresh.project.text", systemIdName));
presentation.setDescription(ExternalSystemBundle.message("action.refresh.project.description", systemIdName));
}
Aggregations