Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » have xml content outline improvment, but...
have xml content outline improvment, but... [message #87701] Mon, 28 March 2005 10:38 Go to next message
Eclipse UserFriend
Hi wst's,

I made this simple addition to getLabelText of JFaceNodeAdapter:

/**
* Fetches the label text specific to this object instance.
*/
public String getLabelText(Object object) {

String result = getNodeName(object);
Node node = (Node) object;
Node firstAttribute = node.getAttributes().item(0);
if(firstAttribute!=null) {
return result + " " + firstAttribute.getNodeName() + "=\""
+ firstAttribute.getNodeValue() + "\"";
} else {
return result;
}
}

This basically makes the outline content much more usable since you can
now see
the first attribute of elements.

But for doing this I have 2 "issues":

1. This should probably be controlled by the user with an on-off button.
Can someone point me
in the direction on where xml outline content preferences should be
stored ? (I plan to just add
it as a option on the existing outline menu)

2. The content outline is not updated very often. Changing and attribute
does not refresh the outline view - is there
some way to make it update when attributes are added/removed ?

Thank you

-max
Re: have xml content outline improvment, but... [message #88221 is a reply to message #87701] Tue, 29 March 2005 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi there,

this mechanism is exactly the same used by the orangevolt xslt plugin
(http://eclipsexslt.sourceforge.net/) provided xml outline.

> 1. This should probably be controlled by the user with an on-off
> button. Can someone point me
> in the direction on where xml outline content preferences should be
> stored ? (I plan to just add
> it as a option on the existing outline menu)

have a look at the orangevolt xslt plugin source -
you can enable/disable the custom outline and configure it depending on
your document type/structure.

> 2. The content outline is not updated very often. Changing and
> attribute does not refresh the outline view - is there
> some way to make it update when attributes are added/removed ?

you can listen to the xml editor document to receive such changes.
but beware of it - it slows the editing really down. the best solution
for me was to provide an refresh button in the outline bar where the
user may decide manually to refresh the outline.

Many Regards,

Lars

Max Rydahl Andersen wrote:
> Hi wst's,
>
> I made this simple addition to getLabelText of JFaceNodeAdapter:
>
> /**
> * Fetches the label text specific to this object instance.
> */
> public String getLabelText(Object object) {
>
> String result = getNodeName(object);
> Node node = (Node) object;
> Node firstAttribute = node.getAttributes().item(0);
> if(firstAttribute!=null) {
> return result + " " + firstAttribute.getNodeName() + "=\""
> + firstAttribute.getNodeValue() + "\"";
> } else {
> return result;
> }
> }
>
> This basically makes the outline content much more usable since you can
> now see
> the first attribute of elements.
>
> But for doing this I have 2 "issues":
>
> 1. This should probably be controlled by the user with an on-off
> button. Can someone point me
> in the direction on where xml outline content preferences should be
> stored ? (I plan to just add
> it as a option on the existing outline menu)
>
> 2. The content outline is not updated very often. Changing and
> attribute does not refresh the outline view - is there
> some way to make it update when attributes are added/removed ?
>
> Thank you
>
> -max
Re: have xml content outline improvment, but... [message #88773 is a reply to message #88221] Wed, 30 March 2005 07:09 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

> have a look at the orangevolt xslt plugin source -
> you can enable/disable the custom outline and configure it depending on
> your document type/structure.

I looked at the eclipsexslt and it looks nice, but it is probably waay
overkill
for me to be dependent on xpath etc. to generate the labels.

>
> > 2. The content outline is not updated very often. Changing and
> > attribute does not refresh the outline view - is there
> > some way to make it update when attributes are added/removed ?
>
> you can listen to the xml editor document to receive such changes.
> but beware of it - it slows the editing really down. the best solution
> for me was to provide an refresh button in the outline bar where the
> user may decide manually to refresh the outline.

well, our JBossIDE xml editor doesnt seem to be much burdend with
notifications
and updating the outline, so I know it can be done for the simple case
(which I have here)

-max

> Many Regards,
>
> Lars
>
> Max Rydahl Andersen wrote:
>> Hi wst's,
>> I made this simple addition to getLabelText of JFaceNodeAdapter:
>> /**
>> * Fetches the label text specific to this object instance.
>> */
>> public String getLabelText(Object object) {
>> String result = getNodeName(object);
>> Node node = (Node) object;
>> Node firstAttribute = node.getAttributes().item(0);
>> if(firstAttribute!=null) {
>> return result + " " + firstAttribute.getNodeName() + "=\""
>> + firstAttribute.getNodeValue() + "\"";
>> } else {
>> return result;
>> }
>> }
>> This basically makes the outline content much more usable since you
>> can now see
>> the first attribute of elements.
>> But for doing this I have 2 "issues":
>> 1. This should probably be controlled by the user with an on-off
>> button. Can someone point me
>> in the direction on where xml outline content preferences should be
>> stored ? (I plan to just add
>> it as a option on the existing outline menu)
>> 2. The content outline is not updated very often. Changing and
>> attribute does not refresh the outline view - is there
>> some way to make it update when attributes are added/removed ?
>> Thank you
>> -max



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: have xml content outline improvment, but... [message #88872 is a reply to message #88773] Wed, 30 March 2005 08:33 Go to previous messageGo to next message
Eclipse UserFriend
Max Rydahl Andersen wrote:

> Hi,
>
>> have a look at the orangevolt xslt plugin source -
>> you can enable/disable the custom outline and configure it depending
>> on your document type/structure.
>
>
> I looked at the eclipsexslt and it looks nice, but it is probably waay
> overkill
> for me to be dependent on xpath etc. to generate the labels.

you do not depend on xpath - it is never used. the label is generated by just replacing @[attribute-name] with
[attribute-value]. where is the overkill ?

>
>>
>> > 2. The content outline is not updated very often. Changing and
>> > attribute does not refresh the outline view - is there
>> > some way to make it update when attributes are added/removed ?
>>
>> you can listen to the xml editor document to receive such changes.
>> but beware of it - it slows the editing really down. the best
>> solution for me was to provide an refresh button in the outline bar
>> where the user may decide manually to refresh the outline.
>
>
> well, our JBossIDE xml editor doesnt seem to be much burdend with
> notifications
> and updating the outline, so I know it can be done for the simple case
> (which I have here)
>
> -max
>
>> Many Regards,
>>
>> Lars
>>
>> Max Rydahl Andersen wrote:
>>
>>> Hi wst's,
>>> I made this simple addition to getLabelText of JFaceNodeAdapter:
>>> /**
>>> * Fetches the label text specific to this object instance.
>>> */
>>> public String getLabelText(Object object) {
>>> String result = getNodeName(object);
>>> Node node = (Node) object;
>>> Node firstAttribute = node.getAttributes().item(0);
>>> if(firstAttribute!=null) {
>>> return result + " " + firstAttribute.getNodeName() +
>>> "=\"" + firstAttribute.getNodeValue() + "\"";
>>> } else {
>>> return result;
>>> }
>>> }
>>> This basically makes the outline content much more usable since you
>>> can now see
>>> the first attribute of elements.
>>> But for doing this I have 2 "issues":
>>> 1. This should probably be controlled by the user with an on-off
>>> button. Can someone point me
>>> in the direction on where xml outline content preferences should
>>> be stored ? (I plan to just add
>>> it as a option on the existing outline menu)
>>> 2. The content outline is not updated very often. Changing and
>>> attribute does not refresh the outline view - is there
>>> some way to make it update when attributes are added/removed ?
>>> Thank you
>>> -max
>
>
>
>
Re: have xml content outline improvment, but... [message #89005 is a reply to message #88872] Wed, 30 March 2005 11:52 Go to previous messageGo to next message
Eclipse UserFriend
>
> you do not depend on xpath - it is never used. the label is generated by
> just replacing @[attribute-name] with
> [attribute-value]. where is the overkill ?

ok - sorry, placed to much in the @ syntax ,)

(but to my defense its still some overhead)

....anyhow if that is not the overhead then I still would like to
know why sending focused events on attribute changes is not done so
an outline can update accordingly.

/max

>>
>>>
>>> > 2. The content outline is not updated very often. Changing and
>>> > attribute does not refresh the outline view - is there
>>> > some way to make it update when attributes are added/removed ?
>>>
>>> you can listen to the xml editor document to receive such changes.
>>> but beware of it - it slows the editing really down. the best
>>> solution for me was to provide an refresh button in the outline bar
>>> where the user may decide manually to refresh the outline.
>> well, our JBossIDE xml editor doesnt seem to be much burdend with
>> notifications
>> and updating the outline, so I know it can be done for the simple case
>> (which I have here)
>> -max
>>
>>> Many Regards,
>>>
>>> Lars
>>>
>>> Max Rydahl Andersen wrote:
>>>
>>>> Hi wst's,
>>>> I made this simple addition to getLabelText of JFaceNodeAdapter:
>>>> /**
>>>> * Fetches the label text specific to this object instance.
>>>> */
>>>> public String getLabelText(Object object) {
>>>> String result = getNodeName(object);
>>>> Node node = (Node) object;
>>>> Node firstAttribute = node.getAttributes().item(0);
>>>> if(firstAttribute!=null) {
>>>> return result + " " + firstAttribute.getNodeName() +
>>>> "=\"" + firstAttribute.getNodeValue() + "\"";
>>>> } else {
>>>> return result;
>>>> }
>>>> }
>>>> This basically makes the outline content much more usable since you
>>>> can now see
>>>> the first attribute of elements.
>>>> But for doing this I have 2 "issues":
>>>> 1. This should probably be controlled by the user with an on-off
>>>> button. Can someone point me
>>>> in the direction on where xml outline content preferences should
>>>> be stored ? (I plan to just add
>>>> it as a option on the existing outline menu)
>>>> 2. The content outline is not updated very often. Changing and
>>>> attribute does not refresh the outline view - is there
>>>> some way to make it update when attributes are added/removed ?
>>>> Thank you
>>>> -max
>>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: have xml content outline improvment, but... [message #89096 is a reply to message #89005] Thu, 31 March 2005 03:55 Go to previous message
Eclipse UserFriend
max,

i still think the current behaviour (no outline update for attributes) is acceptable for most users.
When you open a really large xml document it will slow down eclipse so much that you will thank god
for not updating the outline because of a attribute change.

By the way - if you dont like, just change it:

A xml editor preference for justifying the outline behaviour
would be a nice contribution.

Many Regards,

Lars

Max Rydahl Andersen wrote:
>>
>> you do not depend on xpath - it is never used. the label is generated
>> by just replacing @[attribute-name] with
>> [attribute-value]. where is the overkill ?
>
>
> ok - sorry, placed to much in the @ syntax ,)
>
> (but to my defense its still some overhead)
>
> ...anyhow if that is not the overhead then I still would like to
> know why sending focused events on attribute changes is not done so
> an outline can update accordingly.
>
> /max
>
>>>
>>>>
>>>> > 2. The content outline is not updated very often. Changing and
>>>> > attribute does not refresh the outline view - is there
>>>> > some way to make it update when attributes are added/removed ?
>>>>
>>>> you can listen to the xml editor document to receive such changes.
>>>> but beware of it - it slows the editing really down. the best
>>>> solution for me was to provide an refresh button in the outline
>>>> bar where the user may decide manually to refresh the outline.
>>>
>>> well, our JBossIDE xml editor doesnt seem to be much burdend with
>>> notifications
>>> and updating the outline, so I know it can be done for the simple
>>> case (which I have here)
>>> -max
>>>
>>>> Many Regards,
>>>>
>>>> Lars
>>>>
>>>> Max Rydahl Andersen wrote:
>>>>
>>>>> Hi wst's,
>>>>> I made this simple addition to getLabelText of JFaceNodeAdapter:
>>>>> /**
>>>>> * Fetches the label text specific to this object instance.
>>>>> */
>>>>> public String getLabelText(Object object) {
>>>>> String result = getNodeName(object);
>>>>> Node node = (Node) object;
>>>>> Node firstAttribute = node.getAttributes().item(0);
>>>>> if(firstAttribute!=null) {
>>>>> return result + " " + firstAttribute.getNodeName() +
>>>>> "=\"" + firstAttribute.getNodeValue() + "\"";
>>>>> } else {
>>>>> return result;
>>>>> }
>>>>> }
>>>>> This basically makes the outline content much more usable since
>>>>> you can now see
>>>>> the first attribute of elements.
>>>>> But for doing this I have 2 "issues":
>>>>> 1. This should probably be controlled by the user with an on-off
>>>>> button. Can someone point me
>>>>> in the direction on where xml outline content preferences should
>>>>> be stored ? (I plan to just add
>>>>> it as a option on the existing outline menu)
>>>>> 2. The content outline is not updated very often. Changing and
>>>>> attribute does not refresh the outline view - is there
>>>>> some way to make it update when attributes are added/removed ?
>>>>> Thank you
>>>>> -max
>>>
>>>
>
>
>
Previous Topic:Initial XSLT Plugin contribution released
Next Topic:Using Eclipse for Web Services?
Goto Forum:
  


Current Time: Thu May 01 00:59:43 EDT 2025

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

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

Back to the top