本文整理汇总了Java中org.jetbrains.plugins.terminal.JBTabbedTerminalWidget类的典型用法代码示例。如果您正苦于以下问题:Java JBTabbedTerminalWidget类的具体用法?Java JBTabbedTerminalWidget怎么用?Java JBTabbedTerminalWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JBTabbedTerminalWidget类属于org.jetbrains.plugins.terminal包,在下文中一共展示了JBTabbedTerminalWidget类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolbarWithActions
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
/**
* Create some actions
*
* @param terminalRunner
* @param terminal
* @param horizontal is horizontal displayed
* @return
*/
private ActionToolbar createToolbarWithActions(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal,
boolean horizontal,
AnAction... actions) {
DefaultActionGroup group = new DefaultActionGroup();
if (terminalRunner != null) {
if (actions != null) {
for (AnAction anAction : actions) {
group.add(anAction);
}
}
//group.addSeparator();
}
return ActionManager.getInstance().createActionToolbar("unknown", group, horizontal);// horizontal
}
示例2: initTerminal
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的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
}
}
}
示例3: createToolbar
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
/**
* 创建左侧工具栏
*
* @param terminalRunner
* @param terminal
* @param toolWindow
* @return
*/
private void createToolbar(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal,
@NotNull ToolWindow toolWindow, @NotNull SimpleToolWindowPanel panel) {
// Termal basis
createAndAddLeftToolbar(terminalRunner, myTerminalWidget, panel,
new NewSession(terminalRunner, terminal),
new CloseSession(terminal, toolWindow),
new StopAction(this),
new ClearAction(this));
// Android
// createAndAddLeftToolbar(terminalRunner, myTerminalWidget, panel,
// new AndroidDevMenuAction(this),
// new AdbForwardAction(this),
// new RunAndroidAction(this),
// new AndroidReleaseApkAction(this),
// new NPMAndroidLogsAction(this));
//
// // NPM
// createAndAddLeftToolbar(terminalRunner, myTerminalWidget, panel,
// new NPMStartAction(this),
// new NPMInstallAction(this));
//
// // iOS
// createAndAddLeftToolbar(terminalRunner, myTerminalWidget, panel,
// new RunLinkAction(this),
// new RunIOSAction(this),
// new NPMiOSLogsAction(this));
//
// // General
// createAndAddLeftToolbar(terminalRunner, myTerminalWidget, panel,
//// new ClearAction(this),
// new DebugUiAction(this));
}
示例4: initTerminal
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的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);
}
}
}
示例5: createToolbar
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
/**
* 创建左侧工具栏
*
* @param terminalRunner
* @param terminal
* @param toolWindow
* @return
*/
private ActionToolbar createToolbar(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal, @NotNull ToolWindow toolWindow) {
DefaultActionGroup group = new DefaultActionGroup();
if (terminalRunner != null) {
group.add(new RunAction(this));
group.add(new StopAction(this));
group.addSeparator();
group.add(new ClearAction(this));
}
return ActionManager.getInstance().createActionToolbar("unknown", group, false);
}
示例6: createTerminalInContentPanel
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的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, "TestTerminal", false);
content.setCloseable(true);
JBTabbedTerminalWidget myTerminalWidget = terminalRunner.createTerminalWidget(content);
panel.setContent(myTerminalWidget.getComponent());
panel.addFocusListener(this);
new Thread(() -> {
try {
// Wait 0.5 second for the terminal to show up, no wait works ok on WebStorm but not on Android Studio
Thread.currentThread().sleep(500L);
} catch (InterruptedException e) {
e.printStackTrace();
}
// Below code without ApplicationManager.getApplication().invokeLater() will throw exception
// : IDEA Access is allowed from event dispatch thread only.
ApplicationManager.getApplication().invokeLater(() -> {
if (myTerminalWidget.getCurrentSession() != null) {
myTerminalWidget.getCurrentSession().getTerminalStarter().sendString("ls\n");
}
});
}).start();
// ApplicationManager.getApplication().invokeLater(() -> {
// if (myTerminalWidget.getCurrentSession() != null) {
// myTerminalWidget.getCurrentSession().getTerminalStarter().sendString("ls\n");
// }
// });
// 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;
}
示例7: getTerminalWidget
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
public JBTabbedTerminalWidget getTerminalWidget() {
ToolWindow window = getToolWindow();
return getTerminalWidget(window);
}
示例8: createTopToolbar
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
/**
* 创建左侧工具栏
*
* @param terminalRunner
* @param terminal
* @param toolWindow
* @return
*/
private ActionToolbar createTopToolbar(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal, @NotNull ToolWindow toolWindow) {
DefaultActionGroup group = new DefaultActionGroup();
if (terminalRunner != null) {
// Termal basis
// group.add(new NewSession(terminalRunner, terminal));
// group.add(new CloseSession(terminal, toolWindow));
// group.add(new StopAction(this));
// group.add(new ClearAction(this));
// group.addSeparator();
group.add(new HelpAction(this));
// Android
group.addSeparator();
group.add(new DevMenuAction(this));
group.add(new AdbForwardAction(this));
group.add(new NPMAndroidLogsAction(this));
group.add(new RunAndroidAction(this));
group.add(new AndroidReleaseApkAction(this));
group.add(new AndroidDebugApkAction(this));
group.add(new AndroidBundleAction(this));
// NPM
group.addSeparator();
group.add(new NPMStartAction(this));
group.add(new NPMInstallAction(this));
if(OSUtils.isMacOSX() || OSUtils.isMacOS()) {// Only show on Mac OS
// iOS
group.addSeparator();
group.add(new RunLinkAction(this));
group.add(new RunIOSAction(this));
group.add(new NPMiOSLogsAction(this));
group.add(new IOSBundleAction(this));
}
// General
group.addSeparator();
group.add(new DebugUiAction(this));
}
return ActionManager.getInstance().createActionToolbar("unknown", group, true);// horizontal: true
}
示例9: hideIfNoActiveSessions
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
private static void hideIfNoActiveSessions(@NotNull ToolWindow toolWindow, @NotNull JBTabbedTerminalWidget terminal) {
if (terminal.isNoActiveSessions()) {
toolWindow.getContentManager().removeAllContents(true);
}
}
示例10: CloseSession
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
public CloseSession(@NotNull JBTabbedTerminalWidget terminal, @NotNull ToolWindow toolWindow) {
super("Close Session", "Close Terminal Session", AllIcons.Actions.Delete);
this.myTerminal = terminal;
this.myToolWindow = toolWindow;
}
示例11: createAndAddLeftToolbar
import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //导入依赖的package包/类
/**
* Create left toolbar
*
* @param terminalRunner
* @param terminal
* @return
*/
private void createAndAddLeftToolbar(@Nullable AbstractTerminalRunner terminalRunner, @NotNull JBTabbedTerminalWidget terminal,
@NotNull SimpleToolWindowPanel panel, AnAction... actions) {
ActionToolbar toolbar = createToolbarWithActions(terminalRunner, myTerminalWidget, false, actions);
toolbar.setTargetComponent(panel);
panel.setToolbar(toolbar.getComponent(), true);
}