|
|||||||||
PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.ui.part.WorkbenchPart | +--org.eclipse.ui.part.EditorPart | +--org.eclipse.ui.part.MultiPageEditorPart | +--org.eclipse.xsd.presentation.XSDEditor
This is a an example of a xsd model editor.
Inner Class Summary | |
static class |
XSDEditor.ActionBarContributor
This is the contributor for the XSD model editor. |
static class |
XSDEditor.GenericXMLLoadAction
|
static class |
XSDEditor.GenericXMLResourceFactoryImpl
|
static class |
XSDEditor.GenericXMLResourceImpl
|
Field Summary | |
protected org.eclipse.ui.views.contentoutline.IContentOutlinePage |
contentOutlinePage
This is the content outline page. |
protected org.eclipse.jface.action.IStatusLineManager |
contentOutlineStatusLineManager
This is a kludge... |
protected org.eclipse.jface.viewers.TreeViewer |
contentOutlineViewer
This is the content outline page's viewer. |
protected org.eclipse.jface.viewers.Viewer |
currentViewer
This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. |
protected org.eclipse.emf.common.ui.ViewerPane |
currentViewerPane
This keeps track of the active viewer pane, in the book. |
protected org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain |
editingDomain
This keeps track of the editing domain that is used to track all changes to the model. |
protected org.eclipse.jface.viewers.ISelection |
editorSelection
This keeps track of the selection of the editor as a whole. |
protected boolean |
handledStructuredModelChange
|
protected org.eclipse.ui.IPartListener |
partListener
This listens for when things becomes active. |
protected org.eclipse.ui.views.properties.PropertySheetPage |
propertySheetPage
This is the property sheet page. |
protected org.eclipse.jface.viewers.ISelectionChangedListener |
selectionChangedListener
This listens to which ever viewer is active. |
protected java.util.Collection |
selectionChangedListeners
This keeps track of all the ISelectionChangedListener s that are listening to this editor. |
protected org.eclipse.xsd.presentation.XSDEditor.SelectDiagnosticAction |
selectNextDiagnosticsAction
This is the outline action to select the next unresolved component. |
protected org.eclipse.xsd.presentation.XSDEditor.SelectUseAction |
selectNextUseAction
This is the outline action to select the next use of a component. |
protected org.eclipse.xsd.presentation.XSDEditor.SelectDiagnosticAction |
selectPreviousDiagnosticsAction
This is the outline action to select the previous unresolved component. |
protected org.eclipse.xsd.presentation.XSDEditor.SelectUseAction |
selectPreviousUseAction
This is the outline action to select the previous use of a component. |
protected XSDItemProviderAdapterFactory |
semanticAdapterFactory
This is the adapter factory used for providing the semantic views of the model. |
protected org.eclipse.jface.viewers.TreeViewer |
semanticSelectionViewer
This is the semantic viewer that shadows the selection in the content outline. |
protected org.eclipse.jface.text.source.ISourceViewer |
sourceViewer
|
protected XSDItemProviderAdapterFactory |
syntacticAdapterFactory
This is the adapter factory used for providing the syntactive views of the model. |
protected org.eclipse.jface.viewers.TreeViewer |
syntacticSelectionViewer
This is the syntactic viewer that shadows the selection in the content outline. |
protected org.eclipse.ui.editors.text.TextEditor |
textEditor
This source part of the editor. |
protected XSDSchema |
xsdSchema
This keeps track of the root object of the model. |
Fields inherited from interface org.eclipse.ui.IEditorPart |
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
Constructor Summary | |
XSDEditor()
This creates a model editor. |
Method Summary | |
void |
addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implements ISelectionProvider . |
protected void |
createContextMenuFor(org.eclipse.jface.viewers.StructuredViewer viewer)
This creates a context menu for the viewer and adds a listener as well registering the menu for extension. |
protected void |
createModel()
|
void |
createPages()
This is the method used by the framework to install your own controls. |
protected void |
createResource(java.lang.String uri)
|
protected void |
createSemanticsPage()
|
protected void |
createSourcePage()
|
protected void |
createSyntaxPage()
|
protected java.lang.String |
determineEncoding()
|
void |
dispose()
This is called when the editor is disposed. |
void |
doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
This is for implementing IEditorPart and simply saves the model file. |
void |
doSaveAs()
This also changes the editor's input. |
protected void |
extendedCreateResource(java.lang.String uri)
|
org.w3c.dom.Element |
findBestElement(org.w3c.dom.Element element,
int line,
int column)
|
protected void |
firePropertyChange(int action)
This is here for the listener to be able to call it. |
org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor |
getActionBarContributor()
This convenience method provides typed access to the contributor. |
org.eclipse.ui.IActionBars |
getActionBars()
This convenience method provides access to the actionbars. |
java.lang.Object |
getAdapter(java.lang.Class key)
This is how the framework determines which interfaces we implement. |
org.eclipse.ui.views.contentoutline.IContentOutlinePage |
getContentOutlinePage()
This accesses a cached version of the content outliner. |
org.eclipse.emf.edit.domain.EditingDomain |
getEditingDomain()
This returns the editing domain as required by the IEditingDomainProvider interface. |
org.eclipse.ui.views.properties.IPropertySheetPage |
getPropertySheetPage()
This accesses a cached version of the property sheet. |
static XSDConcreteComponent |
getResolvedObject(XSDConcreteComponent xsdConcreteComponent)
This is a utility function to resolve a component. |
org.eclipse.jface.viewers.ISelection |
getSelection()
This implements ISelectionProvider to return this editor's overall selection. |
void |
gotoMarker(org.eclipse.core.resources.IMarker marker)
|
void |
handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)
This deals with how we want selection in the outliner to affect the other views. |
void |
handleContentOutlineSelectionForTextEditor(org.eclipse.jface.viewers.ISelection selection,
boolean reveal)
This deals with how we want selection in the outliner to affect the text editor. |
protected void |
handleDiagnostics(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
|
protected void |
handleDocumentChange()
|
protected void |
handlePartActivated(org.eclipse.ui.IWorkbenchPart workbenchPart)
This handles part activation. |
void |
handleSelectedNodes(java.util.Collection nodes)
|
protected void |
handleSourceCaretPosition()
|
protected void |
handleStructuredModelChange()
|
void |
init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput editorInput)
This is called during startup. |
protected void |
initializeMarkerPosition(org.eclipse.core.resources.IMarker marker,
XSDDiagnostic xsdDiagnostic)
|
boolean |
isDirty()
This is for implementing IEditorPart and simply tests the command stack. |
boolean |
isSaveAsAllowed()
This always returns false because it is not current supported. |
void |
menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This implements IMenuListener to help fill the context menus with contributions from the Edit menu. |
protected void |
pageChange(int pageIndex)
This is used to track the active viewer. |
void |
removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implements ISelectionProvider . |
void |
setCurrentViewer(org.eclipse.jface.viewers.Viewer viewer)
This makes sure that one content viewer, either for the current page or the outline view, if it has focus, is the current one. |
void |
setCurrentViewerPane(org.eclipse.emf.common.ui.ViewerPane viewerPane)
|
void |
setFocus()
|
void |
setSelection(org.eclipse.jface.viewers.ISelection selection)
This implements ISelectionProvider to set this editor's overall selection. |
void |
setSelectionToViewer(java.util.Collection collection)
This sets the selection into whichever viewer is active. |
void |
setStatusLineManager(org.eclipse.jface.viewers.ISelection selection)
This shows the selection on the status line. |
protected void |
standardCreateResource(java.lang.String uri)
|
protected void |
updateActions()
|
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart |
addPage, addPage, createPartControl, createSite, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, removePage, setActivePage, setControl, setPageImage, setPageText |
Methods inherited from class org.eclipse.ui.part.EditorPart |
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInput |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
addPropertyListener, getConfigurationElement, getDefaultImage, getSite, getTitle, getTitleImage, removePropertyListener, setInitializationData, setSite, setTitle, setTitleImage, setTitleToolTip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener |
Field Detail |
protected XSDSchema xsdSchema
protected org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain editingDomain
protected XSDItemProviderAdapterFactory syntacticAdapterFactory
protected XSDItemProviderAdapterFactory semanticAdapterFactory
protected org.eclipse.ui.views.contentoutline.IContentOutlinePage contentOutlinePage
protected org.eclipse.jface.action.IStatusLineManager contentOutlineStatusLineManager
protected org.eclipse.jface.viewers.TreeViewer contentOutlineViewer
protected org.eclipse.ui.views.properties.PropertySheetPage propertySheetPage
protected org.eclipse.ui.editors.text.TextEditor textEditor
protected org.eclipse.jface.text.source.ISourceViewer sourceViewer
protected org.eclipse.jface.viewers.TreeViewer syntacticSelectionViewer
protected org.eclipse.jface.viewers.TreeViewer semanticSelectionViewer
protected org.eclipse.emf.common.ui.ViewerPane currentViewerPane
protected org.eclipse.jface.viewers.Viewer currentViewer
protected org.eclipse.jface.viewers.ISelectionChangedListener selectionChangedListener
protected java.util.Collection selectionChangedListeners
ISelectionChangedListener
s that are listening to this editor.protected org.eclipse.jface.viewers.ISelection editorSelection
protected org.eclipse.xsd.presentation.XSDEditor.SelectDiagnosticAction selectNextDiagnosticsAction
protected org.eclipse.xsd.presentation.XSDEditor.SelectDiagnosticAction selectPreviousDiagnosticsAction
protected org.eclipse.xsd.presentation.XSDEditor.SelectUseAction selectNextUseAction
protected org.eclipse.xsd.presentation.XSDEditor.SelectUseAction selectPreviousUseAction
protected org.eclipse.ui.IPartListener partListener
protected boolean handledStructuredModelChange
Constructor Detail |
public XSDEditor()
Method Detail |
protected void updateActions()
protected java.lang.String determineEncoding()
protected void handleStructuredModelChange()
protected void handlePartActivated(org.eclipse.ui.IWorkbenchPart workbenchPart)
protected void firePropertyChange(int action)
firePropertyChange
in class org.eclipse.ui.part.WorkbenchPart
public void setSelectionToViewer(java.util.Collection collection)
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
IEditingDomainProvider
interface.
This is important for implementing the static methods of AdapterFactoryEditingDomain
and for supporting CommandAction
.getEditingDomain
in interface org.eclipse.emf.edit.domain.IEditingDomainProvider
public void setCurrentViewerPane(org.eclipse.emf.common.ui.ViewerPane viewerPane)
public void setCurrentViewer(org.eclipse.jface.viewers.Viewer viewer)
protected void createContextMenuFor(org.eclipse.jface.viewers.StructuredViewer viewer)
public void createPages()
createPages
in class org.eclipse.ui.part.MultiPageEditorPart
protected void createResource(java.lang.String uri)
protected void standardCreateResource(java.lang.String uri)
protected void extendedCreateResource(java.lang.String uri)
protected void createModel()
protected void handleSourceCaretPosition()
public org.w3c.dom.Element findBestElement(org.w3c.dom.Element element, int line, int column)
public void handleSelectedNodes(java.util.Collection nodes)
protected void handleDocumentChange()
protected void createSourcePage()
protected void createSemanticsPage()
protected void createSyntaxPage()
protected void initializeMarkerPosition(org.eclipse.core.resources.IMarker marker, XSDDiagnostic xsdDiagnostic) throws org.eclipse.core.runtime.CoreException
protected void handleDiagnostics(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
protected void pageChange(int pageIndex)
pageChange
in class org.eclipse.ui.part.MultiPageEditorPart
public java.lang.Object getAdapter(java.lang.Class key)
getAdapter
in class org.eclipse.ui.part.WorkbenchPart
public static XSDConcreteComponent getResolvedObject(XSDConcreteComponent xsdConcreteComponent)
public org.eclipse.ui.views.contentoutline.IContentOutlinePage getContentOutlinePage()
public org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()
public void handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)
public void handleContentOutlineSelectionForTextEditor(org.eclipse.jface.viewers.ISelection selection, boolean reveal)
public boolean isDirty()
IEditorPart
and simply tests the command stack.isDirty
in class org.eclipse.ui.part.MultiPageEditorPart
public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
IEditorPart
and simply saves the model file.doSave
in class org.eclipse.ui.part.EditorPart
public boolean isSaveAsAllowed()
isSaveAsAllowed
in class org.eclipse.ui.part.EditorPart
public void doSaveAs()
doSaveAs
in class org.eclipse.ui.part.EditorPart
public void gotoMarker(org.eclipse.core.resources.IMarker marker)
gotoMarker
in class org.eclipse.ui.part.EditorPart
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput) throws org.eclipse.ui.PartInitException
init
in class org.eclipse.ui.part.MultiPageEditorPart
public void setFocus()
setFocus
in class org.eclipse.ui.part.MultiPageEditorPart
public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
ISelectionProvider
.addSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
ISelectionProvider
.removeSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public org.eclipse.jface.viewers.ISelection getSelection()
ISelectionProvider
to return this editor's overall selection.getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void setSelection(org.eclipse.jface.viewers.ISelection selection)
ISelectionProvider
to set this editor's overall selection.
Calling this result will notify the listeners.setSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void setStatusLineManager(org.eclipse.jface.viewers.ISelection selection)
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
IMenuListener
to help fill the context menus with contributions from the Edit menu.menuAboutToShow
in interface org.eclipse.jface.action.IMenuListener
public org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor getActionBarContributor()
public org.eclipse.ui.IActionBars getActionBars()
public void dispose()
dispose
in class org.eclipse.ui.part.MultiPageEditorPart
|
Copyright 2001-2003 IBM Corporation and others. All Rights Reserved. |
||||||||
PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |