本文整理汇总了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);
}
});
}
});
}
示例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);
}
});
}
});
}
});
}
示例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);
}
示例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();
}
});
}
示例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();
}
示例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);
}
}
});
}
示例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;
}
}
});
}
示例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);
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}
});
}
});
}
示例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);
}
}
});
}
示例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);
}
}
});
}
示例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);
}