Java Reference
In-Depth Information
viewer.addDropSupport(dndOperations, transfers, new
EditingDomainViewerDropAdapter(getEditingDomain(), viewer));
}
public void doSave(IProgressMonitor monitor) {
// nothing to do here - this is handled by the parent editor
}
public void doSaveAs() {
// nothing to do here - this is handled by the parent editor
}
public void init(IEditorSite site, IEditorInput input) throws
PartInitException {
setSite(site);
setInput(input);
}
public boolean isDirty() {
return getCommandStack().isSaveNeeded();
}
public boolean isSaveAsAllowed() {
return true;
}
public void menuAboutToShow(IMenuManager manager) {
// pass the request to show the context menu to the parent editor
((IMenuListener) parentEditor.getEditorSite()
.getActionBarContributor()).menuAboutToShow(manager);
}
public abstract void setInput(Object input);
}
We actually don't want to use all of the EMF-generated pages in our multi-
page editor. We'll use just a selection tree and a diagram, so we can remove the
rest. We create a new SelectionTreeEditorPart that extends our
RequirementsEditorPart and migrate code from its original anonymous sub-
class of ViewerPane from the RequirementsEditor class, as shown here:
public class SelectionTreeEditorPart extends RequirementsEditorPart {
protected TreeViewer viewer;
public SelectionTreeEditorPart(RequirementsEditor parent) {
super (parent);
}
public void setInput(Object input) {
viewer.setInput(input);
}
Search WWH ::




Custom Search