本文整理汇总了Java中com.intellij.openapi.roots.ModuleRootEvent类的典型用法代码示例。如果您正苦于以下问题:Java ModuleRootEvent类的具体用法?Java ModuleRootEvent怎么用?Java ModuleRootEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleRootEvent类属于com.intellij.openapi.roots包,在下文中一共展示了ModuleRootEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rootsChanged
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void rootsChanged( ModuleRootEvent event )
{
Project project = (Project)event.getSource();
if( !shouldProcessRootChanges( project ) )
{
return;
}
boolean processDependencies = true;
if( processDependencies )
{
processModuleDependenciesChange( project );
}
final Module[] modules = ModuleManager.getInstance( project ).getModules();
for( Module ijModule : modules )
{
ManModule manModule = ManProject.getModule( ijModule );
processClasspathChange( manModule, ijModule );
changeSourceRoots( manModule );
}
}
示例2: AnalyzeDependenciesComponent
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
/**
* The constructor
*
* @param module the module to analyze
*/
public AnalyzeDependenciesComponent(Module module) {
myModule = module;
mySettings = AnalyzeDependenciesSettings.getInstance(myModule.getProject());
initTree();
init();
getSplitter().setProportion(0.3f);
myMessageBusConnection = myModule.getProject().getMessageBus().connect();
myMessageBusConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myClasspaths.clear();
updateTree();
}
});
}
示例3: projectOpened
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void projectOpened() {
final ModuleRootListener rootListener = new ModuleRootAdapter() {
public void rootsChanged(ModuleRootEvent event) {
if (!myProject.isDisposed()) {
checkToolWindowStatuses(myProject);
}
}
};
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() {
public void run() {
if (!myProject.isDisposed()) {
checkToolWindowStatuses(myProject);
final MessageBusConnection connection = myProject.getMessageBus().connect(myProject);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, rootListener);
}
}
});
}
示例4: projectOpened
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void projectOpened() {
MessageBusConnection connection = myProject.getMessageBus().connect(myProject);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (myProject.isDisposed()) return;
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
}
}, ModalityState.NON_MODAL);
}
});
final WolfTheProblemSolver.ProblemListener myProblemListener = new MyProblemListener();
WolfTheProblemSolver.getInstance(myProject).addProblemListener(myProblemListener,myProject);
}
示例5: rootsChanged
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void rootsChanged(ModuleRootEvent event) {
if (myToolWindowForm == null || !myToolWindowReady || myToolWindowDisposed) {
return;
}
final PsiFile file = myToolWindowForm.getFile();
if (file != null) {
final Module module = ModuleUtilCore.findModuleForPsiElement(file);
if (module != null) {
final Sdk prevSdk = myModule2Sdk.get(module);
final Sdk newSdk = ModuleRootManager.getInstance(module).getSdk();
if (newSdk != null &&
(newSdk.getSdkType() instanceof AndroidSdkType || (prevSdk != null && prevSdk.getSdkType() instanceof AndroidSdkType)) &&
!newSdk.equals(prevSdk)) {
render();
}
}
}
updateMap();
}
示例6: addProjectPropertiesUpdatingListener
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
private void addProjectPropertiesUpdatingListener() {
myProject.getMessageBus().connect(myDisposable).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(final ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() {
@Override
public void run() {
updatePropertyFilesIfNecessary();
}
});
}
}, myProject.getDisposed());
}
});
}
示例7: initFacet
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void initFacet() {
MessageBusConnection connection = getModule().getMessageBus().connect(this);
connection.subscribe(PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (!isDisposed()) {
PsiDocumentManager.getInstance(getModule().getProject()).commitAllDocuments();
updateConfiguration();
}
}
});
}
});
updateConfiguration();
}
示例8: initFacet
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void initFacet() {
MessageBusConnection connection = getModule().getMessageBus().connect(this);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (!isDisposed()) {
PsiDocumentManager.getInstance(getModule().getProject()).commitAllDocuments();
updateConfiguration();
}
}
});
}
});
updateConfiguration();
}
示例9: rootsChanged
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void rootsChanged(ModuleRootEvent event) {
final ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TOOL_WINDOW_ID);
if (window == null) {
return;
}
if (window.isDisposed() || !window.isVisible()) {
return;
}
AndroidPlatform newPlatform = getPlatform();
if (!Comparing.equal(myPrevPlatform, newPlatform)) {
myPrevPlatform = newPlatform;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (!window.isDisposed() && window.isVisible()) {
myView.activate();
}
}
});
}
}
示例10: LoaderFactory
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
public LoaderFactory(final Project project) {
myProject = project;
myModule2ClassLoader = ContainerUtil.createConcurrentWeakMap();
myConnection = myProject.getMessageBus().connect();
myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
public void rootsChanged(final ModuleRootEvent event) {
clearClassLoaderCache();
}
});
Disposer.register(project, new Disposable() {
public void dispose() {
myConnection.disconnect();
myModule2ClassLoader.clear();
}
});
}
示例11: ConfigureGroovyLibraryNotificationProvider
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
public ConfigureGroovyLibraryNotificationProvider(Project project, final EditorNotifications notifications) {
myProject = project;
project.getMessageBus().connect(project).subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
notifications.updateAllNotifications();
}
});
supportedFileTypes = new HashSet<FileType>();
supportedFileTypes.add(GroovyFileType.GROOVY_FILE_TYPE);
for (GroovyFrameworkConfigNotification configNotification : GroovyFrameworkConfigNotification.EP_NAME.getExtensions()) {
Collections.addAll(supportedFileTypes, configNotification.getFrameworkFileTypes());
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ConfigureGroovyLibraryNotificationProvider.java
示例12: doViewSwitch
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
private void doViewSwitch(@NotNull ExternalSystemTaskId id, @NotNull String projectPath) {
Project ideProject = id.findProject();
if (ideProject == null) {
return;
}
// Disable zooming on subsequent project resolves/refreshes,
// i.e. a project that already has existing modules, because it may zoom at a module
// that is going to be replaced by the current resolve.
if (ModuleManager.getInstance(ideProject).getModules().length > 0) {
return;
}
MessageBusConnection messageBusConnection = ideProject.getMessageBus().connect();
messageBusConnection.subscribe(
ProjectTopics.PROJECT_ROOTS,
new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
// Initiate view switch only when project modules have been created.
new ViewSwitchProcessor(ideProject, projectPath).asyncViewSwitch();
}
}
);
}
示例13: projectOpened
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void projectOpened() {
super.projectOpened();
if (myProject.isDefault() || !PantsUtil.isPantsProject(myProject)) {
return;
}
final MessageBusConnection connection = myProject.getMessageBus().connect(this);
connection.subscribe(
ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
@Override
public void rootsChanged(ModuleRootEvent event) {
myProjectRoots = null;
}
}
);
}
示例14: Unity3dProjectChangeListener
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
public Unity3dProjectChangeListener(@NotNull Project project, @NotNull StartupManager startupManager)
{
myProject = project;
for(Unity3dProjectSourceFileTypeFactory factory : Unity3dProjectSourceFileTypeFactory.EP_NAME.getExtensions())
{
factory.registerFileTypes(mySourceFileTypes::add);
}
myProject.getMessageBus().connect().subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener()
{
@Override
@RequiredReadAction
public void rootsChanged(ModuleRootEvent event)
{
checkAndRunIfNeed();
}
});
VirtualFileManager.getInstance().addVirtualFileListener(this, this);
myAssetsDirPointer = VirtualFilePointerManager.getInstance().create(StandardFileSystems.FILE_PROTOCOL_PREFIX + myProject.getPresentableUrl() + "/" + Unity3dProjectImportUtil
.ASSETS_DIRECTORY, this, null);
startupManager.registerPostStartupActivity(this::checkAndRunIfNeed);
}
示例15: projectOpened
import com.intellij.openapi.roots.ModuleRootEvent; //导入依赖的package包/类
@Override
public void projectOpened() {
MessageBusConnection connection = myProject.getMessageBus().connect(myProject);
connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
@Override
public void rootsChanged(ModuleRootEvent event) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
if (myProject.isDisposed() || !DirectoryIndex.getInstance(myProject).isInitialized()) return;
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
}
}, ModalityState.NON_MODAL);
}
});
final WolfTheProblemSolver.ProblemListener myProblemListener = new MyProblemListener();
WolfTheProblemSolver.getInstance(myProject).addProblemListener(myProblemListener,myProject);
}