當前位置: 首頁>>代碼示例>>Java>>正文


Java JBTabbedTerminalWidget類代碼示例

本文整理匯總了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
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:24,代碼來源:ReactNativeTerminal.java

示例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
        }
    }
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:36,代碼來源:ReactNativeTerminal.java

示例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));
    }
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:42,代碼來源:ReactNativeTerminal.java

示例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);
        }
    }
}
 
開發者ID:typ0520,項目名稱:fastdex,代碼行數:35,代碼來源:FastdexTerminal.java

示例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);
}
 
開發者ID:typ0520,項目名稱:fastdex,代碼行數:19,代碼來源:FastdexTerminal.java

示例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;
    }
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:48,代碼來源:ReactNativeConsole.java

示例7: getTerminalWidget

import org.jetbrains.plugins.terminal.JBTabbedTerminalWidget; //導入依賴的package包/類
public JBTabbedTerminalWidget getTerminalWidget() {
    ToolWindow window = getToolWindow();
    return getTerminalWidget(window);
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:5,代碼來源:ReactNativeTerminal.java

示例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
    }
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:53,代碼來源:ReactNativeTerminal.java

示例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);
    }
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:6,代碼來源:ReactNativeTerminal.java

示例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;
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:6,代碼來源:ReactNativeTerminal.java

示例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);
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:14,代碼來源:ReactNativeTerminal.java


注:本文中的org.jetbrains.plugins.terminal.JBTabbedTerminalWidget類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。