当前位置: 首页>>代码示例>>Java>>正文


Java ProjectManagerAdapter类代码示例

本文整理汇总了Java中com.intellij.openapi.project.ProjectManagerAdapter的典型用法代码示例。如果您正苦于以下问题:Java ProjectManagerAdapter类的具体用法?Java ProjectManagerAdapter怎么用?Java ProjectManagerAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProjectManagerAdapter类属于com.intellij.openapi.project包,在下文中一共展示了ProjectManagerAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EditorFactoryImpl

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public EditorFactoryImpl(ProjectManager projectManager) {
  projectManager.addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectOpened(final Project project) {
      // validate all editors are disposed after fireProjectClosed() was called, because it's the place where editor should be released
      Disposer.register(project, new Disposable() {
        @Override
        public void dispose() {
          final Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
          final boolean isLastProjectClosed = openProjects.length == 0;
          validateEditorsAreReleased(project, isLastProjectClosed);
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:EditorFactoryImpl.java

示例2: initComponent

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
@Override
public void initComponent() {
  ApplicationManager.getApplication().getMessageBus().connect().subscribe(AppLifecycleListener.TOPIC, new AppLifecycleListener.Adapter() {
    @Override
    public void appClosing() {
      persistOpenedProjects();
      persistOnClosing = false;
    }
  });

  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectClosing(Project project) {
      if (persistOnClosing && project != null) {
        doPersistProjectUsages(project);
      }
    }
  });

  persistPeriodically();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ApplicationStatisticsPersistenceComponent.java

示例3: initComponent

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public void initComponent() {
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
        public void run() {
            FileTypeManager.getInstance().registerFileType(F3_FILE_TYPE, F3_FILE_EXTENSION);

            ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
                public void projectOpened(Project project) {
                    CompilerManager compilerManager = CompilerManager.getInstance(project);
                    compilerManager.addCompiler(new F3Compiler());
                    compilerManager.addCompilableFileType(F3_FILE_TYPE);

                    DebuggerManager.getInstance (project).registerPositionManagerFactory (new Function<DebugProcess, PositionManager>() {
                        public PositionManager fun (DebugProcess debugProcess) {
                            return new F3PositionManager (debugProcess);
                        }
                    });
                }
            });
        }
    });
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:22,代码来源:F3Plugin.java

示例4: WelcomeFrame

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public WelcomeFrame() {
  JRootPane rootPane = getRootPane();
  final WelcomeScreen screen = createScreen(rootPane);

  final IdeGlassPaneImpl glassPane = new IdeGlassPaneImpl(rootPane);
  setGlassPane(glassPane);
  glassPane.setVisible(false);
  setContentPane(screen.getWelcomePanel());
  setTitle(ApplicationNamesInfo.getInstance().getFullProductName());
  AppUIUtil.updateWindowIcon(this);

  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectOpened(Project project) {
      dispose();
    }
  });

  myBalloonLayout = new BalloonLayoutImpl(rootPane.getLayeredPane(), new Insets(8, 8, 8, 8));

  myScreen = screen;
  setupCloseAction();
  new MnemonicHelper().register(this);
  myScreen.setupFrame(this);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:WelcomeFrame.java

示例5: WelcomeFrame

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public WelcomeFrame() {
  JRootPane rootPane = getRootPane();
  final WelcomeScreen screen = createScreen(rootPane);

  final IdeGlassPaneImpl glassPane = new IdeGlassPaneImpl(rootPane);
  setGlassPane(glassPane);
  glassPane.setVisible(false);
  setContentPane(screen.getWelcomePanel());
  setTitle(ApplicationNamesInfo.getInstance().getFullProductName());
  AppUIUtil.updateWindowIcon(this);

  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectOpened(Project project) {
      dispose();
    }
  });

  myBalloonLayout = new BalloonLayoutImpl(rootPane, new Insets(8, 8, 8, 8));

  myScreen = screen;
  setupCloseAction(this);
  MnemonicHelper.init(this);
  myScreen.setupFrame(this);
  Disposer.register(ApplicationManager.getApplication(), new Disposable() {
    @Override
    public void dispose() {
      WelcomeFrame.this.dispose();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:WelcomeFrame.java

示例6: DummyCachingFileSystem

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public DummyCachingFileSystem(String protocol) {
  myProtocol = protocol;

  final Application application = ApplicationManager.getApplication();
  application.getMessageBus().connect(application).subscribe(ProjectManager.TOPIC, new ProjectManagerAdapter() {
    @Override
    public void projectOpened(final Project project) {
      onProjectOpened(project);
    }
  });
  initProjectMap();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DummyCachingFileSystem.java

示例7: CompletionServiceImpl

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public CompletionServiceImpl() {
  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectClosing(Project project) {
      CompletionProgressIndicator indicator = getCurrentCompletion();
      if (indicator != null && indicator.getProject() == project) {
        indicator.closeAndFinish(true);
        setCompletionPhase(CompletionPhase.NoCompletion);
      }
      else if (indicator == null) {
        setCompletionPhase(CompletionPhase.NoCompletion);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:CompletionServiceImpl.java

示例8: PsiCopyPasteManager

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public PsiCopyPasteManager(CopyPasteManager copyPasteManager, ProjectManager projectManager) {
  myCopyPasteManager = (CopyPasteManagerEx) copyPasteManager;
  projectManager.addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectClosing(Project project) {
      if (myRecentData != null && myRecentData.getProject() == project) {
        myRecentData = null;
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PsiCopyPasteManager.java

示例9: projectOpened

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public void projectOpened() {
  EditorFactory.getInstance().addEditorFactoryListener(new CoverageEditorFactoryListener(), myProject);
  ProjectManagerAdapter projectManagerListener = new ProjectManagerAdapter() {
    public void projectClosing(Project project) {
      synchronized (myLock) {
        myIsProjectClosing = true;
      }
    }
  };
  ProjectManager.getInstance().addProjectManagerListener(myProject, projectManagerListener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:CoverageDataManagerImpl.java

示例10: initComponent

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
@Override
public void initComponent() {
  ProjectManager projectManager = ProjectManager.getInstance();
  projectManager.addProjectManagerListener(
      new ProjectManagerAdapter() {
        @Override
        public void projectOpened(Project project) {
          if (Blaze.isBlazeProject(project)) {
            PluginDependencyHelper.addDependencyOnSyncPlugin(project);
          }
        }
      });
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:14,代码来源:ProjectDependencyMigration.java

示例11: initComponent

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
@Override
public void initComponent() {
  ProjectManager projectManager = ProjectManager.getInstance();
  projectManager.addProjectManagerListener(
      new ProjectManagerAdapter() {
        @Override
        public void projectOpened(Project project) {
          if (prefetchOnProjectOpen.getValue()) {
            prefetchProjectFiles(project);
          }
        }
      });
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:14,代码来源:PrefetchProjectInitializer.java

示例12: EditorFactoryImpl

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public EditorFactoryImpl(ProjectManager projectManager) {
  projectManager.addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectClosed(final Project project) {
      SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          validateEditorsAreReleased(project);
        }
      });
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:EditorFactoryImpl.java

示例13: CompletionServiceImpl

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public CompletionServiceImpl() {
  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectClosing(Project project) {
      CompletionProgressIndicator indicator = getCurrentCompletion();
      if (indicator != null && indicator.getProject() == project) {
        LookupManager.getInstance(indicator.getProject()).hideActiveLookup();
        setCompletionPhase(CompletionPhase.NoCompletion);
      }
      else if (indicator == null) {
        setCompletionPhase(CompletionPhase.NoCompletion);
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:CompletionServiceImpl.java

示例14: CompletionServiceImpl

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
public CompletionServiceImpl() {
  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectClosing(Project project) {
      CompletionProgressIndicator indicator = getCurrentCompletion();
      if (indicator != null && indicator.getProject() == project) {
        indicator.closeAndFinish(true);
        setCompletionPhase(CompletionPhase.NoCompletion);
      } else if (indicator == null) {
        setCompletionPhase(CompletionPhase.NoCompletion);
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:CompletionServiceImpl.java

示例15: FlatWelcomeFrame

import com.intellij.openapi.project.ProjectManagerAdapter; //导入依赖的package包/类
@RequiredDispatchThread
public FlatWelcomeFrame() {
  final JRootPane rootPane = getRootPane();
  myScreen = new FlatWelcomeScreen(this);

  final IdeGlassPaneImpl glassPane = new IdeGlassPaneImpl(rootPane);

  setGlassPane(glassPane);
  glassPane.setVisible(false);
  //setUndecorated(true);
  setContentPane(myScreen);
  setDefaultTitle();
  AppUIUtil.updateWindowIcon(this);
  UIUtil.resetRootPaneAppearance(rootPane);
  setSize(TargetAWT.to(WelcomeFrameManager.getDefaultWindowSize()));
  setResizable(false);
  Point location = DimensionService.getInstance().getLocationNoRealKey(WelcomeFrame.DIMENSION_KEY);
  Rectangle screenBounds = ScreenUtil.getScreenRectangle(location != null ? location : new Point(0, 0));
  setLocation(new Point(screenBounds.x + (screenBounds.width - getWidth()) / 2, screenBounds.y + (screenBounds.height - getHeight()) / 3));

  ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
    @Override
    public void projectOpened(Project project) {
      Disposer.dispose(FlatWelcomeFrame.this);
    }
  }, this);

  myBalloonLayout = new WelcomeDesktopBalloonLayoutImpl(rootPane, JBUI.insets(8), myScreen.getMainWelcomePanel().myEventListener, myScreen.getMainWelcomePanel().myEventLocation);

  setupCloseAction(this);
  MnemonicHelper.init(this);
  Disposer.register(ApplicationManager.getApplication(), this);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:34,代码来源:FlatWelcomeFrame.java


注:本文中的com.intellij.openapi.project.ProjectManagerAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。