Search in sources :

Example 6 with IPage

use of org.eclipse.ui.part.IPage in project archi by archimatetool.

the class PaletteView method doCreatePage.

/**
 * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
 */
@Override
protected PageRec doCreatePage(IWorkbenchPart part) {
    // Try to get a custom palette page
    Object obj = part.getAdapter(PalettePage.class);
    if (obj != null && obj instanceof IPage) {
        IPage page = (IPage) obj;
        page.createControl(getPageBook());
        initPage((IPageBookViewPage) page);
        return new PageRec(part, page);
    }
    // Use the default page by returning null
    return null;
}
Also used : IPage(org.eclipse.ui.part.IPage)

Example 7 with IPage

use of org.eclipse.ui.part.IPage in project jbosstools-openshift by jbosstools.

the class OpenShiftUIUtils method refreshPropertySheetPage.

/**
 * Refreshes the current page sheet of Property Sheet view.
 * @param sh
 */
public static void refreshPropertySheetPage(PropertySheet propertySheet) {
    if (propertySheet == null)
        return;
    IPage page = propertySheet.getCurrentPage();
    if (page instanceof TabbedPropertySheetPage) {
        TabbedPropertySheetPage p = (TabbedPropertySheetPage) page;
        if (p == null || p.getControl() == null || p.getControl().isDisposed())
            return;
        p.refresh();
    } else if (page instanceof PropertySheetPage) {
        PropertySheetPage p = (PropertySheetPage) page;
        if (p == null || p.getControl() == null || p.getControl().isDisposed())
            return;
        p.refresh();
    }
}
Also used : IPage(org.eclipse.ui.part.IPage) PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) TabbedPropertySheetPage(org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)

Example 8 with IPage

use of org.eclipse.ui.part.IPage in project archi by archimatetool.

the class CommandStackInspector method doCreatePage.

/**
 * @see PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
 */
@Override
protected PageRec doCreatePage(IWorkbenchPart part) {
    // Try to get a custom command stack page.
    Object obj = part.getAdapter(CommandStackInspectorPage.class);
    if (obj instanceof IPage) {
        IPage page = (IPage) obj;
        page.createControl(getPageBook());
        return new PageRec(part, page);
    }
    // Use the default page
    return null;
}
Also used : IPage(org.eclipse.ui.part.IPage)

Example 9 with IPage

use of org.eclipse.ui.part.IPage in project archi by archimatetool.

the class CommandStackInspector method createDefaultPage.

/**
 * @see PageBookView#createDefaultPage(org.eclipse.ui.part.PageBook)
 */
@Override
protected IPage createDefaultPage(PageBook book) {
    Page page = new Page() {

        Control control;

        @Override
        public void createControl(Composite parent) {
            control = new Canvas(parent, SWT.NONE);
        }

        @Override
        public Control getControl() {
            return control;
        }

        @Override
        public void setFocus() {
        }
    };
    page.createControl(book);
    return page;
}
Also used : Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) Canvas(org.eclipse.swt.widgets.Canvas) IPage(org.eclipse.ui.part.IPage) Page(org.eclipse.ui.part.Page) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Aggregations

IPage (org.eclipse.ui.part.IPage)9 IEditorPart (org.eclipse.ui.IEditorPart)2 MessagePage (org.eclipse.ui.part.MessagePage)2 Page (org.eclipse.ui.part.Page)2 TabbedPropertySheetPage (org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)2 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IToolBarManager (org.eclipse.jface.action.IToolBarManager)1 Canvas (org.eclipse.swt.widgets.Canvas)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 IViewPart (org.eclipse.ui.IViewPart)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 SubActionBars (org.eclipse.ui.SubActionBars)1 PageBook (org.eclipse.ui.part.PageBook)1 ContentOutlinePage (org.eclipse.ui.views.contentoutline.ContentOutlinePage)1 IContentOutlinePage (org.eclipse.ui.views.contentoutline.IContentOutlinePage)1 PropertySheet (org.eclipse.ui.views.properties.PropertySheet)1 PropertySheetPage (org.eclipse.ui.views.properties.PropertySheetPage)1