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


Java ToolWindowManagerListener类代码示例

本文整理汇总了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);
                }
            }
        }
    };
}
 
开发者ID:FingerArt,项目名称:ApiDebugger,代码行数:20,代码来源:DebuggerComponent.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:TestResultsPanel.java

示例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();
        }
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:PythonConsoleToolWindow.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:TestResultsPanel.java

示例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);
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:37,代码来源:ReactNativeConsole.java

示例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
        }
    }
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:36,代码来源:ReactNativeTerminal.java

示例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;
//                }
//            }
//        });
    }
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:38,代码来源:IMWindowFactory.java

示例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);
        }
    });
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:37,代码来源:LuaSystemUtil.java

示例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);
        }
    }
}
 
开发者ID:typ0520,项目名称:fastdex,代码行数:35,代码来源:FastdexTerminal.java

示例10: addToolWindowManagerListener

import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void addToolWindowManagerListener(@NotNull ToolWindowManagerListener l, @NotNull Disposable parentDisposable) {
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ToolWindowHeadlessManagerImpl.java

示例11: removeToolWindowManagerListener

import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void removeToolWindowManagerListener(@NotNull ToolWindowManagerListener l) {
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ToolWindowHeadlessManagerImpl.java

示例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);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:AndroidUtils.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:TerminalView.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-terminal,代码行数:59,代码来源:TerminalView.java

示例15: addToolWindowManagerListener

import com.intellij.openapi.wm.ex.ToolWindowManagerListener; //导入依赖的package包/类
@Override
public void addToolWindowManagerListener(@Nonnull ToolWindowManagerListener listener, @Nonnull Disposable parentDisposable) {
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ToolWindowHeadlessManagerImpl.java


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