Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to set the editor title?
How to set the editor title? [message #498014] Fri, 13 November 2009 17:01 Go to next message
Wok Show is currently offline Wok Show
Messages: 40
Registered: July 2009
Member
hi everybody,

I have a view and an editor. in the view is a tableviewer which shows all the data of my xmi-model. if i doubleclick on it, the editor will open with the description of the selected item.

So my problem is, i want to set the title with the name of the item. how can i implement it?

the default title of this editor can i set in the plugin.xml.

please help

greetz d.chau
Re: How to set the editor title? [message #498035 is a reply to message #498014] Fri, 13 November 2009 18:20 Go to previous messageGo to next message
martin is currently offline martin
Messages: 12
Registered: July 2009
Junior Member
normally you would use your editorinput for this?

Martin
Re: How to set the editor title? [message #498045 is a reply to message #498014] Fri, 13 November 2009 20:36 Go to previous messageGo to next message
Wok Show is currently offline Wok Show
Messages: 40
Registered: July 2009
Member
hi martin,

yeah the selected item on the tableviewer will give as editorinput to the page.openEditor. but the title for the selected item is not setted on the editor title.
Re: How to set the editor title? [message #498062 is a reply to message #498014] Sat, 14 November 2009 00:21 Go to previous messageGo to next message
Eclipse User
Originally posted by: wangqs_eclipse.yahoo.com

This is a multi-part message in MIME format.
--------------010006090108020402030403
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Try this method.
EditorPart:setPartName(String partName)

Q.S. Wang

Chau wrote:
> hi everybody,
>
> I have a view and an editor. in the view is a tableviewer which shows
> all the data of my xmi-model. if i doubleclick on it, the editor will
> open with the description of the selected item.
> So my problem is, i want to set the title with the name of the item. how
> can i implement it?
>
> the default title of this editor can i set in the plugin.xml.
>
> please help
>
> greetz d.chau


--------------010006090108020402030403
Content-Type: text/x-vcard; charset=utf-8;
name="wangqs_eclipse.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="wangqs_eclipse.vcf"

YmVnaW46dmNhcmQNCmVtYWlsO2ludGVybmV0Ondhbmdxc19lY2xpcHNlQHlh aG9vLmNvbQ0K
dXJsOmh0dHA6Ly93d3cubXllY2xpcHNlZGV2LmNvbQ0KdmVyc2lvbjoyLjEN CmVuZDp2Y2Fy
ZA0KDQo=
--------------010006090108020402030403--
Re: How to set the editor title? [message #498079 is a reply to message #498014] Sat, 14 November 2009 10:36 Go to previous messageGo to next message
Wok Show is currently offline Wok Show
Messages: 40
Registered: July 2009
Member
hi eclipse user,

i tried this, it works but if i want to do this dynamic for the selected item, how can i do this?

because i implement and handler for the doubleclicking via extension points and the editor too.

so if i click on the item in the tableviewer the HandlerService starts and call the method

page.openEditor(input, MyEditor.ID);

and it set the default name in the plugin.xml. how can I set on this place the selected item name?
Re: Re: How to set the editor title? [message #498197 is a reply to message #498079] Sun, 15 November 2009 19:50 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Chau,

It is like Q.S. Wang said. there is a method call setPartName(String). You
must call that in you init or wherever.

Regards,

Wim Jongman


> hi eclipse user,
>
> i tried this, it works but if i want to do this dynamic for the selected
item, how can i do this?
>
> because i implement and handler for the doubleclicking via extension points
and the editor too.
>
> so if i click on the item in the tableviewer the HandlerService starts and
call the method
>
> page.openEditor(input, MyEditor.ID);
>
> and it set the default name in the plugin.xml. how can I set on this place
the selected item name?
Re: How to set the editor title? [message #498226 is a reply to message #498079] Mon, 16 November 2009 01:24 Go to previous message
Eclipse User
Originally posted by: wangqs_eclipse.yahoo.com

Chau wrote:
> hi eclipse user,
>
> i tried this, it works but if i want to do this dynamic for the selected
> item, how can i do this?
>
> because i implement and handler for the doubleclicking via extension
> points and the editor too.
>
> so if i click on the item in the tableviewer the HandlerService starts
> and call the method
>
> page.openEditor(input, MyEditor.ID);
>
> and it set the default name in the plugin.xml. how can I set on this
> place the selected item name?
>

Chau,
Well there's no guarantee, but at least AbstractTextEditor is using
input.getName as the title. Please try to return the description of the
item there in the getName() method if the input is written by you.

Q.S. Wang
http://www.myeclipsedev.com/
Previous Topic:I dont know how to use the IProgressMonitor stop button :(
Next Topic:How to set an editor unmodifiable?
Goto Forum:
  


Current Time: Mon Sep 15 09:40:21 GMT 2014

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

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