本文整理了Java中com.intellij.openapi.module.Module.isDisposed()
方法的一些代码示例,展示了Module.isDisposed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module.isDisposed()
方法的具体详情如下:
包路径:com.intellij.openapi.module.Module
类名称:Module
方法名:isDisposed
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
/**
* Use this method in order to check whether the method is appropriate for providing Go-specific code insight
*/
@Contract("null -> false")
public boolean isGoModule(@Nullable Module module) {
return module != null && !module.isDisposed();
}
代码示例来源:origin: ballerina-platform/ballerina-lang
/**
* Use this method in order to check whether the method is appropriate for providing Ballerina-specific code
* insight.
*/
@Contract("null -> false")
public boolean isBallerinaModule(@Nullable Module module) {
return module != null && !module.isDisposed();
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
if (!myModule.isDisposed()) {
GoModuleSettings.getInstance(myModule).setVendoringEnabled(ThreeState.NO);
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
protected boolean isSuitableForModule(@NotNull Module module) {
if (module.isDisposed()) {
return false;
}
Project project = module.getProject();
return !project.isDisposed() && GoSdkService.getInstance(project).isGoModule(module);
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
public void initPanel(@NotNull Module module) {
if (!module.isDisposed()) {
MessageBusConnection connection = module.getMessageBus().connect(this);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
initComboValues(module);
}
});
initComboValues(module);
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void chooseAndSetSdk(@Nullable Module module) {
Sdk projectSdk = ProjectSettingsService.getInstance(myProject).chooseAndSetSdk();
if (projectSdk == null && module != null) {
ApplicationManager.getApplication().runWriteAction(() -> {
if (!module.isDisposed()) {
ModuleRootModificationUtil.setSdkInherited(module);
}
});
}
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@Override
protected boolean isSuitableForModule(@NotNull Module module) {
if (module.isDisposed()) {
return false;
}
Project project = module.getProject();
return !project.isDisposed() && BallerinaSdkService.getInstance(project).isBallerinaModule(module);
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
public void initPanel(@NotNull Module module) {
if (!module.isDisposed()) {
MessageBusConnection connection = module.getMessageBus().connect(this);
//noinspection unchecked
myVendoringEnabledCombo.setModel(myVendoringEnabledComboModel);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
initComboValues(module);
}
});
initComboValues(module);
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
private void initComboValues(@NotNull Module module) {
if (!module.isDisposed()) {
String sdkVersion = GoSdkService.getInstance(module.getProject()).getSdkVersion(module);
myDefaultGoVersion = "Project SDK (" + StringUtil.notNullize(sdkVersion, "any") + ")";
//noinspection unchecked
myGoVersionCombo.setModel(createModel(GoConstants.KNOWN_VERSIONS, myDefaultGoVersion));
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
public static void showModulesConfigurable(@NotNull Module module) {
ApplicationManager.getApplication().assertIsDispatchThread();
if (!module.isDisposed()) {
ShowSettingsUtil.getInstance().editConfigurable(module.getProject(), new GoModuleSettingsConfigurable(module, true));
}
}
}
代码示例来源:origin: ballerina-platform/ballerina-lang
public static void showModulesConfigurable(@NotNull Module module) {
ApplicationManager.getApplication().assertIsDispatchThread();
if (!module.isDisposed()) {
ShowSettingsUtil.getInstance().editConfigurable(module.getProject(),
new BallerinaModuleSettingsConfigurable(module, true));
}
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
public void setBuildTargetSettings(@NotNull GoBuildTargetSettings buildTargetSettings) {
if (!buildTargetSettings.equals(myState.buildTargetSettings)) {
XmlSerializerUtil.copyBean(buildTargetSettings, myState.buildTargetSettings);
if (!myModule.isDisposed()) {
myModule.getProject().getMessageBus().syncPublisher(TOPIC).changed(myModule);
}
cleanResolveCaches();
myState.buildTargetSettings.incModificationCount();
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
Collection<VirtualFile> includeRoots = gatherIncludeRoots(goPathSourcesRoots, excludeRoots);
ApplicationManager.getApplication().invokeLater(() -> {
if (!myModule.isDisposed() && GoSdkService.getInstance(project).isGoModule(myModule)) {
attachLibraries(includeRoots, excludeRoots);
myLastHandledExclusions.clear();
ApplicationManager.getApplication().invokeLater(() -> {
if (!myModule.isDisposed() && GoSdkService.getInstance(project).isGoModule(myModule)) {
removeLibraryIfNeeded();
代码示例来源:origin: ballerina-platform/ballerina-lang
@Override
public void chooseAndSetSdk(@Nullable Module module) {
Sdk projectSdk = ProjectSettingsService.getInstance(myProject).chooseAndSetSdk();
if (projectSdk == null && module != null) {
ApplicationManager.getApplication().runWriteAction(() -> {
if (!module.isDisposed()) {
ModuleRootModificationUtil.setSdkInherited(module);
}
});
}
// Need to prompt a restart action to clear and re initiate language server instance from the new SDK.
// Todo - Figure out a way to apply language server changes without restarting.
if (isBallerinaSdk(projectSdk)) {
ApplicationManager.getApplication().invokeLater(this::showRestartDialog);
}
}
代码示例来源:origin: ballerina-platform/ballerina-lang
if (!myModule.isDisposed() && BallerinaSdkService.getInstance(project)
.isBallerinaModule(myModule)) {
attachLibraries(includeRoots, excludeRoots);
myLastHandledExclusions.clear();
ApplicationManager.getApplication().invokeLater(() -> {
if (!myModule.isDisposed() && BallerinaSdkService.getInstance(project).
isBallerinaModule(myModule)) {
removeLibraryIfNeeded();
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
private void showVendoringNotification() {
if (!myModuleInitialized || myModule.isDisposed()) {
return;
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
private void initComboValues(@NotNull Module module) {
if (!module.isDisposed()) {
String sdkVersion = GoSdkService.getInstance(module.getProject()).getSdkVersion(module);
if (!GoVendoringUtil.vendoringCanBeDisabled(sdkVersion)) {
myErrorMessageLabel.setIcon(AllIcons.General.BalloonWarning);
myErrorMessageLabel.setText("Go " + sdkVersion + " doesn't support disabling vendor experiment");
myErrorMessageLabel.setVisible(true);
myVendoringEnabledCombo.setEnabled(false);
}
else if (!GoVendoringUtil.supportsVendoring(sdkVersion) && sdkVersion != null) {
myErrorMessageLabel.setIcon(AllIcons.General.BalloonWarning);
myErrorMessageLabel.setText("Go " + sdkVersion + " doesn't support vendor experiment");
myErrorMessageLabel.setVisible(true);
myVendoringEnabledCombo.setEnabled(true);
}
else {
myErrorMessageLabel.setVisible(false);
myVendoringEnabledCombo.setEnabled(true);
}
myDefaultComboText = "Default for SDK (" + (GoVendoringUtil.supportsVendoringByDefault(sdkVersion) ? ENABLED : DISABLED) + ")";
//noinspection unchecked
myVendoringEnabledComboModel.update(ContainerUtil.newArrayList(myDefaultComboText, ENABLED, DISABLED));
}
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void moduleAdded() {
if (!myModuleInitialized) {
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
scheduleUpdate();
}
});
myConnection.subscribe(GoLibrariesService.LIBRARIES_TOPIC, newRootUrls -> scheduleUpdate());
Project project = myModule.getProject();
StartupManager.getInstance(project).runWhenProjectIsInitialized(() -> {
if (!project.isDisposed() && !myModule.isDisposed()) {
for (PsiFileSystemItem vendor : FilenameIndex.getFilesByName(project, GoConstants.VENDOR, GoUtil.moduleScope(myModule), true)) {
if (vendor.isDirectory()) {
showVendoringNotification();
break;
}
}
}
});
VirtualFileManager.getInstance().addVirtualFileListener(myFilesListener);
}
scheduleUpdate(0);
myModuleInitialized = true;
}
代码示例来源:origin: liias/monkey
@Override
public Collection<Module> getValidModules() {
return Arrays.stream(ModuleManager.getInstance(getProject()).getModules())
.filter(module -> module != null && !module.isDisposed())
.collect(Collectors.toList());
}
代码示例来源:origin: SonarSource/sonarlint-intellij
public Result canAnalyze(VirtualFile file, @Nullable Module module) {
FileType fileType = file.getFileType();
if (module == null) {
return Result.excluded("file is not part of any module in IntelliJ's project structure");
}
if (module.isDisposed() || module.getProject().isDisposed()) {
return Result.excluded("module is disposed");
}
if (!file.isInLocalFileSystem() || fileType.isBinary() || !file.isValid()
|| ".idea".equals(file.getParent().getName())) {
return Result.excluded("file's type or location are not supported");
}
// In PHPStorm the same PHP file is analyzed twice (once as PHP file and once as HTML file)
String ijFlavor = applicationInfo.getVersionName().toLowerCase(Locale.US);
if (ijFlavor.contains("phpstorm") && "html".equalsIgnoreCase(fileType.getName())) {
return Result.excluded(null);
}
return Result.notExcluded();
}
内容来源于网络,如有侵权,请联系作者删除!