本文整理汇总了Java中com.intellij.ui.content.Content类的典型用法代码示例。如果您正苦于以下问题:Java Content类的具体用法?Java Content怎么用?Java Content使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Content类属于com.intellij.ui.content包,在下文中一共展示了Content类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolWindowContent
import com.intellij.ui.content.Content; //导入依赖的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.ui.content.Content; //导入依赖的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.ui.content.Content; //导入依赖的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: createToolWindowContent
import com.intellij.ui.content.Content; //导入依赖的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();
}
}
示例5: updateTarget
import com.intellij.ui.content.Content; //导入依赖的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));
}
}
}
}
}
}
示例6: getStudyToolWindow
import com.intellij.ui.content.Content; //导入依赖的package包/类
@Nullable
public static StudyToolWindow getStudyToolWindow(@NotNull final Project project) {
if (project.isDisposed()) return null;
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
if (toolWindow != null) {
Content[] contents = toolWindow.getContentManager().getContents();
for (Content content: contents) {
JComponent component = content.getComponent();
if (component != null && component instanceof StudyToolWindow) {
return (StudyToolWindow)component;
}
}
}
return null;
}
示例7: createToolWindowContent
import com.intellij.ui.content.Content; //导入依赖的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);
}
}
示例8: showTestResultsToolWindow
import com.intellij.ui.content.Content; //导入依赖的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);
}
}
});
}
示例9: createChat
import com.intellij.ui.content.Content; //导入依赖的package包/类
private void createChat(MMUserStatus user) throws IOException, URISyntaxException {
Channel.ChannelData channel = client.createChat(user.userId());
if (channel == null) {
Notifications.Bus.notify(new Notification("mattermost", "channel error", "no channel found for " + user.username(), NotificationType.ERROR));
return;
}
SwingUtilities.invokeLater(() -> {
String name = user.username();
Chat chat = this.channelIdChatMap.computeIfAbsent(channel.getId(), k -> new Chat());
chat.channelId = channel.getId();
if (this.toolWindow.getContentManager().getContent(chat) == null) {
Content messages = ContentFactory.SERVICE.getInstance().createContent(chat, name, false);
messages.setIcon(TEAM);
this.toolWindow.getContentManager().addContent(messages);
this.toolWindow.getContentManager().setSelectedContent(messages);
} else {
Content c = this.toolWindow.getContentManager().getContent(chat);
this.toolWindow.getContentManager().setSelectedContent(c);
}
SwingUtilities.invokeLater(chat.inputArea::grabFocus);
});
}
示例10: createWindow
import com.intellij.ui.content.Content; //导入依赖的package包/类
public void createWindow(Project project) {
jFXPanel = new JFXPanel();
ToolWindow toolWindow = ToolWindowManager.getInstance(project).registerToolWindow("Basis.js", false, ToolWindowAnchor.BOTTOM, false);
toolWindow.setIcon(IconLoader.getIcon("/icons/basisjs.png"));
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(jFXPanel, "inspector", false);
toolWindow.getContentManager().addContent(content);
InspectorController sceneInspectorController = new InspectorController();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("/com/basisjs/ui/windows/tools/inspector/InspectorScene.fxml"));
fxmlLoader.setController(sceneInspectorController);
Platform.setImplicitExit(false);
PlatformImpl.runLater(() -> {
try {
Scene scene = new Scene(fxmlLoader.load());
jFXPanel.setScene(scene);
webView = sceneInspectorController.webView;
webView.setContextMenuEnabled(false);
} catch (IOException e) {
e.printStackTrace();
}
});
}
示例11: actionPerformed
import com.intellij.ui.content.Content; //导入依赖的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);
}
}
示例12: LogcatExecutionConsole
import com.intellij.ui.content.Content; //导入依赖的package包/类
LogcatExecutionConsole(Project project,
IDevice device,
@NotNull ConsoleView consoleView,
String configurationId) {
myProject = project;
myConsoleView = consoleView;
myConfigurationId = configurationId;
myToolWindowView = new AndroidLogcatView(project, device) {
@Override
protected boolean isActive() {
final XDebugSession session = XDebuggerManager.getInstance(myProject).getDebugSession(LogcatExecutionConsole.this);
if (session == null) {
return false;
}
final Content content = session.getUI().findContent(AndroidDebugRunner.ANDROID_LOGCAT_CONTENT_ID);
return content != null && content.isSelected();
}
};
Disposer.register(this, myToolWindowView);
}
示例13: removeProjectPane
import com.intellij.ui.content.Content; //导入依赖的package包/类
@Override
public synchronized void removeProjectPane(@NotNull AbstractProjectViewPane pane) {
ApplicationManager.getApplication().assertIsDispatchThread();
myUninitializedPanes.remove(pane);
//assume we are completely initialized here
String idToRemove = pane.getId();
if (!myId2Pane.containsKey(idToRemove)) return;
pane.removeTreeChangeListener();
for (int i = myContentManager.getContentCount() - 1; i >= 0; i--) {
Content content = myContentManager.getContent(i);
String id = content != null ? content.getUserData(ID_KEY) : null;
if (id != null && id.equals(idToRemove)) {
myContentManager.removeContent(content, true);
}
}
myId2Pane.remove(idToRemove);
mySelectInTargets.remove(idToRemove);
viewSelectionChanged();
}
示例14: createContent
import com.intellij.ui.content.Content; //导入依赖的package包/类
@Override
@NotNull
public Content createContent(@NotNull final String contentId, @NotNull final ComponentWithActions withActions, @NotNull final String displayName,
@Nullable final Icon icon,
@Nullable final JComponent toFocus) {
final Content content = getContentFactory().createContent(withActions.getComponent(), displayName, false);
content.putUserData(CONTENT_TYPE, contentId);
content.putUserData(ViewImpl.ID, contentId);
content.setIcon(icon);
if (toFocus != null) {
content.setPreferredFocusableComponent(toFocus);
}
if (!withActions.isContentBuiltIn()) {
content.setSearchComponent(withActions.getSearchComponent());
content.setActions(withActions.getToolbarActions(), withActions.getToolbarPlace(), withActions.getToolbarContextComponent());
}
return content;
}
示例15: removeContents
import com.intellij.ui.content.Content; //导入依赖的package包/类
private static void removeContents(@Nullable final Content notToRemove,
@NotNull final Project myProject,
@NotNull final String tabDisplayName) {
MessageView messageView = ServiceManager.getService(myProject, MessageView.class);
Content[] contents = messageView.getContentManager().getContents();
for (Content content : contents) {
LOG.assertTrue(content != null);
if (content.isPinned()) continue;
if (tabDisplayName.equals(content.getDisplayName()) && content != notToRemove) {
ErrorTreeView listErrorView = (ErrorTreeView)content.getComponent();
if (listErrorView != null) {
if (messageView.getContentManager().removeContent(content, true)) {
content.release();
}
}
}
}
}