本文整理匯總了Java中com.jediterm.terminal.ui.TabbedTerminalWidget類的典型用法代碼示例。如果您正苦於以下問題:Java TabbedTerminalWidget類的具體用法?Java TabbedTerminalWidget怎麽用?Java TabbedTerminalWidget使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TabbedTerminalWidget類屬於com.jediterm.terminal.ui包,在下文中一共展示了TabbedTerminalWidget類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createTerminalInContentPanel
import com.jediterm.terminal.ui.TabbedTerminalWidget; //導入依賴的package包/類
private Content createTerminalInContentPanel(@NotNull AbstractTerminalRunner terminalRunner,
final @NotNull ToolWindow toolWindow) {
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
final Content content = ContentFactory.SERVICE.getInstance().createContent(panel, "", false);
content.setCloseable(true);
myTerminalWidget = terminalRunner.createTerminalWidget(content);
myTerminalWidget.addTabListener(new TabbedTerminalWidget.TabListener() {
@Override
public void tabClosed(JediTermWidget terminal) {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
if (myTerminalWidget != null) {
hideIfNoActiveSessions(toolWindow, myTerminalWidget);
}
}
});
}
});
panel.setContent(myTerminalWidget.getComponent());
panel.addFocusListener(createFocusListener());
ActionToolbar toolbar = createToolbar(terminalRunner, myTerminalWidget, toolWindow);
toolbar.getComponent().addFocusListener(createFocusListener());
toolbar.setTargetComponent(panel);
panel.setToolbar(toolbar.getComponent());
content.setPreferredFocusableComponent(myTerminalWidget.getComponent());
return content;
}
示例2: createTerminalInContentPanel
import com.jediterm.terminal.ui.TabbedTerminalWidget; //導入依賴的package包/類
private Content createTerminalInContentPanel(@Nullable LocalTerminalDirectRunner terminalRunner,
final @NotNull ToolWindow toolWindow)
{
SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true)
{
@Override
public Object getData(@NotNull Key<?> dataId)
{
return PlatformDataKeys.HELP_ID == dataId ? EventLog.HELP_ID : super.getData(dataId);
}
};
final Content content = ContentFactory.getInstance().createContent(panel, "", false);
content.setCloseable(true);
myTerminalWidget = terminalRunner.createTerminalWidget(content);
myTerminalWidget.addTabListener(new TabbedTerminalWidget.TabListener()
{
@Override
public void tabClosed(JediTermWidget terminal)
{
UIUtil.invokeLaterIfNeeded(new Runnable()
{
@Override
public void run()
{
if(myTerminalWidget != null)
{
hideIfNoActiveSessions(toolWindow, myTerminalWidget);
}
}
});
}
});
panel.setContent(myTerminalWidget.getComponent());
panel.addFocusListener(createFocusListener());
ActionToolbar toolbar = createToolbar(terminalRunner, myTerminalWidget, toolWindow);
toolbar.getComponent().addFocusListener(createFocusListener());
toolbar.setTargetComponent(panel);
panel.setToolbar(toolbar.getComponent());
content.setPreferredFocusableComponent(myTerminalWidget.getComponent());
return content;
}