/** * Returns the text label for the page with the given index. Returns the * empty string if no text label has been set for the page. The page index * must be valid. * * @param pageIndex * the index of the page * @return the text label for the page */ protected String getPageText(int pageIndex) { return getItem(pageIndex).getText(); }
/** * Returns the image for the page with the given index, or <code>null</code> * if no image has been set for the page. The page index must be valid. * * @param pageIndex * the index of the page * @return the image, or <code>null</code> if none */ protected Image getPageImage(int pageIndex) { return getItem(pageIndex).getImage(); }
/** * Sets the control for the given page index. The page index must be valid. * * @param pageIndex * the index of the page * @param control * the control for the specified page, or <code>null</code> to * clear the control */ protected void setControl(int pageIndex, Control control) { getItem(pageIndex).setControl(control); }
/** * Sets the image for the page with the given index, or <code>null</code> * to clear the image for the page. The page index must be valid. * * @param pageIndex * the index of the page * @param image * the image, or <code>null</code> */ protected void setPageImage(int pageIndex, Image image) { getItem(pageIndex).setImage(image); }
/** * Sets the text label for the page with the given index. The page index * must be valid. The text label must not be null. * * @param pageIndex * the index of the page * @param text * the text label */ protected void setPageText(int pageIndex, String text) { getItem(pageIndex).setText(text); }
/** * Returns the control for the given page index, or <code>null</code> if * no control has been set for the page. The page index must be valid. * <p> * Subclasses should not override this method * </p> * * @param pageIndex * the index of the page * @return the control for the specified page, or <code>null</code> if * none has been set */ protected Control getControl(int pageIndex) { return getItem(pageIndex).getControl(); }
/** * Returns the editor for the given page index. The page index must be * valid. * * @param pageIndex * the index of the page * @return the editor for the specified page, or <code>null</code> if the * specified page was not created with * <code>addPage(IEditorPart,IEditorInput)</code> */ protected IEditorPart getEditor(int pageIndex) { Item item = getItem(pageIndex); if (item != null) { Object data = item.getData(); if (data instanceof IEditorPart) { return (IEditorPart) data; } } return null; }
CTabItem item = getItem(pageIndex); IServiceLocator pageLocator = null; if (item.getData() instanceof IServiceLocator) {
Item item = getItem(pageIndex); if (item != null) { Object data = item.getData();
Item item = getItem(pageIndex);