* Contributors:
* Christopher Lenz - initial API and implementation
*
- * $Id: XMLReconcileStep.java,v 1.1 2004-09-02 18:28:03 jsurfer Exp $
+ * $Id: XMLReconcileStep.java,v 1.2 2006-10-21 23:14:13 pombredanne Exp $
*/
package net.sourceforge.phpeclipse.xml.ui.internal.text;
*/
private class ProblemAdapter extends AnnotationAdapter {
private IProblem problem;
+
private Position position;
- public ProblemAdapter(IProblem problem) {
+ public ProblemAdapter(IProblem problem) {
this.problem = problem;
}
- public Position getPosition() {
+ public Position getPosition() {
if (position == null) {
position = createPositionFromProblem();
}
/**
* Constructor.
*
- * @param step the step to add to the pipe
- * @param editor the associated text editor
+ * @param step
+ * the step to add to the pipe
+ * @param editor
+ * the associated text editor
*/
public XMLReconcileStep(IReconcileStep step, ITextEditor editor) {
super(step);
/*
* @see AbstractReconcileStep#reconcileModel(DirtyRegion, IRegion)
*/
- protected IReconcileResult[] reconcileModel(
- DirtyRegion dirtyRegion, IRegion subRegion
- ) {
+ protected IReconcileResult[] reconcileModel(DirtyRegion dirtyRegion,
+ IRegion subRegion) {
IXMLDocument model = xmlDocumentAdapter.getDocument();
-
IEditorInput editorInput = null;
IFile file = null;
- if (editor != null) {
- editorInput = editor.getEditorInput();
- }
+ if (editor != null) {
+ editorInput = editor.getEditorInput();
+ }
- if (editorInput instanceof IFileEditorInput)
- file = ((IFileEditorInput) editorInput).getFile();
- ProblemCollector problemCollector = new ProblemCollector();
+ if (editorInput instanceof IFileEditorInput)
+ file = ((IFileEditorInput) editorInput).getFile();
+ ProblemCollector problemCollector = new ProblemCollector();
model.reconcile(problemCollector, file);
List problems = problemCollector.getProblems();
private IXMLDocument getXMLDocument() {
IDocumentProvider documentProvider = editor.getDocumentProvider();
if (documentProvider instanceof XMLDocumentProvider) {
- XMLDocumentProvider xmlDocumentProvider =
- (XMLDocumentProvider) documentProvider;
+ XMLDocumentProvider xmlDocumentProvider = (XMLDocumentProvider) documentProvider;
return xmlDocumentProvider.getModel(editor.getEditorInput());
}