本文整理汇总了Java中com.intellij.openapi.components.StorageScheme类的典型用法代码示例。如果您正苦于以下问题:Java StorageScheme类的具体用法?Java StorageScheme怎么用?Java StorageScheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StorageScheme类属于com.intellij.openapi.components包,在下文中一共展示了StorageScheme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateDataModel
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public void updateDataModel() {
myWizardContext.setProjectBuilder(myModuleBuilder);
myWizardContext.setProjectName(myNamePathComponent.getNameValue());
myWizardContext.setProjectFileDirectory(myNamePathComponent.getPath());
myFormatPanel.updateData(myWizardContext);
if (myModuleBuilder != null) {
myModuleNameLocationComponent.updateDataModel(myModuleBuilder);
if (myModuleBuilder instanceof TemplateModuleBuilder) {
myWizardContext.setProjectStorageFormat(StorageScheme.DIRECTORY_BASED);
}
}
if (mySettingsStep != null) {
mySettingsStep.updateDataModel();
}
}
示例2: updateDataModel
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public void updateDataModel() {
myWizardContext.setProjectName(myNamePathComponent.getNameValue());
myWizardContext.setProjectFileDirectory(myNamePathComponent.getPath());
myFormatPanel.updateData(myWizardContext);
ModuleBuilder moduleBuilder = (ModuleBuilder)myWizardContext.getProjectBuilder();
if (moduleBuilder != null) {
myModuleNameLocationComponent.updateDataModel(moduleBuilder);
if (moduleBuilder instanceof TemplateModuleBuilder) {
myWizardContext.setProjectStorageFormat(StorageScheme.DIRECTORY_BASED);
}
}
if (mySettingsStep != null) {
mySettingsStep.updateDataModel();
}
}
示例3: isSameProject
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
private static boolean isSameProject(String path, @NotNull Project project) {
IProjectStore projectStore = (IProjectStore)ServiceKt.getStateStore(project);
String toOpen = FileUtil.toSystemIndependentName(path);
String existing = projectStore.getProjectFilePath();
String existingBaseDir = projectStore.getProjectBasePath();
if (existingBaseDir == null) {
// could be null if not yet initialized
return false;
}
final File openFile = new File(toOpen);
if (openFile.isDirectory()) {
return FileUtil.pathsEqual(toOpen, existingBaseDir);
}
if (StorageScheme.DIRECTORY_BASED == projectStore.getStorageScheme()) {
// todo: check if IPR is located not under the project base dir
return FileUtil.pathsEqual(FileUtil.toSystemIndependentName(openFile.getParentFile().getPath()), existingBaseDir);
}
return FileUtil.pathsEqual(toOpen, existing);
}
示例4: ConversionContextImpl
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
public ConversionContextImpl(String projectPath) throws CannotConvertException {
myProjectFile = new File(projectPath);
File modulesFile;
if (myProjectFile.isDirectory()) {
myStorageScheme = StorageScheme.DIRECTORY_BASED;
myProjectBaseDir = myProjectFile;
mySettingsBaseDir = new File(myProjectBaseDir.getAbsolutePath(), Project.DIRECTORY_STORE_FOLDER);
modulesFile = new File(mySettingsBaseDir, "modules.xml");
myWorkspaceFile = new File(mySettingsBaseDir, "workspace.xml");
}
else {
myStorageScheme = StorageScheme.DEFAULT;
myProjectBaseDir = myProjectFile.getParentFile();
modulesFile = myProjectFile;
myWorkspaceFile = new File(StringUtil.trimEnd(projectPath, ProjectFileType.DOT_DEFAULT_EXTENSION) + WorkspaceFileType.DOT_DEFAULT_EXTENSION);
}
myModuleFiles = modulesFile.exists() ? findModuleFiles(JDomConvertingUtil.loadDocument(modulesFile).getRootElement()) : new File[0];
myPerformedConversionIds = loadPerformedConversionIds();
}
示例5: createProjectSettings
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
@Nullable
public ComponentManagerSettingsImpl createProjectSettings(@NotNull final String fileName) {
try {
File file;
if (myStorageScheme == StorageScheme.DEFAULT) {
file = myProjectFile;
}
else {
file = new File(mySettingsBaseDir, fileName);
}
return new ComponentManagerSettingsImpl(file, this);
}
catch (CannotConvertException e) {
LOG.info(e);
return null;
}
}
示例6: updateDataModel
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public void updateDataModel() {
myWizardContext.setProjectBuilder(myModuleBuilder);
myWizardContext.setProjectName(myNamePathComponent.getNameValue());
myWizardContext.setProjectFileDirectory(myNamePathComponent.getPath());
myFormatPanel.updateData(myWizardContext);
if (myModuleBuilder != null) {
final String moduleName = getModuleName();
myModuleBuilder.setName(moduleName);
myModuleBuilder.setModuleFilePath(
FileUtil.toSystemIndependentName(myModuleFileLocation.getText()) + "/" + moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION);
myModuleBuilder.setContentEntryPath(FileUtil.toSystemIndependentName(getModuleContentRoot()));
if (myModuleBuilder instanceof TemplateModuleBuilder) {
myWizardContext.setProjectStorageFormat(StorageScheme.DIRECTORY_BASED);
}
}
if (mySettingsStep != null) {
mySettingsStep.updateDataModel();
}
}
示例7: ProjectImpl
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
protected ProjectImpl(@NotNull ProjectManagerImpl manager, @NotNull String filePath, boolean isOptimiseTestLoadSpeed, String projectName) {
super(ApplicationManager.getApplication(), "Project "+(projectName == null ? filePath : projectName));
putUserData(CREATION_TIME, System.nanoTime());
getPicoContainer().registerComponentInstance(Project.class, this);
if (!isDefault()) {
getStateStore().setProjectFilePath(filePath);
}
myOptimiseTestLoadSpeed = isOptimiseTestLoadSpeed;
myManager = manager;
myName = isDefault() ? TEMPLATE_PROJECT_NAME : projectName == null ? getStateStore().getProjectName() : projectName;
if (!isDefault() && projectName != null && getStateStore().getStorageScheme().equals(StorageScheme.DIRECTORY_BASED)) {
myOldName = ""; // new project
}
}
示例8: isSameProject
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
private static boolean isSameProject(String path, Project p) {
final IProjectStore projectStore = ((ProjectEx)p).getStateStore();
String toOpen = FileUtil.toSystemIndependentName(path);
String existing = FileUtil.toSystemIndependentName(projectStore.getProjectFilePath());
final VirtualFile existingBaseDir = projectStore.getProjectBaseDir();
if (existingBaseDir == null) return false; // could be null if not yet initialized
final File openFile = new File(toOpen);
if (openFile.isDirectory()) {
return FileUtil.pathsEqual(toOpen, existingBaseDir.getPath());
}
if (StorageScheme.DIRECTORY_BASED == projectStore.getStorageScheme()) {
// todo: check if IPR is located not under the project base dir
return FileUtil.pathsEqual(FileUtil.toSystemIndependentName(openFile.getParentFile().getPath()), existingBaseDir.getPath());
}
return FileUtil.pathsEqual(toOpen, existing);
}
示例9: getProjectConfigurationMessage
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
public String getProjectConfigurationMessage(final Project project) {
final StorageScheme storageScheme = ((ProjectEx) project).getStateStore().getStorageScheme();
boolean isDirectoryBased = StorageScheme.DIRECTORY_BASED.equals(storageScheme);
final String[] parts = new String[] {"Content roots of all modules", "all immediate descendants of project base directory",
Project.DIRECTORY_STORE_FOLDER + " directory contents"};
final StringBuilder sb = new StringBuilder(parts[0]);
if (isDirectoryBased) {
sb.append(", ");
} else {
sb.append(", and ");
}
sb.append(parts[1]);
if (isDirectoryBased) {
sb.append(", and ");
sb.append(parts[2]);
}
return sb.toString();
}
示例10: getPsiFiles
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
public static PsiFile[] getPsiFiles(final Project project, final Collection<VirtualFile> selectedFiles) {
ArrayList<PsiFile> result = new ArrayList<PsiFile>();
PsiManager psiManager = PsiManager.getInstance(project);
VirtualFile projectFileDir = null;
final StorageScheme storageScheme = ((ProjectEx) project).getStateStore().getStorageScheme();
if (StorageScheme.DIRECTORY_BASED.equals(storageScheme)) {
VirtualFile baseDir = project.getBaseDir();
if (baseDir != null) {
projectFileDir = baseDir.findChild(Project.DIRECTORY_STORE_FOLDER);
}
}
for (VirtualFile file : selectedFiles) {
if (file.isValid()) {
if (isUnderProjectFileDir(projectFileDir, file) || !isFileUnderSourceRoot(project, file)) {
continue;
}
PsiFile psiFile = psiManager.findFile(file);
if (psiFile != null) result.add(psiFile);
}
}
return PsiUtilCore.toPsiFileArray(result);
}
示例11: getVcsRootFor
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
@Nullable
public VirtualFile getVcsRootFor(final VirtualFile file) {
if (myBaseDir != null && PeriodicalTasksCloser.getInstance().safeGetService(myProject, FileIndexFacade.class)
.isValidAncestor(myBaseDir, file)) {
return myBaseDir;
}
final VirtualFile contentRoot = ProjectRootManager.getInstance(myProject).getFileIndex().getContentRootForFile(file);
if (contentRoot != null) {
return contentRoot;
}
final StorageScheme storageScheme = ((ProjectEx) myProject).getStateStore().getStorageScheme();
if (StorageScheme.DIRECTORY_BASED.equals(storageScheme) && (myBaseDir != null)) {
final VirtualFile ideaDir = myBaseDir.findChild(Project.DIRECTORY_STORE_FOLDER);
if (ideaDir != null && ideaDir.isValid() && ideaDir.isDirectory()) {
if (VfsUtilCore.isAncestor(ideaDir, file, false)) {
return ideaDir;
}
}
}
return null;
}
示例12: createProjectSettings
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Nullable
private ComponentManagerSettingsImpl createProjectSettings(final String fileName) {
try {
File file;
if (myStorageScheme == StorageScheme.DEFAULT) {
file = myProjectFile;
}
else {
file = new File(mySettingsBaseDir, fileName);
}
return new ComponentManagerSettingsImpl(file, this);
}
catch (CannotConvertException e) {
LOG.info(e);
return null;
}
}
示例13: getRunManagerSettings
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public RunManagerSettingsImpl getRunManagerSettings() throws CannotConvertException {
if (myRunManagerSettings == null) {
if (myStorageScheme == StorageScheme.DEFAULT) {
myRunManagerSettings = new RunManagerSettingsImpl(myWorkspaceFile, myProjectFile, null, this);
}
else {
final File[] files = new File(mySettingsBaseDir, "runConfigurations").listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return !file.isDirectory() && file.getName().endsWith(".xml");
}
});
myRunManagerSettings = new RunManagerSettingsImpl(myWorkspaceFile, null, files, this);
}
}
return myRunManagerSettings;
}
示例14: getProjectLibrariesSettings
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public ProjectLibrariesSettingsImpl getProjectLibrariesSettings() throws CannotConvertException {
if (myProjectLibrariesSettings == null) {
if (myStorageScheme == StorageScheme.DEFAULT) {
myProjectLibrariesSettings = new ProjectLibrariesSettingsImpl(myProjectFile, null, this);
}
else {
final File librariesDir = new File(mySettingsBaseDir, "libraries");
final File[] files = librariesDir.exists() ? librariesDir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return !file.isDirectory() && file.getName().endsWith(".xml");
}
}) : ArrayUtil.EMPTY_FILE_ARRAY;
myProjectLibrariesSettings = new ProjectLibrariesSettingsImpl(null, files, this);
}
}
return myProjectLibrariesSettings;
}
示例15: getNewProjectFilePath
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@NotNull
public String getNewProjectFilePath() {
if (myWizardContext.getProjectStorageFormat() == StorageScheme.DEFAULT) {
return myWizardContext.getProjectFileDirectory() + File.separator + myWizardContext.getProjectName() + ProjectFileType.DOT_DEFAULT_EXTENSION;
}
else {
return myWizardContext.getProjectFileDirectory();
}
}