~ubuntu-branches/ubuntu/vivid/eclipse-wtp/vivid

« back to all changes in this revision

Viewing changes to org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDocumentHandler.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2013-06-28 08:42:01 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130628084201-houvqyt5uc6a3p27
Tags: 3.5.0-1
* New upstream release.
* Refreshed d/patches:
  - debian-custom-build.patch
  - regenerate-xpath2-parser.patch.
* Add patch for compatibility with rhino 1.7R4.
* Regenerate code from EMF models.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2008 IBM Corporation and others.
 
2
 * Copyright (c) 2008, 2013 IBM Corporation and others.
3
3
 * All rights reserved. This program and the accompanying materials
4
4
 * are made available under the terms of the Eclipse Public License v1.0
5
5
 * which accompanies this distribution, and is available at
23
23
import org.eclipse.ui.texteditor.ITextEditor;
24
24
import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
25
25
import org.eclipse.wst.sse.core.StructuredModelManager;
 
26
import org.eclipse.wst.sse.core.internal.cleanup.AbstractStructuredCleanupProcessor;
26
27
import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
27
28
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 
29
import org.eclipse.wst.sse.ui.StructuredTextEditor;
28
30
import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
29
31
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
30
32
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
60
62
                                                        IStructuredModel model = null;
61
63
                                                        try {
62
64
                                                                model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
63
 
                                                                if (model != null)
64
 
                                                                        cleanupProcessor.cleanupModel(model);
 
65
                                                                if (model != null) {
 
66
                                                                        if ((cleanupProcessor instanceof AbstractStructuredCleanupProcessor) && (editor instanceof StructuredTextEditor)) {
 
67
                                                                                ((AbstractStructuredCleanupProcessor) cleanupProcessor).cleanupModel(model, ((StructuredTextEditor) editor).getTextViewer());
 
68
                                                                        }
 
69
                                                                        else {
 
70
                                                                                cleanupProcessor.cleanupModel(model);
 
71
                                                                        }
 
72
                                                                }
65
73
                                                        }
66
74
                                                        finally {
67
75
                                                                if (model != null)