5

Is there any keyboard shortcut like ctrl+tab for switching between open editors in Eclipse except for the advertised cmd+F6?

Is there a way to customise it?

  • 2
    This should probably go on stackoverflow (or superuser). – Thilo Dec 8 '10 at 3:26
6

If I get right you want cmd+option + ( or )

And also you can change any shortcuts by going to Eclipse Preferences (cmd ,) and chose general in left side window and select key then scroll to find your desired shortcuts.

alt text

0

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

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

public class Emp_editor_open extends AbstractHandler{

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

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

        //Three object create in EditorInput 
        ProductEditorInput product_input=new ProductEditorInput();
        EmployeeEditorInput emp_input=new EmployeeEditorInput();
        UserEditorInput std_input = new UserEditorInput();

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

        if(editors.length==0){
            //First Time or empty editors to check this condition
            try {
                page.openEditor(product_input,ProductEditor.ID);
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        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);
                System.out.println("Employee Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        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);
                System.out.println("student Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        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);
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        else {
            try {
                page.closeAllEditors(true);
                page.openEditor(product_input,ProductEditor.ID);
                System.out.println("product Editor open");
            } catch (PartInitException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return null;
    }
}

Plugin.xml


    <extension point="org.eclipse.ui.commands">
        <command
                defaultHandler="rcp_demo.Toolbar.Emp_editor_open"
                id="RCP_Demo.Toolbar.emp_editor_open_cmd"
                name="Employee_Editor_open">
        </command>
    </extension>
    <extension point="org.eclipse.ui.bindings">
        <key
                commandId="RCP_Demo.Toolbar.emp_editor_open_cmd"
                schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
                sequence="M1+TAB">
        </key>              
    </extension>    

Key sequence Mapping M1 means CTRL

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .