本文整理汇总了Java中com.intellij.openapi.wm.ex.ToolWindowManagerListener类的典型用法代码示例。如果您正苦于以下问题:Java ToolWindowManagerListener类的具体用法?Java ToolWindowManagerListener怎么用?Java ToolWindowManagerListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ToolWindowManagerListener类属于com.intellij.openapi.wm.ex包,在下文中一共展示了ToolWindowManagerListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolWindowListener
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
private ToolWindowManagerListener createToolWindowListener() {
return new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
Log.d("DebuggerComponent.toolWindowRegistered");
}
@Override
public void stateChanged() {
ToolWindow toolWindow = ToolWindowManager.getInstance(mProject).getToolWindow(DebuggerToolWindowFactory.TOOL_WINDOW_ID);
if (toolWindow != null) {
if (toolWindow.isVisible() && toolWindow.getContentManager().getContentCount() == 0) {
Log.d("DebuggerComponent.isVisible ContentCount>0");
initApiDebugger(toolWindow);
}
}
}
};
}
示例2: TestResultsPanel
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
protected TestResultsPanel(@NotNull JComponent console, AnAction[] consoleActions, TestConsoleProperties properties,
@NotNull String splitterProportionProperty, float splitterDefaultProportion) {
super(new BorderLayout(0,1));
myConsole = console;
myConsoleActions = consoleActions;
myProperties = properties;
mySplitterProportionProperty = splitterProportionProperty;
mySplitterDefaultProportion = splitterDefaultProportion;
myStatisticsSplitterProportionProperty = mySplitterProportionProperty + "_Statistics";
final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
final boolean splitVertically = splitVertically();
myStatusLine.setPreferredSize(splitVertically);
mySplitter.setOrientation(splitVertically);
revalidate();
repaint();
}
};
ToolWindowManagerEx.getInstanceEx(properties.getProject()).addToolWindowManagerListener(listener, this);
}
示例3: doInit
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
private void doInit(@NotNull final ToolWindow toolWindow) {
myInitialized = true;
toolWindow.setToHideOnEmptyContent(true);
((ToolWindowManagerEx)ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = getToolWindow();
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
PydevConsoleRunner runner = PythonConsoleRunnerFactory.getInstance().createConsoleRunner(myProject, null);
runner.run();
}
}
}
});
}
示例4: TestResultsPanel
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
protected TestResultsPanel(@Nonnull JComponent console, AnAction[] consoleActions, TestConsoleProperties properties,
@Nonnull String splitterProportionProperty, float splitterDefaultProportion) {
super(new BorderLayout(0,1));
myConsole = console;
myConsoleActions = consoleActions;
myProperties = properties;
mySplitterProportionProperty = splitterProportionProperty;
mySplitterDefaultProportion = splitterDefaultProportion;
myStatisticsSplitterProportionProperty = mySplitterProportionProperty + "_Statistics";
final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@Nonnull String id) {
}
@Override
public void stateChanged() {
final boolean splitVertically = splitVertically();
myStatusLine.setPreferredSize(splitVertically);
mySplitter.setOrientation(splitVertically);
revalidate();
repaint();
}
};
ToolWindowManagerEx.getInstanceEx(properties.getProject()).addToolWindowManagerListener(listener, this);
}
示例5: initTerminal
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setStripeTitle("RN Console");
toolWindow.setIcon(PluginIcons.React);
Content content = createConsoleTabContent(toolWindow, true, "Welcome", null);
// toolWindow.getContentManager().addContent(content);
// toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));
// ======= test a terminal create ======
// LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
// Content testTerminalContent = createTerminalInContentPanel(terminalRunner, toolWindow);
// toolWindow.getContentManager().addContent(testTerminalContent);
// SimpleTerminal term = new SimpleTerminal();
// term.sendString("ls\n");
// toolWindow.getContentManager().addContent(new ContentImpl(term.getComponent(), "terminal", false));
toolWindow.setShowStripeButton(true);// if set to false, then sometimes the window will be hidden from the dock area for ever 2017-05-26
// toolWindow.setTitle(" - ");
((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
toolWindow.show(null);
}
示例6: initTerminal
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
myTerminalRunner = terminalRunner;
toolWindow.setStripeTitle("React Native");
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
toolWindow.setShowStripeButton(true);
toolWindow.setTitle("Console");
((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
toolWindow.show(null);
JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
if (terminal != null) {
terminal.setCursorVisible(true);// 是否启用光标 BeanSoft
}
}
}
示例7: createToolWindowContent
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
instance = this;
this.project = project;
toolWindow.setToHideOnEmptyContent(true);
createContents(project, toolWindow);
ToolWindowManager manager = ToolWindowManager.getInstance(project);
if (manager instanceof ToolWindowManagerEx) {
ToolWindowManagerEx managerEx = ((ToolWindowManagerEx) manager);
managerEx.addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
createContents(project, window);
}
}
}
});
}
// Disposer.register(project, new Disposable() {
// @Override
// public void dispose() {
// if (panel != null && panel.isEnabled()) {
// panel.setEnabled(false);
// panel = null;
// }
// }
// });
}
示例8: activateConsoleToolWindow
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
private static void activateConsoleToolWindow(@NotNull Project project) {
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = manager.getToolWindow(toolWindowId);
if (toolWindow != null) {
return;
}
toolWindow = manager.registerToolWindow(toolWindowId, true, ToolWindowAnchor.BOTTOM);
final ConsoleView console = new ConsoleViewImpl(project, false);
project.putUserData(CONSOLE_VIEW_KEY, console);
toolWindow.getContentManager().addContent(new ContentImpl(console.getComponent(), "", false));
final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = manager.getToolWindow(toolWindowId);
if (window != null && !window.isVisible()) {
manager.unregisterToolWindow(toolWindowId);
((ToolWindowManagerEx) manager).removeToolWindowManagerListener(this);
}
}
};
toolWindow.show(new Runnable() {
@Override
public void run() {
((ToolWindowManagerEx) manager).addToolWindowManagerListener(listener);
}
});
}
示例9: initTerminal
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
toolWindow.setStripeTitle("Fastdex");
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
toolWindow.setShowStripeButton(true);
toolWindow.setTitle("Console");
((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(FastdexToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
toolWindow.show(null);
JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
if (terminal != null) {
terminal.setCursorVisible(false);
}
}
}
示例10: addToolWindowManagerListener
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void addToolWindowManagerListener(@NotNull ToolWindowManagerListener l, @NotNull Disposable parentDisposable) {
}
示例11: removeToolWindowManagerListener
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void removeToolWindowManagerListener(@NotNull ToolWindowManagerListener l) {
}
示例12: activateConsoleToolWindow
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
public static void activateConsoleToolWindow(@NotNull Project project, @NotNull final Runnable runAfterActivation) {
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
final String toolWindowId = AndroidBundle.message("android.console.tool.window.title");
ToolWindow toolWindow = manager.getToolWindow(toolWindowId);
if (toolWindow != null) {
runAfterActivation.run();
return;
}
toolWindow = manager.registerToolWindow(toolWindowId, true, ToolWindowAnchor.BOTTOM);
final ConsoleView console = new ConsoleViewImpl(project, false);
project.putUserData(CONSOLE_VIEW_KEY, console);
toolWindow.getContentManager().addContent(new ContentImpl(console.getComponent(), "", false));
final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = manager.getToolWindow(toolWindowId);
if (window != null && !window.isVisible()) {
((ToolWindowManagerEx)manager).removeToolWindowManagerListener(this);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
manager.unregisterToolWindow(toolWindowId);
}
});
}
}
};
toolWindow.show(new Runnable() {
@Override
public void run() {
runAfterActivation.run();
((ToolWindowManagerEx)manager).addToolWindowManagerListener(listener);
}
});
}
示例13: initTerminal
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
public void initTerminal(final ToolWindow toolWindow) {
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
toolWindow.setToHideOnEmptyContent(true);
if (terminalRunner != null) {
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
((ToolWindowManagerEx)ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TerminalToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
Disposer.register(myProject, new Disposable() {
@Override
public void dispose() {
if (myTerminalWidget != null) {
myTerminalWidget.dispose();
myTerminalWidget = null;
}
}
});
}
if (myDockContainer == null) {
myDockContainer = new TerminalDockContainer(toolWindow);
Disposer.register(myProject, myDockContainer);
DockManager.getInstance(myProject).register(myDockContainer);
}
}
示例14: initTerminal
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
public void initTerminal(final ToolWindow toolWindow)
{
LocalTerminalDirectRunner terminalRunner = OpenLocalTerminalAction.createTerminalRunner(myProject);
toolWindow.setToHideOnEmptyContent(true);
if(terminalRunner != null)
{
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
((ToolWindowManagerEx) ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new
ToolWindowManagerListener()
{
@Override
public void toolWindowRegistered(@NotNull String id)
{
}
@Override
public void stateChanged()
{
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow
(TerminalToolWindowFactory.TOOL_WINDOW_ID);
if(window != null)
{
boolean visible = window.isVisible();
if(visible && toolWindow.getContentManager().getContentCount() == 0)
{
initTerminal(window);
}
}
}
});
Disposer.register(myProject, new Disposable()
{
@Override
public void dispose()
{
if(myTerminalWidget != null)
{
myTerminalWidget.dispose();
myTerminalWidget = null;
}
}
});
}
if(myDockContainer == null)
{
myDockContainer = new TerminalDockContainer(toolWindow);
Disposer.register(myProject, myDockContainer);
DockManager.getInstance(myProject).register(myDockContainer);
}
}
示例15: addToolWindowManagerListener
import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void addToolWindowManagerListener(@Nonnull ToolWindowManagerListener listener, @Nonnull Disposable parentDisposable) {
}