本文整理了Java中com.intellij.openapi.project.Project.isDefault()
方法的一些代码示例,展示了Project.isDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.isDefault()
方法的具体详情如下:
包路径:com.intellij.openapi.project.Project
类名称:Project
方法名:isDefault
暂无
代码示例来源:origin: google/google-java-format
private EnabledState getDisabledState() {
// The default settings (inherited by new projects) are either 'enabled' or
// 'show notification'. There's no way to default new projects to disabled. If someone wants
// that, we can add another checkbox, I suppose.
return project.isDefault() ? EnabledState.UNKNOWN : EnabledState.DISABLED;
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Nullable
@Override
public Configurable createSdkConfigurable() {
return !myProject.isDefault() ? new GoSdkConfigurable(myProject, false) : null;
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@Nullable
@Override
public Configurable createSdkConfigurable() {
return !myProject.isDefault() ? new BallerinaSdkConfigurable(myProject, false) : null;
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
public GoAutoImportConfigurable(@NotNull Project project, boolean dialogMode) {
myCodeInsightSettings = GoCodeInsightSettings.getInstance();
myExcludedSettings = GoExcludedPathsSettings.getInstance(project);
myIsDefaultProject = project.isDefault();
myIsDialog = dialogMode;
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@NotNull
public static Collection<Module> getGoModules(@NotNull Project project) {
if (project.isDefault()) return Collections.emptyList();
GoSdkService sdkService = GoSdkService.getInstance(project);
return ContainerUtil.filter(ModuleManager.getInstance(project).getModules(), sdkService::isGoModule);
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@NotNull
public static Collection<Module> getBallerinaModules(@NotNull Project project) {
if (project.isDefault()) {
return Collections.emptyList();
}
BallerinaSdkService sdkService = BallerinaSdkService.getInstance(project);
return ContainerUtil.filter(ModuleManager.getInstance(project).getModules(), sdkService::isBallerinaModule);
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@NotNull
@Override
protected List<UnnamedConfigurable> createConfigurables() {
List<UnnamedConfigurable> result = ContainerUtil.newArrayList();
String[] urlsFromEnv = ContainerUtil.map2Array(GoSdkUtil.getGoPathsRootsFromEnvironment(), String.class, VirtualFile::getUrl);
result.add(new GoLibrariesConfigurable("Global libraries", GoApplicationLibrariesService.getInstance(), urlsFromEnv));
if (!myProject.isDefault()) {
result.add(new GoLibrariesConfigurable("Project libraries", GoProjectLibrariesService.getInstance(myProject)));
result.add(new GoModuleAwareConfigurable(myProject, "Module libraries", null) {
@NotNull
@Override
protected UnnamedConfigurable createModuleConfigurable(@NotNull Module module) {
return new GoLibrariesConfigurable("Module libraries", GoModuleLibrariesService.getInstance(module));
}
});
}
return result;
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@NotNull
@Override
protected List<UnnamedConfigurable> createConfigurables() {
List<UnnamedConfigurable> result = ContainerUtil.newArrayList();
String[] urlsFromEnv =
ContainerUtil.map2Array(BallerinaSdkUtil.getBallerinaPathsRootsFromEnvironment(), String.class,
VirtualFile::getUrl);
result.add(new BallerinaLibrariesConfigurable("Global libraries",
BallerinaApplicationLibrariesService.getInstance(), urlsFromEnv));
if (!myProject.isDefault()) {
result.add(new BallerinaLibrariesConfigurable("Project libraries",
BallerinaProjectLibrariesService.getInstance(myProject)));
}
return result;
}
代码示例来源:origin: jshiell/checkstyle-idea
public Map<String, String> getProperties() throws IOException {
if (!propertiesCheckedThisSession
&& (!project.isDefault() || canBeResolvedInDefaultProject())) {
resolveFile();
}
return Collections.unmodifiableMap(properties);
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void apply() throws ConfigurationException {
ApplicationManager.getApplication().runWriteAction(() -> {
if (myProject.isDefault() || myProject.isDisposed()) {
return;
代码示例来源:origin: jshiell/checkstyle-idea
private boolean propertiesHaveChanged(final ConfigurationLocation configurationLocation) {
if (project.isDefault() && !configurationLocation.canBeResolvedInDefaultProject()) {
return false;
}
try {
return !getProperties().equals(configurationLocation.getProperties());
} catch (IOException e) {
return true;
}
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@Override
public void apply() throws ConfigurationException {
ApplicationManager.getApplication().runWriteAction(() -> {
if (myProject.isDefault() || myProject.isDisposed()) {
return;
代码示例来源:origin: jshiell/checkstyle-idea
public DefaultProjectTestConfigurationLocation() {
super(ConfigurationType.LOCAL_FILE, mock(Project.class));
when(getProject().isDefault()).thenReturn(true);
}
代码示例来源:origin: jshiell/checkstyle-idea
/**
* Process a path, add tokens as necessary and encode it a *nix-style path.
*
* @param path the path to process, in local file path syntax.
* @return the tokenised path in URI syntax.
*/
String tokenisePath(final String path) {
if (path == null) {
return null;
}
if (getProject().isDefault()) {
if (new File(path).exists() || path.startsWith(LEGACY_PROJECT_DIR) || path.startsWith(IDEA_PROJECT_DIR)) {
return toUnixPath(path);
} else {
return IDEA_PROJECT_DIR + toUnixPath(separatorChar() + path);
}
}
final File projectPath = getProjectPath();
if (projectPath != null && path.startsWith(absolutePathOf(projectPath) + separatorChar())) {
return IDEA_PROJECT_DIR
+ toUnixPath(path.substring(absolutePathOf(projectPath).length()));
}
return toUnixPath(path);
}
代码示例来源:origin: jshiell/checkstyle-idea
private String makeProjectRelative(@NotNull final String path) {
if (getProject().isDefault()) {
return path;
}
final File projectPath = getProjectPath();
if (projectPath == null) {
LOG.debug("Couldn't find project path, returning full path: " + path);
return path;
}
try {
final String basePath = absolutePathOf(projectPath) + separatorChar();
return basePath + FilePaths.relativePath(path, basePath, "" + separatorChar());
} catch (FilePaths.PathResolutionException e) {
LOG.debug("No common path was found between " + path + " and " + projectPath.getAbsolutePath());
return path;
} catch (Exception e) {
throw new RuntimeException("Failed to make relative: " + path, e);
}
}
代码示例来源:origin: jshiell/checkstyle-idea
if (!project.isDefault() || location.canBeResolvedInDefaultProject()) {
try {
location.resolve(checkstyleProjectService.underlyingClassLoader());
代码示例来源:origin: Camelcade/Perl5-IDEA
@Override
public boolean canCreateConfigurable() {
return !myProject.isDefault();
}
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
public void update(AnActionEvent e) {
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null || project.isDisposed() || project.isDefault()) {
e.getPresentation().setVisible(false);
return;
}
Deployable server = WebDeploymentDataKeys.DEPLOYABLE.getData(e.getDataContext());
if(server == null || !PublishConfig.getInstance(project).isDefault(server) || !server.needsTransfer() || server.validateFast() != null) {
e.getPresentation().setVisible(false);
return;
}
e.getPresentation().setVisible(RemoteWebServerUtil.hasConfiguredRemoteFile(project));
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public void update(AnActionEvent event) {
final Project project = event.getData(CommonDataKeys.PROJECT);
if (project == null || project.isDefault()) {
event.getPresentation().setVisible(false);
event.getPresentation().setEnabled(false);
return;
}
event.getPresentation().setVisible(true);
event.getPresentation().setEnabled(true);
}
代码示例来源:origin: Microsoft/azure-devops-intellij
public void run() {
if (project.isOpen() && (!project.isDisposed()) && (!project.isDefault())) {
final VcsDirtyScopeManager mgr = VcsDirtyScopeManager.getInstance(project);
mgr.fileDirty(virtualBaseDirectory);
}
}
});
内容来源于网络,如有侵权,请联系作者删除!