Aptana Studio
  1. Aptana Studio
  2. APSTUD-3185

CSS: unable to open css files with eclipse WDT css editor

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Won't Fix
    • Affects Version/s: Aptana Studio 3.0.4
    • Fix Version/s: None
    • Component/s: css
    • Labels:

      Description

      If I try to open CSS files with the Eclipse CSS editor I get the error:

      "Unsupported Content Type in editor. To associate file extension with a supported content type, please see Content Types Preferences Page."

      Workarounds:

      1. Check "Do not show this message again" on the dialog above.
      2. Remove Aptana Web nature from the project. The effect might be that you may not me able to use Aptana Studio editors in full.
      3. Do not use WST editors

      See https://bugs.eclipse.org/bugs/show_bug.cgi?id=268635 for the root cause of this bug.

        Issue Links

          Activity

          Hide
          mxmxm added a comment -

          i tried installing PDT and aptana together and the same problem occured with php files, so this one is not specific to WST.
          as ingo mentioned above js files are working fine.
          so i think you do something with the css/html/php extensions that prevent other editors from opening this files.

          Show
          mxmxm added a comment - i tried installing PDT and aptana together and the same problem occured with php files, so this one is not specific to WST. as ingo mentioned above js files are working fine. so i think you do something with the css/html/php extensions that prevent other editors from opening this files.
          Hide
          Max Stepanov added a comment - - edited

          PDT depends on WST, so when you install one it also installs another.
          This problem is very specific to WST. For instance, I installed another CSS editor for Eclipse from http://sourceforge.net/projects/csseditor/
          It works fine with Aptana Studio, but when installed into WST, WST complains the same way about content types.

          If you want to understand the problem deeper, I could explain:
          First of all, editors work with Documents which hold file content and additional information.
          The standard document class type created by Eclipse internals by default is SynchronizableDocument. Most of the editors rely on IDocument interface, so it not an issue.

          WST uses very special type of document, org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument which still implements IDocument, so it's not an issue too. But it overrides default partition content type IDocument.DEFAULT_CONTENT_TYPE with WST-specific types per file which all other editors don't even know about.

          The way WST replaces default document class with their JobSafeStructuredDocument, it using org.eclipse.core.filebuffers.documentCreation extension, which is deprecated since Eclipse 3.2. See http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Ffilebuffers%2FIDocumentFactory.html and WST code at http://eclipsesearch.appspot.com/pluginXml?name=org.eclipse.wst.css.core

          	<extension
          		point="org.eclipse.core.filebuffers.documentCreation"
          		id="org.eclipse.wst.css.core.documentfactories"
          		name="%Structured_CSS_Document_Factory_Extension.name">
          		<factory
          			contentTypeId="org.eclipse.wst.css.core.csssource"
          			class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
          	</extension>
          

          This documentCreation extension relies on contentTypes. So we had to overcome this by placing Aptana's CSS file content type for Aptana Web/PHP/Rails projects first.
          So if you wand to use WST editors in full, I already posted the workaround above, which is "Remove Aptana Web nature from the project". The effect will be that some features of Aptana Studio editors will not work.

          Aptana Studio 1.5 worked in a very different way regarding document partitioning and scanning. Basically it didn't use standard Eclipse partitioning capabilities, and so had a set of other issues and limitations.

          Cheers,
          Max

          Show
          Max Stepanov added a comment - - edited PDT depends on WST, so when you install one it also installs another. This problem is very specific to WST. For instance, I installed another CSS editor for Eclipse from http://sourceforge.net/projects/csseditor/ It works fine with Aptana Studio, but when installed into WST, WST complains the same way about content types. If you want to understand the problem deeper, I could explain: First of all, editors work with Documents which hold file content and additional information. The standard document class type created by Eclipse internals by default is SynchronizableDocument. Most of the editors rely on IDocument interface, so it not an issue. WST uses very special type of document, org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument which still implements IDocument, so it's not an issue too. But it overrides default partition content type IDocument.DEFAULT_CONTENT_TYPE with WST-specific types per file which all other editors don't even know about. The way WST replaces default document class with their JobSafeStructuredDocument, it using org.eclipse.core.filebuffers.documentCreation extension, which is deprecated since Eclipse 3.2. See http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Ffilebuffers%2FIDocumentFactory.html and WST code at http://eclipsesearch.appspot.com/pluginXml?name=org.eclipse.wst.css.core <extension point="org.eclipse.core.filebuffers.documentCreation" id="org.eclipse.wst.css.core.documentfactories" name="%Structured_CSS_Document_Factory_Extension.name"> <factory contentTypeId="org.eclipse.wst.css.core.csssource" class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" /> </extension> This documentCreation extension relies on contentTypes. So we had to overcome this by placing Aptana's CSS file content type for Aptana Web/PHP/Rails projects first. So if you wand to use WST editors in full, I already posted the workaround above, which is "Remove Aptana Web nature from the project". The effect will be that some features of Aptana Studio editors will not work. Aptana Studio 1.5 worked in a very different way regarding document partitioning and scanning. Basically it didn't use standard Eclipse partitioning capabilities, and so had a set of other issues and limitations. Cheers, Max
          Hide
          mxmxm added a comment -

          hi, thx for the explanation,
          wst has already tickets to change the deprectated use of org.eclipse.core.filebuffers.documentCreation extension, so hopefully they will fix it

          Show
          mxmxm added a comment - hi, thx for the explanation, wst has already tickets to change the deprectated use of org.eclipse.core.filebuffers.documentCreation extension, so hopefully they will fix it
          Hide
          Max Stepanov added a comment -

          WST bugzilla ticket for reference https://bugs.eclipse.org/bugs/show_bug.cgi?id=268635

          Show
          Max Stepanov added a comment - WST bugzilla ticket for reference https://bugs.eclipse.org/bugs/show_bug.cgi?id=268635
          Hide
          Ingo Muschenetz added a comment -

          Edited description to add workaround.

          Show
          Ingo Muschenetz added a comment - Edited description to add workaround.

            People

            • Assignee:
              Max Stepanov
              Reporter:
              mxmxm
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development