本文整理汇总了Java中com.intellij.openapi.wm.ToolWindowManager.getToolWindow方法的典型用法代码示例。如果您正苦于以下问题:Java ToolWindowManager.getToolWindow方法的具体用法?Java ToolWindowManager.getToolWindow怎么用?Java ToolWindowManager.getToolWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.wm.ToolWindowManager
的用法示例。
在下文中一共展示了ToolWindowManager.getToolWindow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event)
{
project = event.getProject();
if (project == null)
{
return;
}
ToolWindowManager toolWindowMgr = ToolWindowManager.getInstance(project);
ToolWindow tw = toolWindowMgr.getToolWindow(TOOL_WINDOW_ID);
if (tw == null)
{
tw = toolWindowMgr.registerToolWindow(TOOL_WINDOW_ID, true, ToolWindowAnchor.BOTTOM, true);
}
final ToolWindow toolWindow = tw;
toolWindow.activate(() -> updateContent(toolWindow, project.getName()), true);
}
示例2: showDeployment
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void showDeployment(@NotNull final ServerConnection<?> connection, @NotNull final String deploymentName) {
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
final ToolWindow toolWindow = toolWindowManager.getToolWindow(ServersToolWindowManager.WINDOW_ID);
if (toolWindow != null) {
toolWindowManager.invokeLater(new Runnable() {
@Override
public void run() {
ServersToolWindowContent component = getServersViewComponent(toolWindow);
if (component != null) {
component.select(connection, deploymentName);
}
}
});
}
}
示例3: ensureToolWindowInitialized
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public static void ensureToolWindowInitialized(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
try {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
if (!(manager instanceof ToolWindowManagerEx)) {
return;
}
ToolWindowManagerEx managerEx = (ToolWindowManagerEx)manager;
String id = externalSystemId.getReadableName();
ToolWindow window = manager.getToolWindow(id);
if (window != null) {
return;
}
ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
for (final ToolWindowEP bean : beans) {
if (id.equals(bean.id)) {
managerEx.initToolWindow(bean);
}
}
}
catch (Exception e) {
LOG.error(String.format("Unable to initialize %s tool window", externalSystemId.getReadableName()), e);
}
}
示例4: getWindow
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Nullable
private ToolWindow getWindow(AnActionEvent event) {
if (myWindow != null) return myWindow;
Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
if (project == null) return null;
ToolWindowManager manager = ToolWindowManager.getInstance(project);
final ToolWindow window = manager.getToolWindow(manager.getActiveToolWindowId());
if (window == null) return null;
final Component context = PlatformDataKeys.CONTEXT_COMPONENT.getData(event.getDataContext());
if (context == null) return null;
return SwingUtilities.isDescendingFrom(window.getComponent(), context) ? window : null;
}
示例5: update
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public final void update(AnActionEvent e) {
super.update(e);
Presentation presentation = e.getPresentation();
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr=ToolWindowManager.getInstance(project);
String id=mgr.getActiveToolWindowId();
if (id == null) {
presentation.setEnabled(false);
return;
}
ToolWindow window = mgr.getToolWindow(id);
if (window == null) {
presentation.setEnabled(false);
return;
}
update(window, presentation);
}
示例6: update
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public void update(AnActionEvent event){
super.update(event);
Presentation presentation = event.getPresentation();
Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr=ToolWindowManager.getInstance(project);
String id=mgr.getActiveToolWindowId();
if(id==null){
presentation.setEnabled(false);
return;
}
ToolWindow toolWindow=mgr.getToolWindow(id);
presentation.setEnabled(toolWindow.isAvailable()
&& toolWindow.getType() != ToolWindowType.FLOATING
&& toolWindow.getType() != ToolWindowType.WINDOWED);
}
示例7: updateToolWindows
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public static void updateToolWindows() {
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
for (String id : toolWindowManager.getToolWindowIds()) {
final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
for (Content content : toolWindow.getContentManager().getContents()) {
final JComponent component = content.getComponent();
if (component != null) {
IJSwingUtilities.updateComponentTreeUI(component);
}
}
final JComponent c = toolWindow.getComponent();
if (c != null) {
IJSwingUtilities.updateComponentTreeUI(c);
}
}
}
}
示例8: actionPerformed
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
RepositoryBrowserDialog dialog = new RepositoryBrowserDialog(ProjectManager.getInstance().getDefaultProject());
dialog.show();
}
else {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
ToolWindow w = manager.getToolWindow(REPOSITORY_BROWSER_TOOLWINDOW);
if (w == null) {
RepositoryToolWindowPanel component = new RepositoryToolWindowPanel(project);
w = manager.registerToolWindow(REPOSITORY_BROWSER_TOOLWINDOW, true, ToolWindowAnchor.BOTTOM, project, true);
final Content content = ContentFactory.SERVICE.getInstance().createContent(component, "", false);
Disposer.register(content, component);
w.getContentManager().addContent(content);
}
w.show(null);
w.activate(null);
}
}
示例9: callProtractor
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
private void callProtractor() {
try {
Config config = Config.getInstance(project);
if (config == null) {
return;
}
GeneralCommandLine command = getProtractorRunCommand(config);
Process p = command.createProcess();
if (project != null) {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
String id = "Gherkin Runner";
TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
TextConsoleBuilder builder = factory.createBuilder(project);
ConsoleView view = builder.getConsole();
ColoredProcessHandler handler = new ColoredProcessHandler(p, command.getPreparedCommandLine());
handler.startNotify();
view.attachToProcess(handler);
ToolWindow window = manager.getToolWindow(id);
Icon cucumberIcon = IconLoader.findIcon("/resources/icons/cucumber.png");
if (window == null) {
window = manager.registerToolWindow(id, true, ToolWindowAnchor.BOTTOM);
window.setIcon(cucumberIcon);
}
ContentFactory cf = window.getContentManager().getFactory();
Content c = cf.createContent(view.getComponent(), "Run " + (window.getContentManager().getContentCount() + 1), true);
window.getContentManager().addContent(c);
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
示例10: configure
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void configure(
@NotNull HybrisProjectDescriptor hybrisProjectDescriptor,
@NotNull final List<HybrisModuleDescriptor> allModules,
@NotNull final Project project
) {
this.hybrisProjectDescriptor = hybrisProjectDescriptor;
parseModules(allModules);
if (platformDescriptor == null) {
return;
}
final File platformDir = platformDescriptor.getRootDirectory();
createAntInstallation(platformDir);
if (antInstallation == null) {
return;
}
createAntClassPath(platformDir);
AntConfigurationBase.getInstance(project).setFilterTargets(true);
antConfiguration = AntConfigurationBase.getInstance(project);
final AntBuildFileBase buildFile = registerAntInstallation(platformDir, platformDir, desirablePlatformTargets);
customHybrisModuleDescriptorList.forEach(
e -> registerAntInstallation(platformDir, e.getRootDirectory(), desirableCustomTargets)
);
saveAntInstallation(antInstallation);
removeMake(project);
createMetaTargets(buildFile);
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
final ToolWindow window = manager.getToolWindow("Ant Build");
window.show(null);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:32,代码来源:DefaultAntConfigurator.java
示例11: projectOpened
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Override
public void projectOpened() {
Icon icon = IconLoader.getIcon(ICON_NYANDROID);
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = toolWindowManager.getToolWindow("Logcat");
if (toolWindow != null) {
toolWindow.setIcon(icon);
}
}
示例12: clearConsoleToolWindow
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
public static void clearConsoleToolWindow(@NotNull Project project) {
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = manager.getToolWindow(toolWindowId);
if (toolWindow == null) return;
toolWindow.getContentManager().removeAllContents(false);
toolWindow.hide(null);
}
示例13: activateConsoleToolWindow
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的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);
}
});
}
示例14: updateWindowAvailable
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
private void updateWindowAvailable(boolean showIfAvailable) {
boolean available = ServersToolWindowFactory.isAvailable(myProject);
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
final ToolWindow toolWindow = toolWindowManager.getToolWindow(WINDOW_ID);
if (toolWindow == null) {
if (available) {
toolWindowManager.invokeLater(new Runnable() {
@Override
public void run() {
createToolWindow(myProject, toolWindowManager).show(null);
}
});
}
return;
}
boolean doShow = !toolWindow.isAvailable() && available;
if (toolWindow.isAvailable() && !available) {
toolWindow.hide(null);
}
toolWindow.setAvailable(available, null);
if (showIfAvailable && doShow) {
toolWindow.show(null);
}
}
示例15: getToolWindow
import com.intellij.openapi.wm.ToolWindowManager; //导入方法依赖的package包/类
@Nullable
private static ToolWindow getToolWindow(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
if (toolWindowManager == null) {
return null;
}
ToolWindow result = toolWindowManager.getToolWindow(externalSystemId.getReadableName());
if (result instanceof ToolWindowImpl) {
((ToolWindowImpl)result).ensureContentInitialized();
}
return result;
}