|
Re: Custom Outline View for HTML files [message #227822 is a reply to message #227789] |
Fri, 13 February 2009 16:41 |
|
Providing new extensions for the same targets we already provide
extensions for is not supported. You can, however, try using a
target ID higher than the content type ID in the target search list.
Ideally you would be using a more specific content type, and using
its ID as its target, or requesting an enhancement to contribute to
the existing outline configurations in some way.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Re: Custom Outline View for HTML files [message #227907 is a reply to message #227849] |
Mon, 16 February 2009 14:29 |
|
Dominik Raymann wrote:
> Thanks for your quick reply.
>
> Being new to plugin development in general (and wst extensions
> specifically) I do not really understand what you mean by "higher target
> IDs".
>
> The following naive approach of extending the HTML content type does not
> seem to work either:
>
> <extension
> point="org.eclipse.core.runtime.contentTypes">
> <content-type
> file-extensions="html"
> priority="high"
> name="BX HTML"
> id="ch.raymi.plugin.html"
> base-type="org.eclipse.wst.html.core.htmlsource"
> default-charset="UTF-8" />
> </extension>
>
> <extension
> point="org.eclipse.wst.sse.ui.editorConfiguration">
> <sourceViewerConfiguration
> class=" ch.raymi.plugin.html.plugin.coder.StructuredTextViewerConfig uration "
> target="ch.raymi.plugin.html"/>
> <contentOutlineConfiguration
> class=" ch.raymi.plugin.html.plugin.coder.outline.OutlineConfigurati on "
> target="ch.raymi.plugin.html"/>
> </extension>
>
>
> Now even my StructuredTextViewerConfiguation doesn't seem to work any
> longer. Could someone elaborate a bit further, what needs to be done?
>
> Sorry for my newbie questions, but I find it quite difficult to get
> started.
Odds are you're making invalid assumptions about the ID for your
content type, since I think the value is always appended to the
declaring plug-in's ID. For example, our org.eclipse.wst.html.core
plug-in specifies an ID value of "htmlsource" to its HTML content
type, but the end result is the org.eclipse.wst.html.core.htmlsource
that you are referring to above.
As for the target IDs, we look them up using a list we generate at
runtime with a very specific order, so when I say "higher" I mean
higher in that list. Targets based on content types come after the
IDs based on the editor's part ID and class name. The generation of
target IDs occurs in the
org.eclipse.wst.sse.ui.internal.provisional.extensions.Confi gurationPointCalculator
class if you're curious.
http://www.eclipse.org/webtools/wst/components/sse/designs/E ditorConfiguration.html
mentions it as the "Target Resolution Policy".
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: Custom Outline View for HTML files [message #227937 is a reply to message #227907] |
Mon, 16 February 2009 23:19 |
Dominik Raymann Messages: 37 Registered: July 2009 |
Member |
|
|
Thanks Nitin for your reply.
However, I'm really going to become desperate. Whatever I try, nothing
seems to work.
I tried as suggested (with ch.raymi.plugin being my Plugin ID):
<extension
point="org.eclipse.core.runtime.contentTypes">
<content-type
file-extensions="html"
priority="high"
name="BX HTML"
id="bx"
base-type="org.eclipse.wst.html.core.htmlsource"/>
</extension>
<extension
point="org.eclipse.wst.sse.ui.editorConfiguration">
<sourceViewerConfiguration
class=ch.raymi.plugin.coder.StructuredTextViewerConfiguratio n "
target="ch.raymi.plugin.bx" />
<contentOutlineConfiguration
class="ch.raymi.plugin.coder.outline.OutlineConfiguration"
target="ch.raymi.plugin.bx"/>
</extension>
Neither my StructuredTextViewerConfiguration nor the
OutlineConfiguration work with this configuration. If I change both
targets to the super type "org.eclipse.wst.html.core.htmlsource" (as in
my first attempt): the StructuredTextViewerConfiguration starts to work,
the OutlineConfiguration does not.
How can this asymmetrical behavior be explained? Why are the targets
differently resolved?
Is there a way I can debug this problem easily?
Can you provide a working example (this should be easily reproducible,
shouldn't it?)?
Thank you very much for your help. I'd really like this to work...
Dominik
Nitin Dahyabhai schrieb:
> Dominik Raymann wrote:
>> Thanks for your quick reply.
>>
>> Being new to plugin development in general (and wst extensions
>> specifically) I do not really understand what you mean by "higher
>> target IDs".
>>
>> The following naive approach of extending the HTML content type does
>> not seem to work either:
>>
>> <extension
>> point="org.eclipse.core.runtime.contentTypes">
>> <content-type
>> file-extensions="html"
>> priority="high"
>> name="BX HTML"
>> id="ch.raymi.plugin.html"
>> base-type="org.eclipse.wst.html.core.htmlsource"
>> default-charset="UTF-8" />
>> </extension>
>>
>> <extension
>> point="org.eclipse.wst.sse.ui.editorConfiguration">
>> <sourceViewerConfiguration
>> class=" ch.raymi.plugin.html.plugin.coder.StructuredTextViewerConfig uration "
>>
>> target="ch.raymi.plugin.html"/>
>> <contentOutlineConfiguration
>> class=" ch.raymi.plugin.html.plugin.coder.outline.OutlineConfigurati on "
>> target="ch.raymi.plugin.html"/>
>> </extension>
>>
>>
>> Now even my StructuredTextViewerConfiguation doesn't seem to work any
>> longer. Could someone elaborate a bit further, what needs to be done?
>>
>> Sorry for my newbie questions, but I find it quite difficult to get
>> started.
>
> Odds are you're making invalid assumptions about the ID for your content
> type, since I think the value is always appended to the declaring
> plug-in's ID. For example, our org.eclipse.wst.html.core plug-in
> specifies an ID value of "htmlsource" to its HTML content type, but the
> end result is the org.eclipse.wst.html.core.htmlsource that you are
> referring to above.
>
> As for the target IDs, we look them up using a list we generate at
> runtime with a very specific order, so when I say "higher" I mean higher
> in that list. Targets based on content types come after the IDs based
> on the editor's part ID and class name. The generation of target IDs
> occurs in the
> org.eclipse.wst.sse.ui.internal.provisional.extensions.Confi gurationPointCalculator
> class if you're curious.
> http://www.eclipse.org/webtools/wst/components/sse/designs/E ditorConfiguration.html
> mentions it as the "Target Resolution Policy".
>
|
|
|
Re: Custom Outline View for HTML files [message #227985 is a reply to message #227937] |
Tue, 17 February 2009 23:18 |
Dominik Raymann Messages: 37 Registered: July 2009 |
Member |
|
|
Note:
I read the following on
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. wst.doc.isv/html/plugin_descriptions_WST/cheatsheet_tutorial .html
---
Providing your own outline view
To change the default outline view you have to provide your own adapter
factory provider. To register it with the SSE extend the
org.eclipse.wst.sse.ui.adapterFactoryDescription extension point.
<extension point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
<adapterFactoryDescription
class="org.eclipse.wst.cs.ui.registry.AdapterFactoryProviderForCS "/>
</extension>
The adapter factory provider should add your own adapter factory to the
factory registry.
---
Do I really have to provide an implementation of this adapter? How
should I do that?
Dominik Raymann schrieb:
> Thanks Nitin for your reply.
>
>
> However, I'm really going to become desperate. Whatever I try, nothing
> seems to work.
>
> I tried as suggested (with ch.raymi.plugin being my Plugin ID):
>
> <extension
> point="org.eclipse.core.runtime.contentTypes">
> <content-type
> file-extensions="html"
> priority="high"
> name="BX HTML"
> id="bx"
> base-type="org.eclipse.wst.html.core.htmlsource"/>
> </extension>
>
> <extension
> point="org.eclipse.wst.sse.ui.editorConfiguration">
>
> <sourceViewerConfiguration
> class=ch.raymi.plugin.coder.StructuredTextViewerConfiguratio n "
> target="ch.raymi.plugin.bx" />
>
> <contentOutlineConfiguration
> class="ch.raymi.plugin.coder.outline.OutlineConfiguration"
> target="ch.raymi.plugin.bx"/>
>
> </extension>
>
> Neither my StructuredTextViewerConfiguration nor the
> OutlineConfiguration work with this configuration. If I change both
> targets to the super type "org.eclipse.wst.html.core.htmlsource" (as in
> my first attempt): the StructuredTextViewerConfiguration starts to work,
> the OutlineConfiguration does not.
>
> How can this asymmetrical behavior be explained? Why are the targets
> differently resolved?
>
> Is there a way I can debug this problem easily?
> Can you provide a working example (this should be easily reproducible,
> shouldn't it?)?
>
> Thank you very much for your help. I'd really like this to work...
>
>
> Dominik
>
>
>
>
> Nitin Dahyabhai schrieb:
>> Dominik Raymann wrote:
>>> Thanks for your quick reply.
>>>
>>> Being new to plugin development in general (and wst extensions
>>> specifically) I do not really understand what you mean by "higher
>>> target IDs".
>>>
>>> The following naive approach of extending the HTML content type does
>>> not seem to work either:
>>>
>>> <extension
>>> point="org.eclipse.core.runtime.contentTypes">
>>> <content-type
>>> file-extensions="html"
>>> priority="high"
>>> name="BX HTML"
>>> id="ch.raymi.plugin.html"
>>> base-type="org.eclipse.wst.html.core.htmlsource"
>>> default-charset="UTF-8" />
>>> </extension>
>>>
>>> <extension
>>> point="org.eclipse.wst.sse.ui.editorConfiguration">
>>> <sourceViewerConfiguration
>>> class=" ch.raymi.plugin.html.plugin.coder.StructuredTextViewerConfig uration "
>>>
>>> target="ch.raymi.plugin.html"/>
>>> <contentOutlineConfiguration
>>> class=" ch.raymi.plugin.html.plugin.coder.outline.OutlineConfigurati on "
>>> target="ch.raymi.plugin.html"/>
>>> </extension>
>>>
>>>
>>> Now even my StructuredTextViewerConfiguation doesn't seem to work any
>>> longer. Could someone elaborate a bit further, what needs to be done?
>>>
>>> Sorry for my newbie questions, but I find it quite difficult to get
>>> started.
>>
>> Odds are you're making invalid assumptions about the ID for your
>> content type, since I think the value is always appended to the
>> declaring plug-in's ID. For example, our org.eclipse.wst.html.core
>> plug-in specifies an ID value of "htmlsource" to its HTML content
>> type, but the end result is the org.eclipse.wst.html.core.htmlsource
>> that you are referring to above.
>>
>> As for the target IDs, we look them up using a list we generate at
>> runtime with a very specific order, so when I say "higher" I mean
>> higher in that list. Targets based on content types come after the
>> IDs based on the editor's part ID and class name. The generation of
>> target IDs occurs in the
>> org.eclipse.wst.sse.ui.internal.provisional.extensions.Confi gurationPointCalculator
>> class if you're curious.
>> http://www.eclipse.org/webtools/wst/components/sse/designs/E ditorConfiguration.html
>> mentions it as the "Target Resolution Policy".
>>
|
|
|
Re: Custom Outline View for HTML files [message #228065 is a reply to message #227937] |
Thu, 19 February 2009 17:31 |
|
Dominik Raymann wrote:
> Thanks Nitin for your reply.
>
>
> However, I'm really going to become desperate. Whatever I try, nothing
> seems to work.
>
> I tried as suggested (with ch.raymi.plugin being my Plugin ID):
>
> <extension
> point="org.eclipse.core.runtime.contentTypes">
> <content-type
> file-extensions="html"
> priority="high"
> name="BX HTML"
> id="bx"
> base-type="org.eclipse.wst.html.core.htmlsource"/>
> </extension>
>
> <extension
> point="org.eclipse.wst.sse.ui.editorConfiguration">
>
> <sourceViewerConfiguration
> class=ch.raymi.plugin.coder.StructuredTextViewerConfiguratio n "
> target="ch.raymi.plugin.bx" />
>
> <contentOutlineConfiguration
> class="ch.raymi.plugin.coder.outline.OutlineConfiguration"
> target="ch.raymi.plugin.bx"/>
>
> </extension>
>
> Neither my StructuredTextViewerConfiguration nor the
> OutlineConfiguration work with this configuration. If I change both
> targets to the super type "org.eclipse.wst.html.core.htmlsource" (as in
> my first attempt): the StructuredTextViewerConfiguration starts to work,
> the OutlineConfiguration does not.
>
> How can this asymmetrical behavior be explained? Why are the targets
> differently resolved?
>
> Is there a way I can debug this problem easily?
> Can you provide a working example (this should be easily reproducible,
> shouldn't it?)?
>
> Thank you very much for your help. I'd really like this to work...
I think part of it is that you're trying to grab the html filename
extension from your base content type. The Properties dialog on the
file should tell you which content type is winning--I'm betting not
yours.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Re: Custom Outline View for HTML files [message #228142 is a reply to message #228081] |
Sat, 21 February 2009 08:33 |
|
Dominik Raymann wrote:
> By now I think I have to provide a custom extension to
> org.eclipse.wst.sse.ui.adapterFactoryDescription, because it's how they
> do it in the cheat sheet tutorial. But I don't really like the idea of
> doing it (and I don't really see a reason why one have to do this, since
> it's so easy to provide a sourceViewerConfiguration but so hard to
> provide a contentOutlineConfiguration).
That shouldn't be necessary, after all, contentOutlineConfiguration
is the same extension point as sourceViewerConfiguration. If one
loads, the other should. Are you certain your content outline
configuration class is not being instantiated?
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: Custom Outline View for HTML files [message #228149 is a reply to message #228142] |
Sat, 21 February 2009 17:20 |
Dominik Raymann Messages: 37 Registered: July 2009 |
Member |
|
|
Nitin Dahyabhai schrieb:>
> That shouldn't be necessary, after all, contentOutlineConfiguration is
> the same extension point as sourceViewerConfiguration. If one loads,
> the other should. Are you certain your content outline configuration
> class is not being instantiated?
I'm quite sure. But because you made me uncertain, I started over (using
the Plugin Wizard) with a minimalistic example. I permit myself to
include all the files of this little test plugin at the end of this
post. When you run the plugin and create/open a file named test.html,
you'll see, that the constructor of the
StructuredTextViewerConfiguration is called, but the one of the
OutlineConfiguration is not.
-- MANIFEST.MF --
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyPlugin Plug-in
Bundle-SymbolicName: ch.raymi.plugin;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: ch.raymi.plugin.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.wst.sse.ui,
org.eclipse.wst.html.ui;bundle-version="1.0.301",
org.eclipse.jface.text;bundle-version="3.4.1",
org.eclipse.wst.xml.ui;bundle-version="1.0.410"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-- END OF MANIFEST.MF --
-- plugin.xml --
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.core.runtime.contentTypes">
<content-type
file-extensions="html"
priority="high"
name="BX HTML"
id="bx"
base-type="org.eclipse.wst.html.core.htmlsource"/>
<file-association
content-type="ch.raymi.plugin.bx"
file-names="test.html" />
</extension>
<extension
point="org.eclipse.wst.sse.ui.editorConfiguration">
<sourceViewerConfiguration
class="ch.raymi.plugin.StructuredTextViewerConfiguration"
target="ch.raymi.plugin.bx"/>
<contentOutlineConfiguration
class="ch.raymi.plugin.OutlineConfiguration"
target="ch.raymi.plugin.bx"/>
</extension>
</plugin>
-- END OF plugin.xml --
-- ch.raymi.plugin.Activator --
public class Activator extends AbstractUIPlugin {
Standard Implementation as generated by wizard
}
-- END OF ch.raymi.plugin.Activator --
-- ch.raymi.plugin.StructuredTextViewerConfiguration --
package ch.raymi.plugin;
import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTM L;
public class StructuredTextViewerConfiguration extends
StructuredTextViewerConfigurationHTML {
public StructuredTextViewerConfiguration() {
System.out.println("structured configuration called");
}
}
-- END OF ch.raymi.plugin.StructuredTextViewerConfiguration --
-- ch.raymi.plugin.OutlineConfiguration --
package ch.raymi.plugin;
import
org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutl ineConfiguration;
public class OutlineConfiguration extends HTMLContentOutlineConfiguration {
public OutlineConfiguration() {
System.out.println("outline configuration called");
}
}
-- END OF ch.raymi.plugin.OutlineConfiguration --
|
|
|
Re: Custom Outline View for HTML files [message #228164 is a reply to message #228149] |
Sun, 22 February 2009 04:45 |
|
It's really confusing. I suppose the next step is to trace through
org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder and see
why it's not choosing your outline configuration class. Luckily,
you have the source for that :)
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04060 seconds