Eclipse: passa dalla scorciatoia da tastiera degli editor

5

C'è una scorciatoia da tastiera come ctrl + tab per passare tra gli editor aperti in Eclipse ad eccezione del cmd + F6 pubblicizzato ?

C'è un modo per personalizzarlo?

    
posta johnk 05.12.2010 - 20:57
fonte

2 risposte

6

Se ho ragione io voglio cmd + opzione + ( o )

Inoltre puoi modificare le scorciatoie andando a Preferenze Eclipse ( cmd, ) e scegli il generale nella finestra a sinistra e seleziona la chiave, quindi scorri fino a trovare le scorciatoie desiderate.

    
risposta data 05.12.2010 - 21:13
fonte
0

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

premi CTRL + TAB per la seconda volta un altro editor e chiudi l'editor precedente usando 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

    
risposta data 31.01.2017 - 13:46
fonte

Leggi altre domande sui tag