|
Lines 17-24
Link Here
|
| 17 |
import org.eclipse.core.resources.IFile; |
17 |
import org.eclipse.core.resources.IFile; |
| 18 |
import org.eclipse.core.runtime.Platform; |
18 |
import org.eclipse.core.runtime.Platform; |
| 19 |
import org.eclipse.jface.action.IMenuManager; |
19 |
import org.eclipse.jface.action.IMenuManager; |
| 20 |
import org.eclipse.jface.text.source.ISourceViewer; |
|
|
| 21 |
import org.eclipse.jface.text.source.IVerticalRuler; |
| 22 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
20 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
| 23 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
21 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
| 24 |
import org.eclipse.jface.viewers.StructuredSelection; |
22 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
Lines 26-45
Link Here
|
| 26 |
import org.eclipse.swt.events.KeyAdapter; |
24 |
import org.eclipse.swt.events.KeyAdapter; |
| 27 |
import org.eclipse.swt.events.KeyEvent; |
25 |
import org.eclipse.swt.events.KeyEvent; |
| 28 |
import org.eclipse.swt.widgets.Composite; |
26 |
import org.eclipse.swt.widgets.Composite; |
| 29 |
import org.eclipse.ui.IEditorInput; |
|
|
| 30 |
import org.eclipse.ui.actions.ActionContext; |
27 |
import org.eclipse.ui.actions.ActionContext; |
| 31 |
import org.eclipse.ui.actions.ActionGroup; |
28 |
import org.eclipse.ui.actions.ActionGroup; |
| 32 |
import org.eclipse.ui.texteditor.ITextEditor; |
29 |
import org.eclipse.ui.texteditor.ITextEditor; |
| 33 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
30 |
import org.eclipse.ui.texteditor.ITextEditorActionConstants; |
| 34 |
import org.eclipse.ui.views.contentoutline.IContentOutlinePage; |
31 |
import org.eclipse.ui.views.contentoutline.IContentOutlinePage; |
| 35 |
import org.eclipse.ui.views.properties.IPropertySheetPage; |
32 |
import org.eclipse.ui.views.properties.IPropertySheetPage; |
| 36 |
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer; |
33 |
import org.eclipse.wst.sse.ui.internal.StructuredTextEditor; |
| 37 |
import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; |
34 |
import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; |
| 38 |
import org.eclipse.wst.sse.ui.internal.openon.OpenOnAction; |
35 |
import org.eclipse.wst.sse.ui.internal.openon.OpenOnAction; |
| 39 |
import org.eclipse.wst.sse.ui.internal.view.events.INodeSelectionListener; |
36 |
import org.eclipse.wst.sse.ui.internal.view.events.INodeSelectionListener; |
| 40 |
import org.eclipse.wst.sse.ui.internal.view.events.NodeSelectionChangedEvent; |
37 |
import org.eclipse.wst.sse.ui.internal.view.events.NodeSelectionChangedEvent; |
| 41 |
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; |
38 |
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; |
| 42 |
import org.eclipse.wst.xml.ui.internal.provisional.StructuredTextEditorXML; |
|
|
| 43 |
import org.eclipse.wst.xsd.ui.internal.properties.section.XSDTabbedPropertySheetPage; |
39 |
import org.eclipse.wst.xsd.ui.internal.properties.section.XSDTabbedPropertySheetPage; |
| 44 |
import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter; |
40 |
import org.eclipse.wst.xsd.ui.internal.provider.CategoryAdapter; |
| 45 |
import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider; |
41 |
import org.eclipse.wst.xsd.ui.internal.provider.XSDAdapterFactoryLabelProvider; |
|
Lines 54-60
Link Here
|
| 54 |
import org.w3c.dom.Node; |
50 |
import org.w3c.dom.Node; |
| 55 |
|
51 |
|
| 56 |
|
52 |
|
| 57 |
public class XSDTextEditor extends StructuredTextEditorXML implements INodeSelectionListener, ISelectionChangedListener |
53 |
public class XSDTextEditor extends StructuredTextEditor implements INodeSelectionListener, ISelectionChangedListener |
| 58 |
{ |
54 |
{ |
| 59 |
protected XSDSelectionManager xsdSelectionManager; |
55 |
protected XSDSelectionManager xsdSelectionManager; |
| 60 |
protected XSDModelAdapterFactoryImpl xsdModelAdapterFactory; |
56 |
protected XSDModelAdapterFactoryImpl xsdModelAdapterFactory; |
|
Lines 224-238
Link Here
|
| 224 |
} |
220 |
} |
| 225 |
} |
221 |
} |
| 226 |
|
222 |
|
| 227 |
|
|
|
| 228 |
/* |
| 229 |
* @see ITextEditor#doRevertToSaved() |
| 230 |
*/ |
| 231 |
public void doRevertToSaved() |
| 232 |
{ |
| 233 |
super.doRevertToSaved(); |
| 234 |
} |
| 235 |
|
| 236 |
/* |
223 |
/* |
| 237 |
* @see StructuredTextEditor#update() |
224 |
* @see StructuredTextEditor#update() |
| 238 |
*/ |
225 |
*/ |
|
Lines 263-299
Link Here
|
| 263 |
}); |
250 |
}); |
| 264 |
} |
251 |
} |
| 265 |
|
252 |
|
| 266 |
// private static Color dividerColor; |
|
|
| 267 |
|
| 268 |
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler verticalRuler, int styles) { |
| 269 |
|
| 270 |
fAnnotationAccess= createAnnotationAccess(); |
| 271 |
fOverviewRuler= createOverviewRuler(getSharedColors()); |
| 272 |
|
| 273 |
StructuredTextViewer sourceViewer = createStructedTextViewer(parent, verticalRuler, styles); |
| 274 |
initSourceViewer(sourceViewer); |
| 275 |
|
| 276 |
// end of super createSourceViewer |
| 277 |
|
| 278 |
//StructuredAnnotationAccess annotationAccess = new StructuredAnnotationAccess(); |
| 279 |
// DefaultMarkerAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess(); |
| 280 |
|
| 281 |
// ISharedTextColors sharedColors = getTextColorsCache(); |
| 282 |
//// fOverviewRuler = new OverviewRuler(annotationAccess, OVERVIEW_RULER_WIDTH, sharedColors); |
| 283 |
// fOverviewRuler = new OverviewRuler(createAnnotationAccess(), 12, sharedColors); |
| 284 |
|
| 285 |
// fOverviewRuler.addHeaderAnnotationType(StructuredAnnotationType.ERROR); |
| 286 |
// fOverviewRuler.addHeaderAnnotationType(StructuredAnnotationType.WARNING); |
| 287 |
|
| 288 |
// fSourceViewerDecorationSupport = new SourceViewerDecorationSupport(sourceViewer, fOverviewRuler, annotationAccess, sharedColors); |
| 289 |
//configureSourceViewerDecorationSupport(fSourceViewerDecorationSupport); |
| 290 |
|
| 291 |
// The following method was removed |
| 292 |
// sourceViewer.setEditor(this); |
| 293 |
|
| 294 |
return sourceViewer; |
| 295 |
} |
| 296 |
|
| 297 |
protected IFile file; |
253 |
protected IFile file; |
| 298 |
|
254 |
|
| 299 |
|
255 |
|
|
Lines 310-323
Link Here
|
| 310 |
{ |
266 |
{ |
| 311 |
return (XSDEditor)getEditorPart(); |
267 |
return (XSDEditor)getEditorPart(); |
| 312 |
} |
268 |
} |
| 313 |
|
|
|
| 314 |
/** |
| 315 |
* @see org.eclipse.ui.texteditor.AbstractTextEditor#safelySanityCheckState(IEditorInput) |
| 316 |
*/ |
| 317 |
public void safelySanityCheckState(IEditorInput input) |
| 318 |
{ |
| 319 |
super.safelySanityCheckState(input); |
| 320 |
} |
| 321 |
|
269 |
|
| 322 |
protected class WrappedOpenFileAction extends OpenOnAction |
270 |
protected class WrappedOpenFileAction extends OpenOnAction |
| 323 |
{ |
271 |
{ |