本文整理匯總了Java中com.intellij.openapi.wm.ToolWindow.setToHideOnEmptyContent方法的典型用法代碼示例。如果您正苦於以下問題:Java ToolWindow.setToHideOnEmptyContent方法的具體用法?Java ToolWindow.setToHideOnEmptyContent怎麽用?Java ToolWindow.setToHideOnEmptyContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.wm.ToolWindow
的用法示例。
在下文中一共展示了ToolWindow.setToHideOnEmptyContent方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doInit
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private void doInit(@NotNull final ToolWindow toolWindow) {
myInitialized = true;
toolWindow.setToHideOnEmptyContent(true);
((ToolWindowManagerEx)ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = getToolWindow();
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
PydevConsoleRunner runner = PythonConsoleRunnerFactory.getInstance().createConsoleRunner(myProject, null);
runner.run();
}
}
}
});
}
示例2: initTerminal
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
public void initTerminal(final ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setStripeTitle("RN Console");
toolWindow.setIcon(PluginIcons.React);
Content content = createConsoleTabContent(toolWindow, true, "Welcome", null);
// toolWindow.getContentManager().addContent(content);
// toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));
// ======= test a terminal create ======
// LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
// Content testTerminalContent = createTerminalInContentPanel(terminalRunner, toolWindow);
// toolWindow.getContentManager().addContent(testTerminalContent);
// SimpleTerminal term = new SimpleTerminal();
// term.sendString("ls\n");
// toolWindow.getContentManager().addContent(new ContentImpl(term.getComponent(), "terminal", false));
toolWindow.setShowStripeButton(true);// if set to false, then sometimes the window will be hidden from the dock area for ever 2017-05-26
// toolWindow.setTitle(" - ");
((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
toolWindow.show(null);
}
示例3: initTerminal
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
public void initTerminal(final ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
myTerminalRunner = terminalRunner;
toolWindow.setStripeTitle("React Native");
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
toolWindow.setShowStripeButton(true);
toolWindow.setTitle("Console");
((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
toolWindow.show(null);
JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
if (terminal != null) {
terminal.setCursorVisible(true);// 是否啟用光標 BeanSoft
}
}
}
示例4: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
instance = this;
this.project = project;
toolWindow.setToHideOnEmptyContent(true);
createContents(project, toolWindow);
ToolWindowManager manager = ToolWindowManager.getInstance(project);
if (manager instanceof ToolWindowManagerEx) {
ToolWindowManagerEx managerEx = ((ToolWindowManagerEx) manager);
managerEx.addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
createContents(project, window);
}
}
}
});
}
// Disposer.register(project, new Disposable() {
// @Override
// public void dispose() {
// if (panel != null && panel.isEnabled()) {
// panel.setEnabled(false);
// panel = null;
// }
// }
// });
}
示例5: initTerminal
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
public void initTerminal(final ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
toolWindow.setStripeTitle("Fastdex");
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
toolWindow.setShowStripeButton(true);
toolWindow.setTitle("Console");
((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String s) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(FastdexToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
toolWindow.show(null);
JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
if (terminal != null) {
terminal.setCursorVisible(false);
}
}
}
示例6: createApiDebuggerContentPanel
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private Content createApiDebuggerContentPanel(ToolWindow toolWindow) {
toolWindow.setToHideOnEmptyContent(true);
DebuggerToolWindowPanel panel = new DebuggerToolWindowPanel(PropertiesComponent.getInstance(mProject), toolWindow);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false);
ITabbedDebuggerWidget debuggerWidget = createContent(content);
ActionToolbar toolBar = createToolBar(debuggerWidget);
panel.setToolbar(toolBar.getComponent());
panel.setContent(debuggerWidget.getComponent());
return content;
}
示例7: UsageViewManagerImpl
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
public UsageViewManagerImpl(final Project project, final ToolWindowManager toolWindowManager) {
ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.FIND, true, ToolWindowAnchor.BOTTOM, project, true);
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowFind);
myFindContentManager = toolWindow.getContentManager();
myFindContentManager.addContentManagerListener(new ContentManagerAdapter() {
@Override
public void contentRemoved(ContentManagerEvent event) {
event.getContent().release();
}
});
new ContentManagerWatcher(toolWindow, myFindContentManager);
}
示例8: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
toolWindow.setAvailable(true, null);
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setTitle(myFramework.getDisplayName());
MvcProjectViewPane view = new MvcProjectViewPane(project, this);
view.setup((ToolWindowEx)toolWindow);
}
示例9: createToolWindowContent
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
final File adb = AndroidSdkUtils.getAdb(project);
ExecutionManager.getInstance(project).getContentManager();
RunnerLayoutUi layoutUi = RunnerLayoutUi.Factory.getInstance(project).create("LogViewer", TOOL_WINDOW_ID, "Logview Tools", project);
toolWindow.setIcon(LogviewerPluginIcons.TOOL_ICON);
toolWindow.setAvailable(true, null);
toolWindow.setToHideOnEmptyContent(true);
toolWindow.setTitle(TOOL_WINDOW_ID);
DeviceContext deviceContext = new DeviceContext();
Content logcatContent = createLogcatContent(layoutUi, project, deviceContext);
final LogView logcatView = logcatContent.getUserData(LOG_VIEW_KEY);
layoutUi.addContent(logcatContent, 0, PlaceInGrid.center, false);
final JBLoadingPanel loadingPanel = new JBLoadingPanel(new BorderLayout(), project);
loadingPanel.add(layoutUi.getComponent(), BorderLayout.CENTER);
final ContentManager contentManager = toolWindow.getContentManager();
Content c = contentManager.getFactory().createContent(loadingPanel, "", true);
c.putUserData(LOG_VIEW_KEY, logcatView);
contentManager.addContent(c);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
logcatView.activate();
}
}, project.getDisposed());
if (adb != null) {
loadingPanel.setLoadingText("Initializing ADB");
loadingPanel.startLoading();
ListenableFuture<AndroidDebugBridge> future = AdbService.getInstance().getDebugBridge(adb);
Futures.addCallback(future, new FutureCallback<AndroidDebugBridge>() {
@Override
public void onSuccess(@Nullable AndroidDebugBridge bridge) {
Logger.getInstance(LogviewFactory.class).info("Successfully obtained debug bridge");
loadingPanel.stopLoading();
}
@Override
public void onFailure(@NotNull Throwable t) {
loadingPanel.stopLoading();
Logger.getInstance(LogviewFactory.class).info("Unable to obtain debug bridge", t);
String msg;
if (t.getMessage() != null) {
msg = t.getMessage();
} else {
msg = String.format("Unable to establish a connection to adb",
ApplicationNamesInfo.getInstance().getProductName(), adb.getAbsolutePath());
}
Messages.showErrorDialog(msg, "ADB Connection Error");
}
}, EdtExecutor.INSTANCE);
} else {
logcatView.showHint("No adb connection!.\n\nDrag and drop log files to view them.");
}
}
示例10: initTerminal
import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
public void initTerminal(final ToolWindow toolWindow) {
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
toolWindow.setToHideOnEmptyContent(true);
if (terminalRunner != null) {
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
((ToolWindowManagerEx)ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TerminalToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
Disposer.register(myProject, new Disposable() {
@Override
public void dispose() {
if (myTerminalWidget != null) {
myTerminalWidget.dispose();
myTerminalWidget = null;
}
}
});
}
if (myDockContainer == null) {
myDockContainer = new TerminalDockContainer(toolWindow);
Disposer.register(myProject, myDockContainer);
DockManager.getInstance(myProject).register(myDockContainer);
}
}