Search in sources :

Example 1 with INestableKeyBindingService

use of org.eclipse.ui.INestableKeyBindingService in project jbosstools-hibernate by jbosstools.

the class ReverseEngineeringEditor method pageChange.

protected void pageChange(int newPageIndex) {
    if (newPageIndex == 0) {
        IKeyBindingService service = getSite().getKeyBindingService();
        if (service instanceof INestableKeyBindingService) {
            INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
            nestableService.activateKeyBindingService(null);
        }
    }
    saveLastActivePageIndex(newPageIndex);
    super.pageChange(newPageIndex);
}
Also used : IKeyBindingService(org.eclipse.ui.IKeyBindingService) INestableKeyBindingService(org.eclipse.ui.INestableKeyBindingService)

Example 2 with INestableKeyBindingService

use of org.eclipse.ui.INestableKeyBindingService in project jbosstools-jst by jbosstools.

the class JSPMultiPageEditorPart method setFocus.

private void setFocus(int pageIndex) {
    final IKeyBindingService service = getSite().getKeyBindingService();
    if (pageIndex < 0 || pageIndex >= getPageCount()) {
        if (service instanceof INestableKeyBindingService) {
            final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
            nestableService.activateKeyBindingService(null);
        }
        return;
    }
    IEditorPart editor = getEditor(pageIndex);
    if (editor != null) {
        editor.setFocus();
        if (service instanceof INestableKeyBindingService) {
            INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
            if (editor != null) {
                nestableService.activateKeyBindingService(editor.getEditorSite());
            } else {
                nestableService.activateKeyBindingService(null);
            }
        }
    } else {
        if (service instanceof INestableKeyBindingService) {
            INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
            nestableService.activateKeyBindingService(null);
        }
        Control control = getControl(pageIndex);
        if (control != null) {
            control.setFocus();
        }
    }
}
Also used : Control(org.eclipse.swt.widgets.Control) IKeyBindingService(org.eclipse.ui.IKeyBindingService) INestableKeyBindingService(org.eclipse.ui.INestableKeyBindingService) IEditorPart(org.eclipse.ui.IEditorPart)

Aggregations

IKeyBindingService (org.eclipse.ui.IKeyBindingService)2 INestableKeyBindingService (org.eclipse.ui.INestableKeyBindingService)2 Control (org.eclipse.swt.widgets.Control)1 IEditorPart (org.eclipse.ui.IEditorPart)1