|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.part.MultiPageEditorPart
org.eclipse.xsd.presentation.XSDEditor
public class XSDEditor
This is a an example of a xsd model editor.
Nested 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 IContentOutlinePage |
contentOutlinePage
This is the content outline page. |
protected IStatusLineManager |
contentOutlineStatusLineManager
This is a kludge... |
protected TreeViewer |
contentOutlineViewer
This is the content outline page's viewer. |
protected 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 ViewerPane |
currentViewerPane
This keeps track of the active viewer pane, in the book. |
protected AdapterFactoryEditingDomain |
editingDomain
This keeps track of the editing domain that is used to track all changes to the model. |
protected ISelection |
editorSelection
This keeps track of the selection of the editor as a whole. |
protected boolean |
handledStructuredModelChange
|
protected IPartListener |
partListener
This listens for when things becomes active. |
protected PropertySheetPage |
propertySheetPage
This is the property sheet page. |
protected ISelectionChangedListener |
selectionChangedListener
This listens to which ever viewer is active. |
protected java.util.Collection<ISelectionChangedListener> |
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 TreeViewer |
semanticSelectionViewer
This is the semantic viewer that shadows the selection in the content outline. |
protected ISourceViewer |
sourceViewer
|
protected XSDItemProviderAdapterFactory |
syntacticAdapterFactory
This is the adapter factory used for providing the syntactive views of the model. |
protected TreeViewer |
syntacticSelectionViewer
This is the syntactic viewer that shadows the selection in the content outline. |
protected TextEditor |
textEditor
This source part of the editor. |
protected boolean |
validateAutomatically
|
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(ISelectionChangedListener listener)
This implements ISelectionProvider . |
protected void |
createContextMenuFor(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(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. |
EditingDomainActionBarContributor |
getActionBarContributor()
This convenience method provides typed access to the contributor. |
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. |
IContentOutlinePage |
getContentOutlinePage()
This accesses a cached version of the content outliner. |
EditingDomain |
getEditingDomain()
This returns the editing domain as required by the IEditingDomainProvider interface. |
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. |
ISelection |
getSelection()
This implements ISelectionProvider to return this editor's overall selection. |
Viewer |
getViewer()
This returns the viewer as required by the IViewerProvider interface. |
void |
gotoMarker(IMarker marker)
|
void |
handleContentOutlineSelection(ISelection selection)
This deals with how we want selection in the outliner to affect the other views. |
void |
handleContentOutlineSelectionForTextEditor(ISelection selection,
boolean reveal)
This deals with how we want selection in the outliner to affect the text editor. |
protected void |
handleDiagnostics(IProgressMonitor progressMonitor)
|
protected void |
handleDocumentChange()
|
protected void |
handlePartActivated(IWorkbenchPart workbenchPart)
This handles part activation. |
void |
handleSelectedNodes(java.util.Collection<? extends org.w3c.dom.Node> nodes)
|
protected void |
handleSourceCaretPosition()
|
protected void |
handleStructuredModelChange()
|
void |
init(IEditorSite site,
IEditorInput editorInput)
This is called during startup. |
protected void |
initializeMarkerPosition(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. |
boolean |
isValidateAutomatically()
|
void |
menuAboutToShow(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(ISelectionChangedListener listener)
This implements ISelectionProvider . |
void |
setCurrentViewer(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(ViewerPane viewerPane)
|
void |
setFocus()
|
void |
setSelection(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(ISelection selection)
This shows the selection on the status line. |
void |
setValidateAutomatically(boolean validateAutomatically)
|
protected void |
standardCreateResource(java.lang.String uri)
|
protected void |
updateActions()
|
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart |
---|
addPage, addPage, addPage, addPage, createPageContainer, createPartControl, createSite, findEditors, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, removePage, setActiveEditor, setActivePage, setControl, setPageImage, setPageText |
Methods inherited from class org.eclipse.ui.part.EditorPart |
---|
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
---|
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
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 AdapterFactoryEditingDomain editingDomain
protected XSDItemProviderAdapterFactory syntacticAdapterFactory
protected XSDItemProviderAdapterFactory semanticAdapterFactory
protected IContentOutlinePage contentOutlinePage
protected IStatusLineManager contentOutlineStatusLineManager
protected TreeViewer contentOutlineViewer
protected PropertySheetPage propertySheetPage
protected TextEditor textEditor
protected ISourceViewer sourceViewer
protected TreeViewer syntacticSelectionViewer
protected TreeViewer semanticSelectionViewer
protected ViewerPane currentViewerPane
protected Viewer currentViewer
protected ISelectionChangedListener selectionChangedListener
protected java.util.Collection<ISelectionChangedListener> selectionChangedListeners
ISelectionChangedListener
s that are listening to this editor.
protected 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 IPartListener partListener
protected boolean handledStructuredModelChange
protected boolean validateAutomatically
Constructor Detail |
---|
public XSDEditor()
Method Detail |
---|
protected void updateActions()
protected java.lang.String determineEncoding()
protected void handleStructuredModelChange()
protected void handlePartActivated(IWorkbenchPart workbenchPart)
protected void firePropertyChange(int action)
firePropertyChange
in class WorkbenchPart
public void setSelectionToViewer(java.util.Collection<?> collection)
public EditingDomain getEditingDomain()
IEditingDomainProvider
interface.
This is important for implementing the static methods of AdapterFactoryEditingDomain
and for supporting CommandAction
.
getEditingDomain
in interface IEditingDomainProvider
public void setCurrentViewerPane(ViewerPane viewerPane)
public void setCurrentViewer(Viewer viewer)
public Viewer getViewer()
IViewerProvider
interface.
getViewer
in interface IViewerProvider
protected void createContextMenuFor(StructuredViewer viewer)
public void createPages()
createPages
in class 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<? extends org.w3c.dom.Node> nodes)
protected void handleDocumentChange()
protected void createSourcePage()
protected void createSemanticsPage()
protected void createSyntaxPage()
protected void initializeMarkerPosition(IMarker marker, XSDDiagnostic xsdDiagnostic) throws CoreException
CoreException
protected void handleDiagnostics(IProgressMonitor progressMonitor)
protected void pageChange(int pageIndex)
pageChange
in class MultiPageEditorPart
public java.lang.Object getAdapter(java.lang.Class key)
getAdapter
in interface IAdaptable
getAdapter
in class MultiPageEditorPart
public static XSDConcreteComponent getResolvedObject(XSDConcreteComponent xsdConcreteComponent)
public IContentOutlinePage getContentOutlinePage()
public IPropertySheetPage getPropertySheetPage()
public void handleContentOutlineSelection(ISelection selection)
public void handleContentOutlineSelectionForTextEditor(ISelection selection, boolean reveal)
public boolean isDirty()
IEditorPart
and simply tests the command stack.
isDirty
in interface ISaveablePart
isDirty
in class MultiPageEditorPart
public void doSave(IProgressMonitor progressMonitor)
IEditorPart
and simply saves the model file.
doSave
in interface ISaveablePart
doSave
in class EditorPart
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface ISaveablePart
isSaveAsAllowed
in class EditorPart
public void doSaveAs()
doSaveAs
in interface ISaveablePart
doSaveAs
in class EditorPart
public void gotoMarker(IMarker marker)
public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException
init
in interface IEditorPart
init
in class MultiPageEditorPart
PartInitException
public void setFocus()
setFocus
in interface IWorkbenchPart
setFocus
in class MultiPageEditorPart
public void addSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
.
addSelectionChangedListener
in interface ISelectionProvider
public void removeSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
.
removeSelectionChangedListener
in interface ISelectionProvider
public ISelection getSelection()
ISelectionProvider
to return this editor's overall selection.
getSelection
in interface ISelectionProvider
public void setSelection(ISelection selection)
ISelectionProvider
to set this editor's overall selection.
Calling this result will notify the listeners.
setSelection
in interface ISelectionProvider
public void setStatusLineManager(ISelection selection)
public void menuAboutToShow(IMenuManager menuManager)
IMenuListener
to help fill the context menus with contributions from the Edit menu.
menuAboutToShow
in interface IMenuListener
public EditingDomainActionBarContributor getActionBarContributor()
public IActionBars getActionBars()
public void dispose()
dispose
in interface IWorkbenchPart
dispose
in class MultiPageEditorPart
public void setValidateAutomatically(boolean validateAutomatically)
public boolean isValidateAutomatically()
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |