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); } }); } }); }
@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(); }
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); } }); } }); } }); }
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); }
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(); } }); }
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(); }
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); } } }); }
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; } } }); }
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); }
@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); } } }); }
@Override public void initComponent() { ProjectManager projectManager = ProjectManager.getInstance(); projectManager.addProjectManagerListener( new ProjectManagerAdapter() { @Override public void projectOpened(Project project) { if (prefetchOnProjectOpen.getValue()) { prefetchProjectFiles(project); } } }); }
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); } }); } }); }
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); } } }); }
@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); }
public FlatWelcomeFrame() { final JRootPane rootPane = getRootPane(); myScreen = new FlatWelcomeScreen(); final IdeGlassPaneImpl glassPane = new IdeGlassPaneImpl(rootPane) { @Override public void addNotify() { super.addNotify(); rootPane.remove(getProxyComponent()); //noinspection SSBasedInspection SwingUtilities.invokeLater(new Runnable() { public void run() { JBProtocolCommand.handleCurrentCommand(); } }); } }; setGlassPane(glassPane); glassPane.setVisible(false); //setUndecorated(true); setContentPane(myScreen.getWelcomePanel()); setTitle("Welcome to " + ApplicationNamesInfo.getInstance().getFullProductName()); AppUIUtil.updateWindowIcon(this); final int width = RecentProjectsManager.getInstance().getRecentProjectsActions(false).length == 0 ? 666 : 777; setSize(JBUI.size(width, 460)); setResizable(false); //int x = bounds.x + (bounds.width - getWidth()) / 2; //int y = bounds.y + (bounds.height - getHeight()) / 2; Point location = DimensionService.getInstance().getLocation(WelcomeFrame.DIMENSION_KEY, null); 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 )); //setLocation(x, y); ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() { @Override public void projectOpened(Project project) { dispose(); } }); myBalloonLayout = new BalloonLayoutImpl(rootPane, JBUI.insets(8)); WelcomeFrame.setupCloseAction(this); MnemonicHelper.init(this); Disposer.register(ApplicationManager.getApplication(), new Disposable() { @Override public void dispose() { FlatWelcomeFrame.this.dispose(); } }); }