public static ITextViewer getViewer(IPage page) { if(page == null){ return null; } if(page instanceof TextConsolePage) { return ((TextConsolePage)page).getViewer(); } if(page.getClass().equals(MessagePage.class)){ // empty page placeholder return null; } try { /* * org.eclipse.cdt.internal.ui.buildconsole.BuildConsolePage does not * extend TextConsolePage, so we get access to the viewer with dirty tricks */ Method method = page.getClass().getDeclaredMethod("getViewer", (Class<?>[])null); method.setAccessible(true); return (ITextViewer) method.invoke(page, (Object[])null); } catch (Exception e) { // AnyEditToolsPlugin.logError("Can't get page viewer from the console page", e); } return null; }
@Override protected IPage createDefaultPage(PageBook book) { MessagePage defaultPage = new MessagePage(); initPage(defaultPage); defaultPage.setMessage(m_defaultMsg); defaultPage.createControl(book); setPartName(m_defaultTitle); return defaultPage; }
/** * {@inheritDoc} */ @Override protected IPage createDefaultPage(PageBook book) { MessagePage page = new MessagePage(); initPage(page); page.createControl(book); page.setMessage("default page"); return page; }
@Override protected IPage createDefaultPage(PageBook book) { IPage page = super.createDefaultPage(book); if (page instanceof MessagePage) { ((MessagePage)page).setMessage("Nothing currently selected."); } return page; }
/** * Creates, initializes and returns the default page for this view, giving it the default * message. Implements the abstract method from Eclipse class PageBookView. * @param book the PageBook control that will become the parent of the new page * @return the newly-created page */ @Override protected IPage createDefaultPage(PageBook book) { MessagePage page = new MessagePage(); initPage(page); page.createControl(book); page.setMessage(defaultMessage); return page; }
@Override protected IPage createDefaultPage(PageBook book) { MessagePage page = new MessagePage(); initPage(page); page.createControl(book); page.setMessage(CamelDesignerMessages.getString("SpringConfigurationView_defaultMessage")); //$NON-NLS-1$ return page; }
/** * Creates a default page saying that a palette is not available. * * @see org.eclipse.ui.part.PageBookView#createDefaultPage(org.eclipse.ui.part.PageBook) */ protected IPage createDefaultPage(PageBook book) { MessagePage page = new MessagePage(); initPage(page); page.createControl(book); page.setMessage(GEFMessages.Palette_Not_Available); return page; }
/** * Creates and returns the default page for this view. * * @param book * the pagebook control * @return the default page */ protected IPage createDefaultPage( PageBook book ) { MessagePage page = new MessagePage( ); initPage( page ); page.createControl( book ); page.setMessage( defaultText ); return page; }
protected IPage createDefaultPage( PageBook book ) { MessagePage page = new MessagePage( ); initPage( page ); page.createControl( book ); page.setMessage( defaultText ); if ( defaultPartName == null ) { defaultPartName = getPartName( ); } return page; }