| Summary: | Webtools XML Editor ignores XML files with other extensions then .xml | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Source Editing | Reporter: | Martin Burchard <webtools> | ||||||
| Component: | wst.xml | Assignee: | Nitin Dahyabhai <thatnitind> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | a.gurov, for.work.things, peter | ||||||
| Version: | 0.7 | ||||||||
| Target Milestone: | 1.0 M8 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 99793 | ||||||||
| Attachments: |
|
||||||||
|
Description
Martin Burchard
Please check the FAQ (http://www.eclipse.org/webtools/faq/main.html#xml_1) for how to solve this problem. I am re-opening (on behalf of Martin :) as this has been reported enough we could at least make some improvements. For example, the "The document is empty" is probably a little frightening as a message ... and is not accurate .... and at least source page shows the source, even if not handled as XML. Perhaps the design page message should be "The document is empty or the content type of the file is not recognized as a type of XML" ... perhaps with a link to the contentType preference page? Or ... a status page dialog to directly update the preference with the files extension (and/or give choice to open text editor) if content type is not desired to be changed? Or .... something ... suggestions welcome. The idea is we need to be "friendlier" for beginning users ... or, even very experienced users! since this contentType stuff is new. Amy ... would you be interested in at least fixing the message? Bonus points for creative ease-of-use solutions :) Basic fix: Rather than replacing "The document is empty.." message (since empty vs unsupported content type should be handled differently), I will add an additional message on XML design page so that if unknown content type is in editor, XML design page will display a message "Cannot display document contents." Bonus points attempt: If unsupported content type is in any structured text editor, an information dialog will pop up informing user of unsupported content type and dialog will provide a link to content types preference page. There is also a checkbox for "do not show me this message again" and a preference in Structured Text Editor preference page "Inform when unsupported content type is in editor" (by default, users will be informed) Created attachment 26158 [details]
org.eclipse.wst.xml.ui.patch
Modified XML Design page to check for unsupported content type (actually checks
if able to get IStructuredModel)
One big change I made was in IDesignViewer
replaced setModel with setDocument
and changed implementors/references accordingly. With this change, an
IDocument is passed to the design page instead of a model. Then in the design
page, a model is retrieved from model manager (getexistingmodelforedit)
Created attachment 26160 [details] org.eclipse.wst.sse.ui.patch Created new dialog UnknownContentTypeDialog that will pop up when unsupported content type is in StructuredTextEditor. Unsupported content type is detected in StructuredTextEditor#doSetInput. Dialog will open in UIJob so that it does not stop editor from loading. Added new preference: EditorPreferenceNames.SHOW_UNKNOWN_CONTENT_TYPE_MSG to keep track of whether or not to display unsupported content type dialog. Also added patch to fix bug 99793 (for fix details see that bug) Reassigning to David to apply patches. Applying the patches with 2 changes: 1) Removed StructuredTextEditor.isSaveOnCloseNeeded (https://bugs.eclipse.org/bugs/show_bug.cgi?id=99793#c9) 2) Altered XMLMultiPageEditorPart to switch to the source page if there's no model. The design page is of no use in this scenario. Thanks, Amy. *** Bug 108212 has been marked as a duplicate of this bug. *** This is part of a mass update to close out all stale WTP resolved bugs from the 1.0.x and 1.5.0 timeframe. If you feel this bug was closed inappropriately, please reopen. Thanks, John Lanuti Dear developers,
The Subversive users reported to us a bug in result of which Subversive cannot open XML files in his Repositories View (in WTP environment) with the "Unknown content type" message.
I investigated the problem and found that the reason of the problem is additional constraints in the org.eclipse.wst.sse.ui.StructuredTextEditor.setDocumentProvider() method:
...........
else if (input instanceof IStorageEditorInput && !(input instanceof IFileEditorInput) && !(input instanceof IPathEditorInput)) {
setDocumentProvider(StorageModelProvider.getInstance());
}
...........
The Subversive editor input implements IPathEditorInput interface because it is required for opening files with external editors.
From my point of view these additional constraints is unreasonable and can be easily removed from the code. Could you please remove it or propose any another acceptable solution?
I'll need more concrete details on what kind of editor input is being used, after all the org.eclipse.team.internal.ccvs.ui.RemoteFileEditorInput works fine and IPathEditorInput is really meant for files on the local filesystem. It also sounds like a completely different problem than the one for which this bug was originally opened. Alexander, please open a separate report with more details. The problem description is moved into separate bug report with additional details: https://bugs.eclipse.org/bugs/show_bug.cgi?id=181384 Closing as the original problem is still fixed. |