本文整理汇总了Java中com.intellij.openapi.components.StorageScheme类的典型用法代码示例。如果您正苦于以下问题:Java StorageScheme类的具体用法?Java StorageScheme怎么用?Java StorageScheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StorageScheme类属于com.intellij.openapi.components包,在下文中一共展示了StorageScheme类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SelectTemplateStep.java
示例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();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ProjectSettingsStep.java
示例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);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ProjectUtil.java
示例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();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ConversionContextImpl.java
示例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;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ConversionContextImpl.java
示例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();
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:SelectTemplateStep.java
示例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
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ProjectImpl.java
示例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);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ProjectUtil.java
示例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();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:DefaultVcsRootPolicy.java
示例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);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:BeforeCheckinHandlerUtil.java
示例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;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ModuleDefaultVcsRootPolicy.java
示例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;
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:ConversionContextImpl.java
示例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;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ConversionContextImpl.java
示例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;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ConversionContextImpl.java
示例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();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AbstractProjectWizard.java
示例16: getAllProjectFiles
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
public Set<File> getAllProjectFiles() {
final HashSet<File> files = new HashSet<File>(Arrays.asList(myModuleFiles));
if (myStorageScheme == StorageScheme.DEFAULT) {
files.add(myProjectFile);
files.add(myWorkspaceFile);
}
else {
addFilesRecursively(mySettingsBaseDir, files);
}
return files;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ConversionContextImpl.java
示例17: 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(FileFilters.filesWithExtension("xml"));
myRunManagerSettings = new RunManagerSettingsImpl(myWorkspaceFile, null, files, this);
}
}
return myRunManagerSettings;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ConversionContextImpl.java
示例18: getProjectLibrariesSettings
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public ProjectLibrariesSettingsImpl getProjectLibrariesSettings() throws CannotConvertException {
if (myProjectLibrariesSettings == null) {
myProjectLibrariesSettings = myStorageScheme == StorageScheme.DEFAULT
? new ProjectLibrariesSettingsImpl(myProjectFile, null, this)
: new ProjectLibrariesSettingsImpl(null, getSettingsXmlFiles("libraries"), this);
}
return myProjectLibrariesSettings;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ConversionContextImpl.java
示例19: getArtifactsSettings
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
@Override
public ArtifactsSettingsImpl getArtifactsSettings() throws CannotConvertException {
if (myArtifactsSettings == null) {
myArtifactsSettings = myStorageScheme == StorageScheme.DEFAULT
? new ArtifactsSettingsImpl(myProjectFile, null, this)
: new ArtifactsSettingsImpl(null, getSettingsXmlFiles("artifacts"), this);
}
return myArtifactsSettings;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ConversionContextImpl.java
示例20: isConversionNeeded
import com.intellij.openapi.components.StorageScheme; //导入依赖的package包/类
public boolean isConversionNeeded() throws CannotConvertException {
if (myContext.isConversionAlreadyPerformed(myProvider)) return false;
myProcessProjectFile = myContext.getStorageScheme() == StorageScheme.DEFAULT && myProjectFileConverter != null
&& myProjectFileConverter.isConversionNeeded(myContext.getProjectSettings());
myProcessWorkspaceFile = myWorkspaceConverter != null && myContext.getWorkspaceFile().exists()
&& myWorkspaceConverter.isConversionNeeded(myContext.getWorkspaceSettings());
myModulesFilesToProcess.clear();
if (myModuleFileConverter != null) {
for (File moduleFile : myContext.getModuleFiles()) {
if (moduleFile.exists() && myModuleFileConverter.isConversionNeeded(myContext.getModuleSettings(moduleFile))) {
myModulesFilesToProcess.add(moduleFile);
}
}
}
myProcessRunConfigurations = myRunConfigurationsConverter != null
&& myRunConfigurationsConverter.isConversionNeeded(myContext.getRunManagerSettings());
myProcessProjectLibraries = myProjectLibrariesConverter != null
&& myProjectLibrariesConverter.isConversionNeeded(myContext.getProjectLibrariesSettings());
myArtifacts = myArtifactsConverter != null
&& myArtifactsConverter.isConversionNeeded(myContext.getArtifactsSettings());
return myProcessProjectFile ||
myProcessWorkspaceFile ||
myProcessRunConfigurations ||
myProcessProjectLibraries ||
!myModulesFilesToProcess.isEmpty() ||
myConverter.isConversionNeeded();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:ConversionRunner.java
注:本文中的com.intellij.openapi.components.StorageScheme类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论