Eclipse HotKey:如何在选项卡之间切换?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2332330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:13:44  来源:igfitidea点击:

Eclipse HotKey: how to switch between tabs?

eclipsetabshotkeys

提问by Skay

How can I switch between opened windows in Eclipse? There is Ctrl+F6, but it's asking me which one I want, but I want switch it like tabs in browser or window in operating system (Cmd/Win+Tab) without file-selection from the list. How to do this easy thing in Eclipse?

如何在 Eclipse 中打开的窗口之间切换?有Ctrl+ F6,但它问我想要哪个,但我想像浏览器中的选项卡或操作系统(Cmd/ Win+ Tab)中的窗口一样切换它,而无需从列表中选择文件。如何在 Eclipse 中做这件简单的事情?

I've tried to assign hotkey for events:

我试图为事件分配热键:

  • forward
  • forward history
  • next page
  • 向前
  • 前进历史
  • 下一页

but it doesn't work the way I want.

但它不像我想要的那样工作。

回答by VonC

  • CTRL+E(for a list of editor)
  • CTRL+F6(for switching to the next editor through a list)
    You can assign another shortcut to the 'Next Editor' key.
  • CTRL+ E(用于编辑器列表)
  • CTRL+ F6(用于通过列表切换到下一个编辑器)
    您可以为“下一个编辑器”键分配另一个快捷方式。

are the two official shortcuts, but they both involve a list being displayed.

是两个官方快捷方式,但它们都涉及正在显示的列表。

CTRL+Page Up/ CTRL+Page Downcan cycle through editors without displaying a list.

CTRL+ Page Up/ CTRL+Page Down可以在不显示列表的情况下循环浏览编辑器。

What is interesting with that last set of shortcuts is:
they are not listed in the Eclipse Keys shortcuts to be defined.
They may be inherited from the multipage editor, making them an OS specific shortcut.

最后一组快捷方式的有趣之处在于:
它们没有列在要定义的 Eclipse Keys 快捷方式中。
它们可以从多页编辑器继承,使它们成为操作系统特定的快捷方式



Regarding shortcuts on Mac OS (OSX), Matt Ballcomplained in Sept. 2011 to not being able to remap CTRL+Page Up/CTRL+Page Down:

关于 Mac OS (OSX) 上的快捷方式,Matt Ball在 2011 年 9 月抱怨无法重新映射CTRL+ Page Up/ CTRL+ Page Down

It drives me nuts to not be able to flip through open tabs as I can in pretty much every other tabbed program in OS X (?-Leftand ?-Right).

它让我发疯,因为我无法像在 OS X 中的几乎所有其他选项卡式程序(?-Left?- Right)中那样翻阅打开的选项卡。

Well, in March 2012, Arthurreplied:

好吧,在 2012 年 3 月,亚瑟回答说:

, I've just downloaded the latest version of Eclipse (3.7+). I've been able to bind "Previous/Next tab" to (?-Leftand ?-Right) when in Editor, which I'm pretty sure I couldn't do before.
So I guess they heard you.
It works just as you expect, tabs going from left to right and vice-versa, not on a history basis or some nonsense like that.

,我刚刚下载了最新版本的 Eclipse (3.7+)。在编辑器中时,我已经能够将“上一个/下一个选项卡”绑定到(?-Left?- Right),我很确定我以前无法做到这一点。
所以我猜他们听到了你的声音。
它按您的预期工作,标签从左到右,反之亦然,而不是基于历史或类似的废话。

Matt Ballconfirms:

马特鲍尔确认:

oh wow, selecting "Editing Java Source" actually worked!
Now, unfortunately this means that I'm SOL if I nav into a non-Java file (JSP, XML, JS, etc.).
The fix for this is to "copy command" for this pair, and select all the "whens" that I want.
So far it's at least working beautifully for Java and JSP files.
This is a major PITA to set up, but it's just a one-time thing.

哦,哇,选择“编辑 Java 源代码”确实有效
现在,不幸的是,这意味着如果我导航到非 Java 文件(JSP、XML、JS 等),我就是 SOL。
对此的解决方法是为此对“复制命令”,并选择我想要的所有“时间”
到目前为止,它至少对 Java 和 JSP 文件工作得很好。
这是一个主要的 PITA 设置,但这只是一次性的事情。

His exported preferences are available herefor you to try.
Once imported, you should see, for all the relevant types of document:

导出的首选项可在此处获得,供您试用。
导入后,您应该会看到所有相关类型的文档:

Mac Os key bindings

Mac Os 键绑定

回答by victor

If you go to Preferences (e.g. Window→Preferences) and view General→Keys

如果您转到首选项(例如窗口→首选项)并查看常规→键

and then search for “Next Tab” and “Previous Tab”, you can remap them.

然后搜索“下一个标签”和“上一个标签”,您可以重新映射它们。

Next Tab command in Eclipse Preferences, before rebinding

Eclipse 首选项中的 Next Tab 命令,在重新绑定之前

回答by Robino

Switch like Windows in OS (go to window which last had focus)

像操作系统中的 Windows 一样切换(转到最后具有焦点的窗口

CTRL-F6in Eclipse, like ALT-TAB(on windows), brings up a list of tabs/windows available (if you keep the CTRL/ ALTkey depressed) and highlights the one you will jump to when you let go of this key. You do not have to select the window. If you want to traverse several tabs at once hold down the CTRLbutton and tap the TABbutton. This is identical behaviour to ALT-TABon Windows.

CTRL-F6在 Eclipse 中,例如ALT-TAB(在 Windows 上),会显示可用的选项卡/窗口列表(如果您按住CTRL/ALT键)并突出显示当您松开该键时将跳转到的那个。您不必选择窗口。如果您想一次遍历多个选项卡,请按住CTRL按钮并点击TAB按钮。这与ALT-TAB在 Windows 上的行为相同。

In this sense, CTRL-SHIFT-F6in eclipse is the ALT-SHIFT-TABanalog. Personally, I change these bindings in Eclipse to be like Visual Studio. I.e. CTRL-TABand CTRL-SHIFT-TABand I do it like this:

从这个意义上说,CTRL- SHIFT-F6在 eclipse 中是ALT- SHIFT-TAB类比。就个人而言,我将 Eclipse 中的这些绑定更改为类似于 Visual Studio。即CTRL-TABCTRL- SHIFT-TAB我这样做:

Window>Preferences>General>Keys

窗口>首选项>常规>键

Then set "Next Editor"=Ctrl+Taband "Previous Editor"=Ctrl+Shift+Tab. Don't forget to click "Unbind Command" before setting the new binding.

然后设置“下一个编辑器”= Ctrl+Tab和“上一个编辑器”= Ctrl+ Shift+Tab。在设置新绑定之前,不要忘记单击“取消绑定命令”。

Switch like browser (go to tab on the right of current tab)

像浏览器一样切换(转到当前选项卡右侧的选项卡

This is CTRL-PageDownto go right, CTRL-PageUpto go left. Frustratingly, when you get to the end of the list of tabs (say far right hand tab) and then try to go right again Eclipse does not cycle round to the first tab (far left) like most browsers would.

这是CTRL-PageDown向右走,CTRL-PageUp向左走。令人沮丧的是,当您到达选项卡列表的末尾(比如最右侧的选项卡)然后尝试再次向右移动时,Eclipse 不会像大多数浏览器那样循环到第一个选项卡(最左侧)。

回答by peirix

You can use ALT+Leftto go to your previous tab, or ALT+Rightto go to forward. This method is using tab-switching like history, though, so it will go to the previous tab you had open, and forward if you've gone "back" once or more. A bit weird, I know, but it works. You can always "reset" the history by clicking through every tab once.

您可以使用ALT+Left转到上一个选项卡,或使用ALT+Right前进。但是,此方法使用类似于历史记录的选项卡切换,因此它会转到您打开的上一个选项卡,如果您已经“返回”一次或多次,则前进。有点奇怪,我知道,但它有效。您始终可以通过单击每个选项卡一次来“重置”历史记录。

回答by Jubin Patel

  • Rightside move : Ctrl+ page Down
  • Leftside move : CTRL+ page Up
  • Right侧移:Ctrl+page Down
  • Left侧移:CTRL+page Up

Additional

额外的

  • get list of open tabs : Ctrl+ F6
  • 获取打开的标签列表:Ctrl+F6

Eclipse others Short Cuts

Eclipse 其他快捷方式

回答by fastcodejava

CTRL+ F6is good to use. If you want to switch to next/previous tab, you need to do CTRL+Page Down/ CTRL+Page Up.

CTRL+F6很好用。如果要切换到下一个/上一个选项卡,则需要执行CTRL+ Page Down/ CTRL+ Page Up

回答by asgs

The default is Ctrl+ F6. You can change it by going to Window preferences. I usually change it to Ctrl+ Tab, the same we use in switching tabs in a browser and other stuff.

默认值为Ctrl+ F6。您可以通过转到Window 首选项来更改它。我通常将其更改为Ctrl+ Tab,这与我们在浏览器和其他东西中切换标签页时使用的相同。

回答by Chetan Bhagat

Custom KeyBinding sequence example : CTRL + TAB to switch between visilble Modules or Editors Forwarddirection using Eclipse RCP.

自定义CTRL + TAB 键绑定序列示例:使用 Eclipse RCP在可见模块或编辑器前向方向之间切换。

you press CTRL + TAB second time to open another editor and close previous editor using RCP Eclipse.

CTRL + TAB 第二次按下以打开另一个编辑器并使用 RCP Eclipse 关闭上一个编辑器。

package rcp_demo.Toolbar;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import rcp_demo.Editor.EmployeeEditor;
import rcp_demo.Editor.EmployeeEditorInput;
import rcp_demo.Editor.ProductEditor;
import rcp_demo.Editor.ProductEditorInput;
import rcp_demo.Editor.UserEditor;
import rcp_demo.Editor.UserEditorInput;

public class Forward_Editor extends AbstractHandler{

    static String Editor_name;  //  Active Editor name store in Temporary 
    static int cnt;             //  close editor count this variable
    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {

        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        IWorkbenchPage page = window.getActivePage();

        UserEditorInput std_input = new UserEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        ProductEditorInput product_input=new ProductEditorInput();

        IEditorReference[] editors = page.getEditorReferences();

        //Blank Editor Window to execute..
        if(editors.length==0)
        {
            //First time close editor can open Student_Editor
            if(cnt==1 && Editor_name.equals("Student_Editor"))
            {
                try {
                    page.openEditor(emp_input, EmployeeEditor.Id);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }       
            }
            //First time close editor can open Employee_Editor
            else if(cnt==1 && Editor_name.equals("Employee_Editor"))
            {
                try {
                    page.openEditor(product_input,ProductEditor.ID);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name); 
                } catch (PartInitException e) {e.printStackTrace();
                }
            }
            //First time close editor can open Product_Editor
            else if(cnt==1 && Editor_name.equals("Product_Editor"))
            {
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    System.out.println("student Editor open");
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("Close::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
            //First Time call // empty editors 
            else{
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    System.out.println("student Editor open");
                    Editor_name=page.getActiveEditor().getTitle();
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }//End if condition

        //AvtiveEditor(Student_Editor) close to open Employee Editor
        else if(page.getActiveEditor().getTitle().equals("Student_Editor"))
        {
            try {
                //page.closeAllEditors(true);
                page.closeEditor(page.getActiveEditor(), true);
                page.openEditor(emp_input, EmployeeEditor.Id);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Employee_Editor) close to open Product Editor
        else if(page.getActiveEditor().getTitle().equals("Employee_Editor"))
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);

                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name);

            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Product_Editor) close to open Student Editor
        else if(page.getActiveEditor().getTitle().equals("Product_Editor"))
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("stud>>Len:: "+editors.length+"..EDi::"+Editor_name);
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //by default open Student Editor
        else 
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("stud_else>>Len:: "+editors.length+"..EDi::"+Editor_name);
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}

>Custom KeyBinding sequence example : <kbd> SHIFT + TAB </kbd> to switch between visilble Modules or Editors **Backword** direction using Eclipse RCP.


package rcp_demo.Toolbar;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import rcp_demo.Editor.EmployeeEditor;
import rcp_demo.Editor.EmployeeEditorInput;
import rcp_demo.Editor.ProductEditor;
import rcp_demo.Editor.ProductEditorInput;
import rcp_demo.Editor.UserEditor;
import rcp_demo.Editor.UserEditorInput;

public class Backword_Editor extends AbstractHandler{

    static String Editor_name;   // Active Editor name store in Temporary 
    static int cnt;

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {

        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        IWorkbenchPage page = window.getActivePage();
        //Three object create in EditorInput 
        UserEditorInput std_input = new UserEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        ProductEditorInput product_input=new ProductEditorInput();

        IEditorReference[] editors = page.getEditorReferences();
        System.out.println("Length : "+editors.length);

        if(editors.length==0)
        {
            //First time close editor can open Student_Editor
            if(cnt==1 && Editor_name.equals("Product_Editor"))
            {
                try {
                    page.openEditor(emp_input, EmployeeEditor.Id);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }               
            }
            //First time close editor can open Employee_Editor
            else if(cnt==1 && Editor_name.equals("Employee_Editor"))
            {
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("Student>>Len:: "+editors.length+"..student::"+Editor_name);

                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
            //First time close editor can open Product_Editor
            else if(cnt==1 && Editor_name.equals("Student_Editor"))
            {
                        try {
                            page.openEditor(product_input,ProductEditor.ID);
                            cnt=1;
                            Editor_name=page.getActiveEditor().getTitle();
                            System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name);

                        } catch (PartInitException e) {
                            e.printStackTrace();
                        }
            } 
            //First Time or empty editors to check this condition
            else{
                try {
                    page.openEditor(product_input,ProductEditor.ID);
                    System.out.println("product Editor open");
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }
        //AvtiveEditor(Product_Editor) close to open Employee Editor
        else if(page.getActiveEditor().getTitle().equals("Product_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(emp_input, EmployeeEditor.Id);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("Employee Editor open");
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Employee_Editor) close to open Student Editor
        else if(page.getActiveEditor().getTitle().equals("Employee_Editor"))
        {
            System.out.println("Emp:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("student Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Student_Editor) close to open Product Editor
        else if(page.getActiveEditor().getTitle().equals("Student_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //by default open Student Editor
        else 
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return null;
    }
}

Custom KeyBinding sequence example : SHIFT + TAB to switch between visilble Modules or Editors Backworddirection using Eclipse RCP.

自定义 KeyBinding 序列示例:使用 Eclipse RCPSHIFT + TAB 在可见模块或编辑器Backword方向之间切换。

package rcp_demo.Toolbar;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import rcp_demo.Editor.EmployeeEditor;
import rcp_demo.Editor.EmployeeEditorInput;
import rcp_demo.Editor.ProductEditor;
import rcp_demo.Editor.ProductEditorInput;
import rcp_demo.Editor.UserEditor;
import rcp_demo.Editor.UserEditorInput;

public class Backword_Editor extends AbstractHandler{

    static String Editor_name;   // Active Editor name store in Temporary 
    static int cnt;

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {

        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        IWorkbenchPage page = window.getActivePage();
        //Three object create in EditorInput 
        UserEditorInput std_input = new UserEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        ProductEditorInput product_input=new ProductEditorInput();

        IEditorReference[] editors = page.getEditorReferences();
        System.out.println("Length : "+editors.length);

        if(editors.length==0)
        {
            //First time close editor can open Student_Editor
            if(cnt==1 && Editor_name.equals("Product_Editor"))
            {
                try {
                    page.openEditor(emp_input, EmployeeEditor.Id);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("EMP>>Len:: "+editors.length+"..EDi::"+Editor_name);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }               
            }
            //First time close editor can open Employee_Editor
            else if(cnt==1 && Editor_name.equals("Employee_Editor"))
            {
                try {
                    page.openEditor(std_input, UserEditor.ID);
                    cnt=1;
                    Editor_name=page.getActiveEditor().getTitle();
                    System.out.println("Student>>Len:: "+editors.length+"..student::"+Editor_name);

                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
            //First time close editor can open Product_Editor
            else if(cnt==1 && Editor_name.equals("Student_Editor"))
            {
                        try {
                            page.openEditor(product_input,ProductEditor.ID);
                            cnt=1;
                            Editor_name=page.getActiveEditor().getTitle();
                            System.out.println("PRO>>Len:: "+editors.length+"..EDi::"+Editor_name);

                        } catch (PartInitException e) {
                            e.printStackTrace();
                        }
            } 
            //First Time or empty editors to check this condition
            else{
                try {
                    page.openEditor(product_input,ProductEditor.ID);
                    System.out.println("product Editor open");
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }
        //AvtiveEditor(Product_Editor) close to open Employee Editor
        else if(page.getActiveEditor().getTitle().equals("Product_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(emp_input, EmployeeEditor.Id);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("Employee Editor open");
            } catch (PartInitException e) {
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Employee_Editor) close to open Student Editor
        else if(page.getActiveEditor().getTitle().equals("Employee_Editor"))
        {
            System.out.println("Emp:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(std_input, UserEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("student Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //AvtiveEditor(Student_Editor) close to open Product Editor
        else if(page.getActiveEditor().getTitle().equals("Student_Editor"))
        {
            System.out.println("Product:: "+page.getActiveEditor().getTitle());
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        //by default open Student Editor
        else 
        {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                cnt=1;
                Editor_name=page.getActiveEditor().getTitle();
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return null;
    }
}

Key Sequence

按键顺序

M1 means CTRL

M1 表示 CTRL

M2 means SHIFT

M2 表示 SHIFT

plugin.xml

插件文件



<extension point="org.eclipse.ui.commands">
        <command
                defaultHandler="rcp_demo.Toolbar.Forward_Editor"
                id="RCP_Demo.Toolbar.Forward_editor_open_cmd"
                name="Forward_Editor">
        </command>
        <command
                defaultHandler="rcp_demo.Toolbar.Backword_Editor"
                id="RCP_Demo.Toolbar.backwards_editor_open_cmd"
                name="Backword_Editor">
        </command>
    </extension>
<extension point="org.eclipse.ui.bindings">
        <key
                commandId="RCP_Demo.Toolbar.Forward_editor_open_cmd"
                schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
                sequence="M1+TAB">
        </key>  
        <key
                commandId="RCP_Demo.Toolbar.backwards_editor_open_cmd"
                schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
                sequence="M2+TAB">
        </key>              
</extension>

回答by Zook

3 line AutoHotKey script (on Windows, anyway):

3 行 AutoHotKey 脚本(无论如何在 Windows 上):

#IfWinActive ahk_class SWT_Window0
^+Tab::^PgUp
^Tab::^PgDn

Put this in your startup folder (save it as *.ahk, must have AutoHotKey installed) and Eclipse tabs will now work like Chrome or Firefox.

将它放在您的启动文件夹中(另存为 *.ahk,必须安装 AutoHotKey),Eclipse 选项卡现在可以像 Chrome 或 Firefox 一样工作。

回答by borisdiakur

Nobody will ever read my answer, but anyway... If you are on Mac OS X you will love multi touch gestures for history navigation in Eclipse: http://sourceforge.net/apps/mediawiki/eclipsemultitch/

没有人会读我的答案,但无论如何......如果你在 Mac OS X 上,你会喜欢 Eclipse 中用于历史导航的多点触控手势:http: //sourceforge.net/apps/mediawiki/eclipsemultitch/