@Override public int getCurrentPageIndex() { return getActivePage(); } };
/** * The <code>MultiPageEditor</code> implementation of this * <code>IWorkbenchPart</code> method sets focus on the active nested * editor, if there is one. * <p> * Subclasses may extend or reimplement. * </p> */ @Override public void setFocus() { setFocus(getActivePage()); }
/** * Returns the active nested editor if there is one. * <p> * Subclasses should not override this method * </p> * * @nooverride * @return the active nested editor, or <code>null</code> if none */ protected IEditorPart getActiveEditor() { int index = getActivePage(); if (index != -1) { return getEditor(index); } return null; }
/** * {@inheritDoc} * @throws ExecutionException * if an exception occurred during execution */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() - 1; if (i < 0) i= n - 1; setActivePage(i); return null; } });
/** * {@inheritDoc} * @throws ExecutionException * if an exception occurred during execution */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() + 1; if (i >= n) i= 0; setActivePage(i); return null; } });
/** * Returns the selected page for the current active page index, either the * IEditorPart for editors or the Control for other pages. * <p> * <b>Note:</b> clients may override this method to return a page * appropriate for their editors. Maybe be <code>null</code>. * </p> * * @return The IEditorPart or Control representing the current active page, * or <code>null</code> if there are no active pages. * @since 3.5 * @see #getActivePage() */ @Override public Object getSelectedPage() { int index = getActivePage(); if (index == -1) { return null; } IEditorPart editor = getEditor(index); if (editor != null) { return editor; } return getControl(index); }
final int pageIndex = getActivePage(); final IKeyBindingService service = getSite().getKeyBindingService(); if (pageIndex < 0 || pageIndex >= getPageCount() || immediate) {
final int pageIndex = getActivePage(); final IEditorPart editor = getEditor(pageIndex);
if (getActivePage() == -1) { setActivePage(0); IEditorPart part = getEditor(0);