Answers:
是两个官方快捷方式,但它们都涉及要显示的列表。
CTRL++ Page Up/ CTRL+ Page Down可以在编辑器中循环显示而不显示列表。
最后一组快捷方式的有趣之处在于:
它们没有在要定义的Eclipse Keys快捷方式中列出。
它们可以从多页编辑器继承,从而使其成为特定于OS的快捷方式。
关于Mac OS(OSX)上的快捷方式,Matt Ball在2011年9月抱怨无法重新映射CTRL+ Page Up/ CTRL+ Page Down:
就像我在OS X中几乎所有其他选项卡式程序(⌘- Left和⌘- Right)中一样,它使我发疯,无法翻开打开的选项卡。
好吧,在2012年3月,亚瑟回答:
,我刚刚下载了最新版本的Eclipse(3.7+)。在编辑器中时,我已经能够将“上一个/下一个选项卡”绑定到(⌘- Left和⌘- Right),我敢肯定我以前做不到。
所以我想他们听到了你的声音。
它按您的期望工作,选项卡从左到右,反之亦然,而不是基于历史记录或类似的废话。
噢,选择“编辑Java源代码”确实有效!
现在,不幸的是,这意味着如果我浏览一个非Java文件(JSP,XML,JS等),我就是SOL。
对此的解决方法是为此对“复制命令”,然后选择所需的所有“时间”。
到目前为止,它对于Java和JSP文件至少可以很好地工作。
这是要设置的主要PITA,但这只是一次性的事情。
他的导出的首选项可在此处尝试。
导入后,对于所有相关类型的文档,您应该会看到:
CTRL+Page Up
/ CTRL+Page Down
是否存在?就像我在OS X(⌘-Left
和⌘-Right
)中几乎所有其他选项卡式程序中一样,它使我无法进行打开的选项卡。
如果转到首选项(例如,窗口→首选项)并查看常规→键
然后搜索“下一个标签”和“上一个标签”,您可以重新映射它们。
CTRL-F6在Eclipse中,例如ALT-TAB(在Windows上),将显示可用选项卡/窗口的列表(如果按住CTRL/ ALT键,并突出显示当您松开该键时将跳转到的选项卡/窗口)。您不必选择窗口。如果要一次遍历几个选项卡,请按住CTRL按钮并点击TAB按钮。这与Windows 上的ALT-TAB行为相同。
在这个意义上,CTRL- SHIFT-F6在Eclipse是ALT- SHIFT-TAB模拟。我个人将Eclipse中的这些绑定更改为类似于Visual Studio。即CTRL-TAB和CTRL- SHIFT-TAB我不喜欢这样写道:
窗口>首选项>常规>键
然后设置“ Next Editor” = Ctrl+Tab和“ Previous Editor” = Ctrl++ Shift+Tab。设置新的绑定之前,请不要忘记单击“解除绑定命令”。
这是CTRL-PageDown走对,CTRL-PageUp向左走。令人沮丧的是,当您到达选项卡列表的末尾(例如最右边的选项卡),然后尝试再次向右移动时,Eclipse不会像大多数浏览器一样循环到第一个选项卡(最左侧)。
CTRL-TAB
。
您可以使用ALT+ Left转到上一个选项卡,或使用ALT+ Right前进。不过,此方法使用的标签切换方式类似于历史记录,因此它将转到您打开的上一个标签,如果您“返回”一次或多次,则将其转发。我知道有点奇怪,但是可以。您始终可以通过单击每个选项卡一次来“重置”历史记录。
Right
侧移:Ctrl+page DownLeft
侧移:CTRL+page Up额外
蚀其他快捷方式
CTRL+ F6很好用。如果要切换到下一个/上一个选项卡,则需要执行CTRL+ Page Down/ CTRL+ Page Up。
XML
或properties
文件时),它将在不同视图之间切换,并且您将无法再在选项卡之间切换:(
默认值为Ctrl+ F6。您可以通过转到窗口首选项来更改它。我通常将其更改为Ctrl+ Tab,就像我们在浏览器和其他内容中切换标签所使用的一样。
自定义键绑定序列例如: CTRL + TAB 到visilble模块或编辑之间切换正向使用Eclipse RCP方向。
您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;
}
}
定制KeyBinding序列示例:使用Eclipse RCP SHIFT + 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;
}
}
按键顺序
M1表示 CTRL
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>
没人会读过我的答案,但是无论如何...如果您使用的是Mac OS X,您会喜欢在Eclipse中进行历史导航的多点触摸手势:http : //sourceforge.net/apps/mediawiki/eclipsemultitch/
快捷键可返回上一个选项卡
Alt+ LeftArrow返回。
由于某种原因,我的Eclipse设置已损坏,因此我不得不手动编辑文件/.plugins/org.eclipse.e4.workbench/workbench.xmi
我必须事先将Ctrl+ 设置Tab为类似浏览器的选项卡切换,甚至重置Eclipse首选项中的所有键绑定都不会摆脱快捷方式(它们也未显示在任何地方)。我打开了上述文件,并删除了与无效快捷方式相关的<bindings>
带有标记的元素<tags>type:user</tags>
。
从右到左:ctrl+ shift+ 9 或 ctrl+ shift+ Page Up或ctrl+Page Up
从左到右:ctrl+ shift+ 3或ctrl+ shift+ Page Down或ctrl+Page Down
如果您只想在当前选项卡和先前选项卡之间切换,使用CTRL+ F6可以来回切换。要导航到历史记录中更远的选项卡,需要在“编辑器”窗口打开时使用UP/ DOWN键。这适用于Helios(Eclipse 3.6);不知道对于旧版本的Eclipse是否适用。
按住CTRL并按住F6直到找到所需的编辑器,然后松开。用户界面不如窗口选择那么漂亮,但是功能是相同的。