本文整理汇总了Java中com.intellij.openapi.wm.ToolWindow类的典型用法代码示例。如果您正苦于以下问题:Java ToolWindow类的具体用法?Java ToolWindow怎么用?Java ToolWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolWindow类属于com.intellij.openapi.wm包,在下文中一共展示了ToolWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Set<SelectedExchangeCurrencyPair> selectedExchangeCurrencyPairs = IdeaCurrencyConfig.getInstance().getSelectedExchangeCurrencyPairs();
if (IdeaCurrencyConfig.getInstance().getActive()) {
List<TickerDto> data = IdeaCurrencyApp.getInstance().getTickers(selectedExchangeCurrencyPairs);
fillData(data);
}
Content content = contentFactory.createContent(contentPane, "", false);
toolWindow.getContentManager().addContent(content);
MessageBus messageBus = project.getMessageBus();
messageBusConnection = messageBus.connect();
messageBusConnection.subscribe(ConfigChangeNotifier.CONFIG_TOPIC, active -> {
if (active) {
scheduleNextTask();
}
});
}
示例2: getRNConsole
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
/**
* 获取 RN Console实例.
*
* @param displayName - the tab's display name must be unique.
* @param icon - used to set a tab icon, not used for search
* @return
*/
public RNConsoleImpl getRNConsole(String displayName, Icon icon) {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
Content existingContent = createConsoleTabContent(window, false, displayName, icon);
if (existingContent != null) {
final JComponent existingComponent = existingContent.getComponent();
if (existingComponent instanceof SimpleToolWindowPanel) {
JComponent component = ((SimpleToolWindowPanel) existingComponent).getContent();
if (component instanceof RNConsoleImpl) {
RNConsoleImpl rnConsole = (RNConsoleImpl) component;
return rnConsole;
}
}
}
}
return null;
}
示例3: createTerminalInContentPanel
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
/**
* Create a terminal panel
*
* @param terminalRunner
* @param toolWindow
* @return
*/
private Content createTerminalInContentPanel(@NotNull AbstractTerminalRunner terminalRunner, @NotNull final ToolWindow toolWindow) {
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(true);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false);
content.setCloseable(true);
myTerminalWidget = terminalRunner.createTerminalWidget(content);
panel.setContent(myTerminalWidget.getComponent());
panel.addFocusListener(this);
createToolbar(terminalRunner, myTerminalWidget, toolWindow, panel);// west toolbar
ActionToolbar toolbar = createTopToolbar(terminalRunner, myTerminalWidget, toolWindow);
toolbar.setTargetComponent(panel);
panel.setToolbar(toolbar.getComponent(), false);
content.setPreferredFocusableComponent(myTerminalWidget.getComponent());
return content;
}
示例4: init
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void init(ToolWindow window) {
builds = BuildsModel.getInstance();
rootNode = new DefaultMutableTreeNode("CircleCI");
TreeModel treeModel = new DefaultTreeModel(rootNode);
tree1.setModel(treeModel);
tree1.setShowsRootHandles(true);
tree1.setCellRenderer(new RecentBuildTreeCellRenderer());
PropertiesComponent component = PropertiesComponent.getInstance();
Integer refreshInterval;
try {
refreshInterval = new Integer(component.getValue("com.bkv.intellij.icons.refresh_interval"));
} catch (Exception e) {
refreshInterval = new Integer(99999999);
}
enableAutoRefresh(refreshInterval);
refresh();
}
开发者ID:waarneembemiddeling,项目名称:intellij-circleci-integration,代码行数:19,代码来源:RecentBuildsToolWindowFactory.java
示例5: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull ToolWindow toolWindow) {
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
BsConsole console = new BsConsole(project);
panel.setContent(console.getComponent());
ActionToolbar toolbar = console.createToolbar();
panel.setToolbar(toolbar.getComponent());
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", true);
toolWindow.getContentManager().addContent(content);
// Start compiler
BsCompiler bsc = BucklescriptProjectComponent.getInstance(project).getCompiler();
if (bsc != null) {
bsc.addListener(new BsOutputListener(project));
ProcessHandler handler = bsc.getHandler();
if (handler == null) {
console.print("Bsb not found, check the event logs.", ERROR_OUTPUT);
} else {
console.attachToProcess(handler);
}
bsc.startNotify();
}
}
示例6: updateTarget
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
private void updateTarget() {
targetPanel.setLayout(new GridLayout(0, 1, 0, 0));
if (IMWindowFactory.getDefault() == null || IMWindowFactory.getDefault().getProject() == null) {
return;
}
ToolWindow window = ToolWindowManager.getInstance(IMWindowFactory.getDefault().getProject()).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
Content[] contents = window.getContentManager().getContents();
if (contents != null) {
for (Content content : contents) {
if (content.getComponent() != null && content.getComponent() instanceof IMPanel) {
IMPanel panel = (IMPanel) content.getComponent();
List<IMChatConsole> chats = panel.getConsoleList();
if (!chats.isEmpty()) {
consoles.addAll(chats);
targetPanel.add(new GroupPanel(content.getDisplayName(), chats));
}
}
}
}
}
}
示例7: 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);
}
示例8: onProjectInitialized
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
private void onProjectInitialized() {
if (!CommonIdeaService.getInstance().isHybrisProject(myProject)) {
return;
}
final ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(myProject);
final ToolWindow antToolWindow = toolWindowManager.getToolWindow(ANT_TOOL_WINDOW_ID);
if (antToolWindow == null) {
LOG.info("Cannot get Ant tool window");
return;
}
if (!tryToPatchToolWindow(antToolWindow)) {
toolWindowManager.addToolWindowManagerListener(new ToolWindowManagerAdapter() {
private boolean pending = true;
@Override
public void stateChanged() {
if (pending && tryToPatchToolWindow(antToolWindow)) {
pending = false;
toolWindowManager.removeToolWindowManagerListener(this);
}
}
});
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:AntTreeUpdatingHack.java
示例9: getAntExplorer
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Nullable
private static AntExplorer getAntExplorer(final @NotNull ToolWindow antToolWindow) {
final AntExplorer antExplorer = Arrays
.stream(antToolWindow.getContentManager().getContents())
.map(content -> {
final JComponent component = content.getComponent();
return component instanceof AntExplorer ? (AntExplorer) component : null;
})
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
if (antExplorer == null) {
LOG.info("Cannot get AntExplorer object");
}
return antExplorer;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:18,代码来源:AntTreeUpdatingHack.java
示例10: showConsoleToolWindow
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
public void showConsoleToolWindow(final Project project, final ConsoleView... consoles) {
Integer currentSelectedContentIndex = 0;
if (toolWindow == null) {
createNewToolWindow(project);
} else if (!toolWindow.getTitle().equals("Hybris Console")) {
final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow("Hybris Console");
if (window == null) {
createNewToolWindow(project);
} else {
toolWindow = window;
currentSelectedContentIndex = getCurrentSelectedTab();
toolWindow.getContentManager().removeAllContents(false);
}
} else {
currentSelectedContentIndex = getCurrentSelectedTab();
toolWindow.getContentManager().removeAllContents(false);
}
setConsolesInToolWindow(consoles);
toolWindow.activate(null);
selectTab(currentSelectedContentIndex);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:22,代码来源:ConsoleToolWindowUtil.java
示例11: projectClosed
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void projectClosed() {
final Course course = StudyTaskManager.getInstance(myProject).getCourse();
if (course != null) {
final ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
if (toolWindow != null) {
toolWindow.getContentManager().removeAllContents(false);
}
KeymapManagerEx keymapManager = KeymapManagerEx.getInstanceEx();
for (Keymap keymap : keymapManager.getAllKeymaps()) {
List<Pair<String, String>> pairs = myDeletedShortcuts.get(keymap);
if (pairs != null && !pairs.isEmpty()) {
for (Pair<String, String> actionShortcut : pairs) {
keymap.addShortcut(actionShortcut.first, new KeyboardShortcut(KeyStroke.getKeyStroke(actionShortcut.second), null));
}
}
}
}
myListener = null;
}
示例12: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
toolWindow.setIcon(EducationalCoreIcons.TaskDescription);
final Course course = StudyTaskManager.getInstance(project).getCourse();
if (course != null) {
final StudyToolWindow studyToolWindow;
if (StudyUtils.hasJavaFx() && StudySettings.getInstance().shouldUseJavaFx()) {
studyToolWindow = new StudyJavaFxToolWindow();
}
else {
studyToolWindow = new StudySwingToolWindow();
}
studyToolWindow.init(project, true);
final ContentManager contentManager = toolWindow.getContentManager();
final Content content = contentManager.getFactory().createContent(studyToolWindow, null, false);
contentManager.addContent(content);
Disposer.register(project, studyToolWindow);
}
}
示例13: showTestResultsToolWindow
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
public static void showTestResultsToolWindow(@NotNull final Project project, @NotNull final String message) {
ApplicationManager.getApplication().invokeLater(() -> {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow window = toolWindowManager.getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
if (window == null) {
toolWindowManager.registerToolWindow(StudyTestResultsToolWindowFactoryKt.ID, true, ToolWindowAnchor.BOTTOM);
window = toolWindowManager.getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
new StudyTestResultsToolWindowFactory().createToolWindowContent(project, window);
}
final Content[] contents = window.getContentManager().getContents();
for (Content content : contents) {
final JComponent component = content.getComponent();
if (component instanceof ConsoleViewImpl) {
((ConsoleViewImpl)component).clear();
((ConsoleViewImpl)component).print(message, ConsoleViewContentType.ERROR_OUTPUT);
window.setAvailable(true,null);
window.show(null);
}
}
});
}
示例14: init
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void init(ToolWindow window) {
Project project = ProjectChecker.getFirstOpenedProject();
String title = "Configuration";
if (project != null) {
title += " for '" + project.getName() + "'";
PsiManager.getInstance(project).addPsiTreeChangeListener(this);
}
window.setTitle(title);
componentList.add(new Triple<>(new String[]{"languages", "translations"}, Boolean.class, cbTranslationEnabled));
componentList.add(new Triple<>(new String[]{"languages", "http_accept_language"}, Boolean.class, cbActiveLanguageBrowser));
componentList.add(new Triple<>(new String[]{"languages", "include_default_lang"}, Boolean.class, cbIncludeDefaultLang));
try {
refreshComponents(true);
} catch (Exception e) {
errorOccurred = true;
}
}
示例15: initFacet
import com.intellij.openapi.wm.ToolWindow; //导入依赖的package包/类
@Override
public void initFacet() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ToolWindowManager manager = ToolWindowManager.getInstance(MuleFacet.this.getModule().getProject());
List<String> ids = Arrays.asList(manager.getToolWindowIds());
if (manager.getToolWindow("Global Configs") == null && !ids.contains("Global Configs")) {
try {
ToolWindow toolWindow = manager.registerToolWindow("Global Configs", true, ToolWindowAnchor.LEFT, false);
toolWindow.setIcon(MuleIcons.MuleIcon);
GlobalConfigsToolWindowPanel toolWindowPanel = new GlobalConfigsToolWindowPanel(MuleFacet.this.getModule().getProject());
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(toolWindowPanel, "", true);
toolWindow.getContentManager().addContent(content);
} catch (Exception e) {
logger.error("Unable to initialize toolWindow: ", e);
}
}
}
});
}