本文整理汇总了Java中com.intellij.ui.content.impl.ContentImpl类的典型用法代码示例。如果您正苦于以下问题:Java ContentImpl类的具体用法?Java ContentImpl怎么用?Java ContentImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentImpl类属于com.intellij.ui.content.impl包,在下文中一共展示了ContentImpl类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCurrentErrorContent
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
private Content createCurrentErrorContent(final ToolWindow toolWindow) {
final Ref<Content> contentRef = new Ref<>();
myCurrentErrorTreeViewPanel = new JSGraphQLErrorTreeViewPanel(myProject, myHelpId, () -> myLastResult = null, myActions) {
public void close() {
toolWindow.hide(() -> {
myLastResult = null;
final Content contentImpl = contentRef.get();
if (contentImpl != null) {
toolWindow.getContentManager().removeContent(contentImpl, true);
}
Content newContentImpl = createCurrentErrorContent(toolWindow);
toolWindow.getContentManager().setSelectedContent(newContentImpl);
});
}
};
Disposer.register(myProject, myCurrentErrorTreeViewPanel);
contentRef.set(new ContentImpl(myCurrentErrorTreeViewPanel, "Current Errors", false));
toolWindow.getContentManager().addContent(contentRef.get(), 0);
return contentRef.get();
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:21,代码来源:JSGraphQLLanguageToolWindowManager.java
示例2: createAllErrorsPanel
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
private void createAllErrorsPanel() {
ApplicationManager.getApplication().assertIsDispatchThread();
if (myProjectErrorTreeViewPanel == null) {
final Ref<Content> contentRef = new Ref<>();
myProjectErrorTreeViewPanel = new JSGraphQLErrorTreeViewPanel(myProject, myHelpId, null, myActions) {
public void close() {
final NewErrorTreeViewPanel oldPanel = myProjectErrorTreeViewPanel;
myProjectErrorTreeViewPanel = null;
myToolWindow.hide(() -> {
Content content = contentRef.get();
if (content != null) {
myToolWindow.getContentManager().removeContent(content, true);
}
if (oldPanel != null) {
Disposer.dispose(oldPanel);
}
});
}
};
Disposer.register(myProject, myProjectErrorTreeViewPanel);
contentRef.set(new ContentImpl(myProjectErrorTreeViewPanel, "Project Errors", false));
myToolWindow.getContentManager().addContent(contentRef.get());
}
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:26,代码来源:JSGraphQLLanguageToolWindowManager.java
示例3: createConsoleContent
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
private Content createConsoleContent(final ConsoleView console, final String title, final String description) {
final Content content = new ContentImpl(createConsolePanel(console), description, true);
content.setTabName(title);
content.setDisplayName(title);
content.setIcon(HybrisIcons.HYBRIS_ICON);
return content;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:ConsoleToolWindowUtil.java
示例4: activateConsoleToolWindow
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的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
示例5: IdeaMantisConfigurable
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
public IdeaMantisConfigurable(@NotNull Project project) {
this.settings = ConnectionSettings.getInstance(project);
this.manager = ToolWindowManager.getInstance(project);
this.task = new Task.Backgroundable(project, "Load Data...") {
@Override
public void run(@NotNull ProgressIndicator progressIndicator) {
try {
settings.setHostName(txtHostName.getText());
settings.setUserName(txtUserName.getText());
StringBuilder buf = new StringBuilder();
for(char ch : txtPassword.getPassword()) {
buf.append(ch);
}
settings.setPassword(buf.toString());
int itemsPerPage;
try {
itemsPerPage = Integer.parseInt(txtIssuesPerPage.getText());
} catch (Exception ex) {
itemsPerPage = -1;
}
settings.setItemsPerPage(itemsPerPage);
settings.setProjectID(projectID);
ApplicationManager.getApplication().invokeLater(()->{
ToolWindow window = manager.getToolWindow("Show MantisBT-Issues");
ContentImpl content = new ContentImpl(null, "", true);
content.setDescription("reload comboBoxes");
window.getContentManager().addContent(content);
});
settings.setFastTrack(chkFastTrackEnabled.isSelected());
} catch (Exception ex) {
Helper.printException(ex);
} finally {
component.setCursor(Cursor.getDefaultCursor());
}
}
};
}
开发者ID:domjos1994,项目名称:ideaMantis,代码行数:38,代码来源:IdeaMantisConfigurable.java
示例6: createToolWindowContent
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
toolWindow.setTitle(myExternalSystemId.getReadableName());
ContentManager contentManager = toolWindow.getContentManager();
final ExternalProjectsViewImpl projectsView = new ExternalProjectsViewImpl(project, (ToolWindowEx)toolWindow, myExternalSystemId);
ExternalProjectsManager.getInstance(project).registerView(projectsView);
ContentImpl tasksContent = new ContentImpl(projectsView, ExternalSystemBundle.message("tool.window.title.projects"), true);
contentManager.addContent(tasksContent);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AbstractExternalSystemToolWindowFactory.java
示例7: connectToProcessHandler
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
public synchronized void connectToProcessHandler(ProcessHandler handler) {
init();
if (myCurrentErrorTreeViewPanel != null) {
myCurrentErrorTreeViewPanel.getErrorViewStructure().clear();
}
ApplicationManager.getApplication().assertIsDispatchThread();
if (myToolWindow != null) {
myConsoleView = new ConsoleViewImpl(myProject, GlobalSearchScope.allScope(myProject), true, false) {
};
myConsoleView.attachToProcess(handler);
myConsoleContent = new ContentImpl(myConsoleView.getComponent(), "Console", false);
myToolWindow.getContentManager().addContent(myConsoleContent);
}
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:15,代码来源:JSGraphQLLanguageToolWindowManager.java
示例8: processConsole
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
private static void processConsole(Project project, ProcessHandler processHandler) {
ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
consoleView.clear();
consoleView.attachToProcess(processHandler);
processHandler.startNotify();
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow;
toolWindow = toolWindowManager.getToolWindow(TOOL_ID);
// if already exist tool window then show it
if (toolWindow != null) {
toolWindow.show(null);// TODO add more tabs here?
return;
}
toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
toolWindow.setTitle("Android....");
toolWindow.setStripeTitle("Android Console");
toolWindow.setShowStripeButton(true);
toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);
JPanel panel = new JPanel((LayoutManager) new BorderLayout());
panel.add((Component) consoleView.getComponent(), "Center");
// Create toolbars
DefaultActionGroup toolbarActions = new DefaultActionGroup();
AnAction[]
consoleActions = consoleView.createConsoleActions();// 必须在 consoleView.getComponent() 调用后组件真正初始化之后调用
toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", processHandler));
// toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add((Component) toolbar.getComponent(), "West");
ContentImpl consoleContent = new ContentImpl(panel, "Build", false);
consoleContent.setManager(toolWindow.getContentManager());
toolbarActions.add(new CloseTabAction(consoleContent));
// addAdditionalConsoleEditorActions(consoleView, consoleContent);
// consoleComponent.setActions();
toolWindow.getContentManager().addContent(consoleContent);
toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));
toolWindow.show(null);
}
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:50,代码来源:RNUtil.java
示例9: createContent
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
@NotNull
@Override
public ContentImpl createContent(JComponent component, String displayName, boolean isLockable) {
return new ContentImpl(component, displayName, isLockable);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ContentFactoryImpl.java
示例10: add
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
/**
* @param component component to add to window
*/
void add(@NotNull final JComponent component) {
myContentManager.addContent(new ContentImpl(component, "", true));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ToolWindowApi.java
示例11: activateConsoleToolWindow
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的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
示例12: createToolWindowResultEditor
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
private void createToolWindowResultEditor(ToolWindow toolWindow) {
final LightVirtualFile virtualFile = new LightVirtualFile("GraphQL.result.json", JsonFileType.INSTANCE, "");
fileEditor = PsiAwareTextEditorProvider.getInstance().createEditor(myProject, virtualFile);
if(fileEditor instanceof TextEditor) {
final Editor editor = ((TextEditor) fileEditor).getEditor();
final EditorEx editorEx = (EditorEx)editor;
// set read-only mode
editorEx.setViewer(true);
editorEx.getSettings().setShowIntentionBulb(false);
editor.getSettings().setAdditionalLinesCount(0);
editor.getSettings().setCaretRowShown(false);
editor.getSettings().setBlinkCaret(false);
// query result header
final JSGraphQLEditorHeaderComponent header = new JSGraphQLEditorHeaderComponent();
querySuccessLabel = new JBLabel();
querySuccessLabel.setVisible(false);
querySuccessLabel.setIconTextGap(0);
header.add(querySuccessLabel, BorderLayout.WEST);
queryResultLabel = new JBLabel("", null, SwingConstants.LEFT);
queryResultLabel.setBorder(new EmptyBorder(4, 6, 4, 6));
queryResultLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
queryResultLabel.setVisible(false);
queryResultLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
final String fileUrl = (String)queryResultLabel.getClientProperty(FILE_URL_PROPERTY);
if(fileUrl != null) {
final VirtualFile queryFile = VirtualFileManager.getInstance().findFileByUrl(fileUrl);
if(queryFile != null) {
final FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
fileEditorManager.openFile(queryFile, true, true);
}
}
}
});
header.add(queryResultLabel, BorderLayout.CENTER);
// finally set the header as permanent such that it's restored after searches
editor.setHeaderComponent(header);
editorEx.setPermanentHeaderComponent(header);
}
Disposer.register(this, fileEditor);
final ContentImpl content = new ContentImpl(fileEditor.getComponent(), "Query result", true);
content.setCloseable(false);
toolWindow.getContentManager().addContent(content);
}
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:58,代码来源:JSGraphQLLanguageUIProjectService.java
示例13: createContent
import com.intellij.ui.content.impl.ContentImpl; //导入依赖的package包/类
@Nonnull
@Override
public ContentImpl createContent(javax.swing.JComponent component, String displayName, boolean isLockable) {
return new ContentImpl(component, displayName, isLockable);
}
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:ContentFactoryImpl.java
注:本文中的com.intellij.ui.content.impl.ContentImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论