Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » Extending XML Content Assist
Extending XML Content Assist [message #73913] Mon, 14 February 2005 19:57 Go to next message
Eclipse UserFriend
Along with the validation extensions I've been asking about, I also need
to extend content assist so that the schema-based content assist is still
present, but with additional proposals supplied by moi.

It looks as though I might be able to:
1) subclass XMLContentAssistProcessor
2) override computeContentProposals, computeAttributeValueProposals etc.,
calling the inherited method, and adding proposals to the
ContentAssistRequest.
3) subclass StructuredTextViewerConfigurationXML and replace the
implementation of getContentAssistant() wholesale. Suggestion: perhaps a
factory method for the XMLContentProcessor, so I don't have to copy all
the partition stuff?
4) Specify my configuration subclass using the extension point
org.eclipse.wst.sse.ui.extendedconfiguration. Will this work to replace
the configuration object with my own, or is there some other mechanism I
should use?

Does this seem like the correct approach?

Thanks!

- Richard
Re: Extending XML Content Assist [message #74124 is a reply to message #73913] Tue, 15 February 2005 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Richard Rodseth wrote:
> Along with the validation extensions I've been asking about, I also need
> to extend content assist so that the schema-based content assist is
> still present, but with additional proposals supplied by moi.
>
> It looks as though I might be able to:
> 1) subclass XMLContentAssistProcessor
> 2) override computeContentProposals, computeAttributeValueProposals
> etc., calling the inherited method, and adding proposals to the
> ContentAssistRequest.
> 3) subclass StructuredTextViewerConfigurationXML and replace the
> implementation of getContentAssistant() wholesale. Suggestion: perhaps a
> factory method for the XMLContentProcessor, so I don't have to copy all
> the partition stuff?
> 4) Specify my configuration subclass using the extension point
> org.eclipse.wst.sse.ui.extendedconfiguration. Will this work to replace
> the configuration object with my own, or is there some other mechanism I
> should use?
>
> Does this seem like the correct approach?

Is this for .xml files or some custom file type? For .xml files, we
haven't yet defined a way to contribute proposals to our existing
Content Assist. and the behavior with conflicting
org.eclipse.wst.sse.ui.extendedconfiguration extensions is undefined.

--
- Nitin
Re: Extending XML Content Assist [message #74142 is a reply to message #74124] Tue, 15 February 2005 14:58 Go to previous messageGo to next message
Eclipse UserFriend
<snip!>
>
>
> Is this for .xml files or some custom file type? For .xml files, we
> haven't yet defined a way to contribute proposals to our existing
> Content Assist. and the behavior with conflicting
> org.eclipse.wst.sse.ui.extendedconfiguration extensions is undefined.
>

I dunno about Richard but I'm looking at the same thing for xml files.
I've been blundering along with my own content type that is subordinate
to the xml content type.

I think that this use case will come up a lot and a strategy for
contributing proposals and reconciling conflicting
org.eclipse.wst.sse.ui.extendedconfiguration extensions should be a
priority.

(I know that people are hankering for the flexible project structure
work - kudos for the progress so far. But in my mind I don't really care
about that. If it's there and it works fine, but I need to be able to
extend the beahaviour of things like content assist now).

Geoff
Re: Extending XML Content Assist [message #74160 is a reply to message #74142] Tue, 15 February 2005 17:34 Go to previous messageGo to next message
Eclipse UserFriend
In my case, the file suffixes aren't determined yet, but the editor
wouldn't need to edit arbitrary XML.

- Richard

Geoff Longman wrote:

> <snip!>
>>
>>
>> Is this for .xml files or some custom file type? For .xml files, we
>> haven't yet defined a way to contribute proposals to our existing
>> Content Assist. and the behavior with conflicting
>> org.eclipse.wst.sse.ui.extendedconfiguration extensions is undefined.
>>

> I dunno about Richard but I'm looking at the same thing for xml files.
> I've been blundering along with my own content type that is subordinate
> to the xml content type.

> I think that this use case will come up a lot and a strategy for
> contributing proposals and reconciling conflicting
> org.eclipse.wst.sse.ui.extendedconfiguration extensions should be a
> priority.

> (I know that people are hankering for the flexible project structure
> work - kudos for the progress so far. But in my mind I don't really care
> about that. If it's there and it works fine, but I need to be able to
> extend the beahaviour of things like content assist now).

> Geoff
Re: Extending XML Content Assist [message #74176 is a reply to message #74124] Tue, 15 February 2005 17:55 Go to previous messageGo to next message
Eclipse UserFriend
I wrote up a bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=85348

Thanks
- Richard

Nitin Dahyabhai wrote:

> Richard Rodseth wrote:
>> Along with the validation extensions I've been asking about, I also need
>> to extend content assist so that the schema-based content assist is
>> still present, but with additional proposals supplied by moi.
>>
>> It looks as though I might be able to:
>> 1) subclass XMLContentAssistProcessor
>> 2) override computeContentProposals, computeAttributeValueProposals
>> etc., calling the inherited method, and adding proposals to the
>> ContentAssistRequest.
>> 3) subclass StructuredTextViewerConfigurationXML and replace the
>> implementation of getContentAssistant() wholesale. Suggestion: perhaps a
>> factory method for the XMLContentProcessor, so I don't have to copy all
>> the partition stuff?
>> 4) Specify my configuration subclass using the extension point
>> org.eclipse.wst.sse.ui.extendedconfiguration. Will this work to replace
>> the configuration object with my own, or is there some other mechanism I
>> should use?
>>
>> Does this seem like the correct approach?

> Is this for .xml files or some custom file type? For .xml files, we
> haven't yet defined a way to contribute proposals to our existing
> Content Assist. and the behavior with conflicting
> org.eclipse.wst.sse.ui.extendedconfiguration extensions is undefined.
Re: Extending XML Content Assist [message #74304 is a reply to message #74176] Wed, 16 February 2005 04:14 Go to previous messageGo to next message
Eclipse UserFriend
Richard Rodseth wrote:
> I wrote up a bug:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=85348
just added my comment:
-----------------------------
In my case I have an element
<include ref="X"/> with X being a path to a file in the workspace. eg
"/Shared/
Ontology/test.scp". So I would need a way to define the possible paths
and names
of diretories in this ref="" attribute.

Another use for me is that we have an element like <e>X</e>. With X
being some
kind of linguistic expression. The keyword is here a "~" that references
something that is used before in files.

In Short: a way to make code completion within ref="...". And a code
completion
triggered by a "~" within the <e>...</e> elements.

Would be great to add this "custom" code completion easily to the existing
schema based code completion of the StructuredTextEditorXML.
------------------------------

And in my case it is NOT for xml endings - rather for "scp" and "sct"
endings. Is that in any way different? (Guess YES). And how would be a
possible approach to implement the mendioned functionality?

Thanks a lot,

Raphael
Re: Extending XML Content Assist [message #74376 is a reply to message #74304] Wed, 16 February 2005 09:24 Go to previous message
Eclipse UserFriend
Just added my comment:
>>>
Raphael's example of a path value attribute is one I was going to suggest.
For elements, an example might be the Ant editor, where you would want
contributed tasks to show up as tag proposals, while the built-in tasks
would be covered by the schema.

The chain-of-processors idea is interesting if performance doesn't suffer.
I suppose you could have an extension point that referred to a base
processor. In the short term, I think I would be content with a
nicely-factored base processor class to derive from (it doesn't look too
bad right now) and a way for an editor to replace the processor that's
configured by default.
<<<
Previous Topic:What plugins are needed to make servlets, jsp and webapps on a server
Next Topic:Content assist in JSP-tags
Goto Forum:
  


Current Time: Sat Jun 14 16:29:21 EDT 2025

Powered by FUDForum. Page generated in 0.04336 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top