本文整理汇总了Java中com.intellij.openapi.wm.ToolWindow.activate方法的典型用法代码示例。如果您正苦于以下问题:Java ToolWindow.activate方法的具体用法?Java ToolWindow.activate怎么用?Java ToolWindow.activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.wm.ToolWindow
的用法示例。
在下文中一共展示了ToolWindow.activate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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: actionPerformed
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
//Get required data keys
final Project project = e.getData(CommonDataKeys.PROJECT);
final Editor editor = e.getData(CommonDataKeys.EDITOR);
//Generate the autoQuery
String autoQuery = project.getComponent(TermStatComponent.class).generateQuery(editor);
//Execute Search and Open Tool Window
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow("StackInTheFlow");
SearchToolWindowGUI toolWindowGUI = project.getComponent(ToolWindowComponent.class).getSearchToolWindowGUI();
toolWindowGUI.autoQuery(autoQuery, true, "action");
toolWindow.activate(() -> {
});
}
示例3: initAndExecute
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initAndExecute(final String workDir,final String[] shell) {
ToolWindow toolWindow = getToolWindow();
if (toolWindow.isActive()) {
if (workDir != null) {
executeShell("cd " + Utils.formatPath(workDir));
}
executeShell(shell);
} else {
toolWindow.activate(new Runnable() {
@Override
public void run() {
if (workDir != null) {
executeShell("cd " + Utils.formatPath(workDir));
}
executeShell(shell);
}
});
}
}
示例4: actionPerformed
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Module module = getTargetModule(e);
if (module != null) {
final Project project = module.getProject();
ToolWindowManager manager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = manager.getToolWindow(BuildVariantToolWindowFactory.ID);
if (toolWindow != null) {
toolWindow.activate(new Runnable() {
@Override
public void run() {
BuildVariantView view = BuildVariantView.getInstance(project);
view.findAndSelectVariantEditor(module);
}
});
}
}
}
示例5: showInVersionControlToolWindow
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void showInVersionControlToolWindow(final Project project, final String title, final List<FilePath> filesToShow,
final String prompt) {
final IntersectingLocalChangesPanel component = new IntersectingLocalChangesPanel(project, filesToShow, prompt);
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
final ContentManager contentManager = toolWindow.getContentManager();
Content content = ContentFactory
.SERVICE.getInstance().createContent(component.getPanel(), title, true);
ContentsUtil.addContent(contentManager, content, true);
toolWindow.activate(new Runnable() {
public void run() {
IdeFocusManager.getInstance(project).requestFocus(component.getPrefferedFocusComponent(), true);
}
});
}
示例6: openSession
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void openSession(@NotNull ToolWindow toolWindow, @NotNull AbstractTerminalRunner terminalRunner) {
if (myTerminalWidget == null) {
toolWindow.getContentManager().removeAllContents(true);
final Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
}
else {
terminalRunner.openSession(myTerminalWidget);
}
toolWindow.activate(new Runnable() {
@Override
public void run() {
}
}, true);
}
示例7: showMe
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public static void showMe(final Project project, final SvnFileRevision revision, final VirtualFile file) {
if (ModalityState.NON_MODAL.equals(ModalityState.current())) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
final ContentManager contentManager = toolWindow.getContentManager();
final MyDialog dialog = new MyDialog(project, revision, file);
// TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
Disposer.register(project, dialog.getDisposable());
Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(),
SvnBundle.message("merge.source.details.title", (file == null) ? revision.getURL() : file.getName(), revision.getRevisionNumber().asString()), true);
ContentsUtil.addOrReplaceContent(contentManager, content, true);
toolWindow.activate(null);
} else {
new MyDialog(project, revision, file).show();
}
}
示例8: batchPerform
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
protected void batchPerform(Project project, final SvnVcs activeVcs, VirtualFile[] file, DataContext context) throws VcsException {
final File[] ioFiles = new File[file.length];
for (int i = 0; i < ioFiles.length; i++) {
ioFiles[i] = new File(file[i].getPath());
}
if (ioFiles.length > 0) {
ToolWindow w = ToolWindowManager.getInstance(project).getToolWindow(PropertiesComponent.ID);
PropertiesComponent component = null;
if (w == null) {
component = new PropertiesComponent();
w = ToolWindowManager.getInstance(project).registerToolWindow(PropertiesComponent.ID, component, ToolWindowAnchor.BOTTOM);
} else {
component = ((PropertiesComponent) w.getContentManager().getContents()[0].getComponent());
}
w.setTitle(ioFiles[0].getName());
w.show(null);
final PropertiesComponent comp = component;
w.activate(new Runnable() {
public void run() {
comp.setFile(activeVcs, ioFiles[0]);
}
});
}
}
示例9: actionPerformed
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的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);
}
}
示例10: initAndActiveRunRefresh
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initAndActiveRunRefresh(InputEvent e) {
ToolWindow toolWindow = getToolWindow();
if (!toolWindow.isActive()) {
toolWindow.activate(new Runnable() {
@Override
public void run() {
ActionManager.getInstance().tryToExecute(new AndroidRefreshAction(ReactNativeConsole.this), e, null, ActionPlaces.UNKNOWN, true);
}
});
} else {
ActionManager.getInstance().tryToExecute(new AndroidRefreshAction(this), e, null, ActionPlaces.UNKNOWN, true);
}
}
示例11: initAndExecute
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
public void initAndExecute(final String[] shell) {
ToolWindow toolWindow = getToolWindow();
if (toolWindow.isActive()) {
executeShell(shell);
} else {
toolWindow.activate(new Runnable() {
@Override
public void run() {
executeShell(shell);
}
});
}
}
示例12: openSession
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void openSession(@NotNull ToolWindow toolWindow, @NotNull AbstractTerminalRunner terminalRunner) {
if (this.myTerminalWidget == null) {
toolWindow.getContentManager().removeAllContents(true);
Content content = this.createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
} else {
terminalRunner.openSession(this.myTerminalWidget);
}
toolWindow.activate(() -> {
}, true);
}
示例13: refreshToolWindows
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
private void refreshToolWindows() {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(PluginProperties.getValue("toolwindows.id"));
toolWindow.activate(null);
for (Content content : toolWindow.getContentManager().getContents()) {
if (content.getComponent() instanceof ToolWindowPanel) {
ToolWindowPanel toolWindowPanel = (ToolWindowPanel) content.getComponent();
toolWindowPanel.getRefreshAction().actionPerformed(null);
}
}
}
示例14: navigate
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void navigate(@NotNull final PsiPackage psiPackage, final boolean requestFocus) {
final Project project = psiPackage.getProject();
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
window.activate(null);
window.getActivation().doWhenDone(new Runnable() {
@Override
public void run() {
final ProjectView projectView = ProjectView.getInstance(project);
PsiDirectory[] directories = suggestMostAppropriateDirectories(psiPackage);
if (directories.length == 0) return;
projectView.select(directories[0], directories[0].getVirtualFile(), requestFocus);
}
});
}
示例15: showServerConnection
import com.intellij.openapi.wm.ToolWindow; //导入方法依赖的package包/类
@Override
public void showServerConnection(@NotNull final ServerConnection<?> connection) {
final ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ServersToolWindowManager.WINDOW_ID);
if (toolWindow != null) {
toolWindow.activate(new Runnable() {
@Override
public void run() {
ServersToolWindowContent content = getServersViewComponent(toolWindow);
if (content != null) {
content.select(connection);
}
}
});
}
}