public Object getAdapter(@SuppressWarnings("rawtypes") Class type) { if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class) { page = new PropertySheetPage(); page.setRootEntry(new UndoablePropertySheetEntry(getCommandStack())); return page; } if (type == IContentOutlinePage.class) { return getOutlinePage(); } else if (type == ZoomManager.class) return getGraphicalViewer().getProperty( ZoomManager.class.toString()); return super.getAdapter(type); }
public void createControls(Composite parent, TabbedPropertySheetPage atabbedPropertySheetPage) { super.createControls(parent, atabbedPropertySheetPage); tabbed = (GEFTabbedPropertySheetPage) atabbedPropertySheetPage; CommandStack stack = StackHelper.getDelegatingStack(tabbed); if (stack != null) { UndoablePropertySheetEntry root = new UndoablePropertySheetEntry(stack); page.setRootEntry(root); } }
/** * Returns the adapter for the specified key. * * <P><EM>IMPORTANT</EM> certain requests, such as the property sheet, may be made before * or after {@link #createPartControl(Composite)} is called. The order is unspecified by * the Workbench. * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @SuppressWarnings("unchecked") @Override public Object getAdapter(Class type) { if (Timeline.class == type) { return getTimeline(); } if (ETimeline.class == type) { Resource resource = getPlanEditorTemplateResource(); EObject content = EMFUtils.getLoadedContent(resource); if (content instanceof ETimeline) { return content; } } if (EditingDomain.class == type) { IEditorInput input = getEditorInput(); PlanEditorModel model = PlanEditorModelRegistry.getPlanEditorModel(input); if (model != null) { return model.getEditingDomain(); } } if (IPropertySheetPage.class.equals(type)) { PropertySheetPage page = new PropertySheetPage(); page.setRootEntry(new UndoablePropertySheetEntry(getCommandStack())); return page; } if (CommandStack.class.equals(type)) { return getCommandStack(); } if (ActionRegistry.class.equals(type)) { return getActionRegistry(); } if (ZoomManager.class.equals(type)) { return timeline.getZoomManager(); } if (Page.class.equals(type)) { return timeline.getPage(); } if (IContextProvider.class.equals(type)) { return new ContextProvider("gov.nasa.arc.spife.core.plan.editor.timeline.TimelineEditorPart"); } return super.getAdapter(type); }