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


Java DockManager类代码示例

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


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

示例1: getCurrentFileEditor

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
/**
 * Finds the current file editor.
 */
@Nullable
public static FileEditor getCurrentFileEditor(@NotNull Project project, @Nullable StatusBar statusBar) {
  if (statusBar == null) {
    return null;
  }

  DockContainer c = DockManager.getInstance(project).getContainerFor(statusBar.getComponent());
  EditorsSplitters splitters = null;
  if (c instanceof DockableEditorTabbedContainer) {
    splitters = ((DockableEditorTabbedContainer)c).getSplitters();
  }

  if (splitters != null && splitters.getCurrentWindow() != null) {
    EditorWithProviderComposite editor = splitters.getCurrentWindow().getSelectedEditor();
    if (editor != null) {
      return editor.getSelectedEditorWithProvider().getFirst();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:StatusBarUtil.java

示例2: EditorsSplitters

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
EditorsSplitters(final FileEditorManagerImpl manager, DockManager dockManager, boolean createOwnDockableContainer) {
  super(new BorderLayout());
  myManager = manager;
  myFocusWatcher = new MyFocusWatcher();
  setFocusTraversalPolicy(new MyFocusTraversalPolicy());
  clear();

  if (createOwnDockableContainer) {
    DockableEditorTabbedContainer dockable = new DockableEditorTabbedContainer(myManager.getProject(), this, false);
    Disposer.register(manager.getProject(), dockable);
    dockManager.register(dockable);
  }
  KeymapManagerListener keymapListener = new KeymapManagerListener() {
    @Override
    public void activeKeymapChanged(Keymap keymap) {
      invalidate();
      repaint();
    }
  };
  KeymapManager.getInstance().addKeymapManagerListener(keymapListener, this);
  UISettings.getInstance().addUISettingsListener(this, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:EditorsSplitters.java

示例3: PsiAwareFileEditorManagerImpl

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public PsiAwareFileEditorManagerImpl(final Project project,
                                     final PsiManager psiManager,
                                     final WolfTheProblemSolver problemSolver,
                                     DockManager dockManager,
                                     MessageBus messageBus,
                                     EditorHistoryManager editorHistoryManager) {
  super(project, dockManager, editorHistoryManager);
  myPsiManager = psiManager;
  myProblemSolver = problemSolver;
  myPsiTreeChangeListener = new MyPsiTreeChangeListener();
  myProblemListener = new MyProblemListener();
  registerExtraEditorDataProvider(new TextEditorPsiDataProvider(), null);

  // reinit syntax highlighter for Groovy. In power save mode keywords are highlighted by GroovySyntaxHighlighter insteadof
  // GrKeywordAndDeclarationHighlighter. So we need to drop caches for token types attributes in LayeredLexerEditorHighlighter
  messageBus.connect().subscribe(PowerSaveMode.TOPIC, new PowerSaveMode.Listener() {
    @Override
    public void powerSaveStateChanged() {
      for (Editor editor : EditorFactory.getInstance().getAllEditors()) {
        ((EditorEx)editor).reinitSettings();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PsiAwareFileEditorManagerImpl.java

示例4: FileEditorManagerImpl

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public FileEditorManagerImpl(final Project project, DockManager dockManager) {
/*    ApplicationManager.getApplication().assertIsDispatchThread(); */
    myProject = project;
    myDockManager = dockManager;
    myListenerList =
      new MessageListenerList<FileEditorManagerListener>(myProject.getMessageBus(), FileEditorManagerListener.FILE_EDITOR_MANAGER);

    if (Extensions.getExtensions(FileEditorAssociateFinder.EP_NAME).length > 0) {
      myListenerList.add(new FileEditorManagerAdapter() {
        @Override
        public void selectionChanged(@NotNull FileEditorManagerEvent event) {
          EditorsSplitters splitters = getSplitters();
          openAssociatedFile(event.getNewFile(), splitters.getCurrentWindow(), splitters);
        }
      });
    }

    myQueue.setTrackUiActivity(true);
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FileEditorManagerImpl.java

示例5: EditorsSplitters

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public EditorsSplitters(final FileEditorManagerImpl manager, DockManager dockManager, boolean createOwnDockableContainer) {
  super(new BorderLayout());
  setOpaque(false);
  myManager = manager;
  myFocusWatcher = new MyFocusWatcher();
  setFocusTraversalPolicy(new MyFocusTraversalPolicy());
  setTransferHandler(new MyTransferHandler());
  clear();

  if (createOwnDockableContainer) {
    DockableEditorTabbedContainer dockable = new DockableEditorTabbedContainer(myManager.getProject(), this, false);
    Disposer.register(manager.getProject(), dockable);
    dockManager.register(dockable);
  }

  UISettings.getInstance().addUISettingsListener(new UISettingsListener() {
    @Override
    public void uiSettingsChanged(UISettings source) {
      updateBackground();
    }
  }, manager.getProject());
  updateBackground();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:EditorsSplitters.java

示例6: getCurrentFileEditor

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
/**
 * Finds the current file editor.
 */
@Nullable
public static FileEditor getCurrentFileEditor(@Nonnull Project project, @Nullable StatusBar statusBar) {
  if (statusBar == null) {
    return null;
  }

  DockContainer c = DockManager.getInstance(project).getContainerFor(statusBar.getComponent());
  DesktopEditorsSplitters splitters = null;
  if (c instanceof DockableEditorTabbedContainer) {
    splitters = ((DockableEditorTabbedContainer)c).getSplitters();
  }

  if (splitters != null && splitters.getCurrentWindow() != null) {
    EditorWithProviderComposite editor = splitters.getCurrentWindow().getSelectedEditor();
    if (editor != null) {
      return editor.getSelectedEditorWithProvider().getFirst();
    }
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:StatusBarUtil.java

示例7: DesktopEditorsSplitters

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
DesktopEditorsSplitters(final FileEditorManagerImpl manager, DockManager dockManager, boolean createOwnDockableContainer) {
  super(new BorderLayout());
  myManager = manager;
  myFocusWatcher = new MyFocusWatcher();
  setFocusTraversalPolicy(new MyFocusTraversalPolicy());
  setTransferHandler(new MyTransferHandler());
  clear();

  if (createOwnDockableContainer) {
    DockableEditorTabbedContainer dockable = new DockableEditorTabbedContainer(myManager.getProject(), this, false);
    Disposer.register(manager.getProject(), dockable);
    dockManager.register(dockable);
  }
  KeymapManagerListener keymapListener = keymap -> {
    invalidate();
    repaint();
  };
  KeymapManager.getInstance().addKeymapManagerListener(keymapListener, this);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:DesktopEditorsSplitters.java

示例8: PsiAwareFileEditorManagerImpl

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public PsiAwareFileEditorManagerImpl(final Project project,
                                     final PsiManager psiManager,
                                     final WolfTheProblemSolver problemSolver,
                                     DockManager dockManager) {
  super(project, dockManager);

  myPsiManager = psiManager;
  myProblemSolver = problemSolver;
  myPsiTreeChangeListener = new MyPsiTreeChangeListener();
  myProblemListener = new MyProblemListener();
  registerExtraEditorDataProvider(new TextEditorPsiDataProvider(), null);

  // reinit syntax highlighter for Groovy. In power save mode keywords are highlighted by GroovySyntaxHighlighter insteadof
  // GrKeywordAndDeclarationHighlighter. So we need to drop caches for token types attributes in LayeredLexerEditorHighlighter
  project.getMessageBus().connect().subscribe(PowerSaveMode.TOPIC, new PowerSaveMode.Listener() {
    @Override
    public void powerSaveStateChanged() {
      UIUtil.invokeLaterIfNeeded(() -> {
        for (Editor editor : EditorFactory.getInstance().getAllEditors()) {
          ((EditorEx)editor).reinitSettings();
        }
      });
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:PsiAwareFileEditorManagerImpl.java

示例9: setUp

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  DockManager dockManager = DockManager.getInstance(getProject());
  myOldDockContainers = dockManager.getContainers();
  myManager = new FileEditorManagerImpl(getProject(), dockManager, EditorHistoryManager.getInstance(getProject()));
  myOldManager = ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
  ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FileEditorManagerTestCase.java

示例10: tearDown

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
@Override
protected void tearDown() throws Exception {
  for (DockContainer container : DockManager.getInstance(getProject()).getContainers()) {
    if (!myOldDockContainers.contains(container)) {
      Disposer.dispose(container);
    }
  }
  myOldDockContainers = null;
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myOldManager);
  myManager.closeAllFiles();
  ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
  super.tearDown();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:FileEditorManagerTestCase.java

示例11: FileEditorManagerImpl

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public FileEditorManagerImpl(final Project project, DockManager dockManager, EditorHistoryManager editorHistoryManager) {
/*    ApplicationManager.getApplication().assertIsDispatchThread(); */
    myProject = project;
    myDockManager = dockManager;
    myEditorHistoryManager = editorHistoryManager;
    myListenerList =
      new MessageListenerList<FileEditorManagerListener>(myProject.getMessageBus(), FileEditorManagerListener.FILE_EDITOR_MANAGER);

    if (Extensions.getExtensions(FileEditorAssociateFinder.EP_NAME).length > 0) {
      myListenerList.add(new FileEditorManagerAdapter() {
        @Override
        public void selectionChanged(@NotNull FileEditorManagerEvent event) {
          EditorsSplitters splitters = getSplitters();
          openAssociatedFile(event.getNewFile(), splitters.getCurrentWindow(), splitters);
        }
      });
    }

    myQueue.setTrackUiActivity(true);

    project.getMessageBus().connect().subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() {

      public void enteredDumbMode() {
      }

      public void exitDumbMode() {
        // can happen under write action, so postpone to avoid deadlock on FileEditorProviderManager.getProviders()
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            if (!project.isDisposed())
              dumbModeFinished(project);
          }
        });
      }
    });
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:FileEditorManagerImpl.java

示例12: FilePreviewPanelProvider

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public FilePreviewPanelProvider(@NotNull Project project, @NotNull FileEditorManagerImpl manager, @NotNull DockManager dockManager) {
  super(ID);
  myProject = project;
  myManager = manager;
  myEditorsSplitters = new MyEditorsSplitters(manager, dockManager, false);
  Disposer.register(this, myEditorsSplitters);
  myEditorsSplitters.createCurrentWindow();
  myWindow = myEditorsSplitters.getCurrentWindow();
  myWindow.setTabsPlacement(UISettings.TABS_NONE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FilePreviewPanelProvider.java

示例13: RunContentManagerImpl

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public RunContentManagerImpl(@NotNull Project project, @NotNull DockManager dockManager) {
  myProject = project;
  DockableGridContainerFactory containerFactory = new DockableGridContainerFactory();
  dockManager.register(DockableGridContainerFactory.TYPE, containerFactory);
  Disposer.register(myProject, containerFactory);

  AppUIUtil.invokeOnEdt(new Runnable() {
    @Override
    public void run() {
      init();
    }
  }, myProject.getDisposed());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:RunContentManagerImpl.java

示例14: testDockableContainer

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public void testDockableContainer() throws Exception {

    VirtualFile file = getFile("/foo.txt");
    myManager.openFile(file, false);
    DockManager dockManager = DockManager.getInstance(getProject());
    assertEquals(1, dockManager.getContainers().size());
    myManager.initDockableContentFactory();

    myManager.openFileInNewWindow(file);
    assertEquals(2, dockManager.getContainers().size());

    Element context = new Element("context");
    WorkingContextManager contextManager = WorkingContextManager.getInstance(getProject());
    contextManager.saveContext(context);
    assertEquals(2, context.getChild("editors").getChildren().size());
    assertEquals(2, EditorFactory.getInstance().getAllEditors().length);

    contextManager.clearContext();
    assertEquals(1, dockManager.getContainers().size());
    assertEquals(0, EditorFactory.getInstance().getAllEditors().length);

    //contextManager.loadContext(context);
    //assertEquals(2, dockManager.getContainers().size());
    //Editor[] editors = EditorFactory.getInstance().getAllEditors();
    //assertEquals(2, editors.length);
    //
    //contextManager.clearContext();
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:EditorsContextTest.java

示例15: setUp

import com.intellij.ui.docking.DockManager; //导入依赖的package包/类
public void setUp() throws Exception {
  super.setUp();
  myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()));
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
  ((IdeDocumentHistoryImpl)IdeDocumentHistory.getInstance(getProject())).projectOpened();
  EditorHistoryManager.getInstance(getProject()).projectOpened();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:HeavyFileEditorManagerTestCase.java


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