|
Re: How to change the title of Eclipse's window. [message #280328 is a reply to message #280312] |
Wed, 02 February 2005 01:11 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
John Austin![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=jwaustin%40nl.rogers.com) Messages: 34 Registered: July 2009 |
Member |
|
|
SpeedadeYxan wrote:
>
> Hi,
>
> Anyone who can give me a hint where to start looking.
I'm gonna look like a freakin' genius here because I still
have some breakpoints from my travels through AbstractTextEditor.
Look near line 777 of IDEWorkbenchAdvisor.updateTitle(IWorkbenchWindow).
I found this by reasoning that Shell.setText() produces that title and
setting a breakpoint in that function. When I ran Vex or the Text Editor
and renamed a file using the Eclipse menu Action for Rename, the code
hit that breakpoint.
That does NOT solve my problem but my Vex behavior complies with the
Text Editor, so I'm happy and figure it's a framework bug.
One could decide whether this IS an Eclipse bug by looking at a few
other editors, like the Plugin Editor and the Java Editor. When I
get around to checking that out, I will report the problem.
> I would like to change the application title at the top
> of the Eclipse window.
>
> Today it shows:
>
> <perspective> - <edit file> - Eclipse Platfirm
> C/C++ - main.c - Eclipse Platfirm
>
> I would like to change that to include full path:
>
> C/C++ - /home/user/src/testapp/main.c - Eclipse Platform
>
>
> I need to find out where I can add an Listener for all
> the type of editors. Then when an event occurs, check
> editor type and file, modify the title and display.
>
> All plug-in coding stuff are under control
> except where to find the event.
>
> Any one who can bring some light on this.
If you have the budget or are handy to a Barnes and Noble,
Chapters or equivalent, check in "The Java Developers
Guide to Eclipse". The 1st edition doesn't quite have the
details I needed for this and the sample index from the book
indicates there have been changes. I am in St John's
Newfoundland and the Java section of the local bookstore
is a bit thin.
|
|
|
Re: How to change the title of Eclipse's window. [message #280359 is a reply to message #280328] |
Wed, 02 February 2005 14:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Pelle Svensson![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=pelle2004%40hotmail.com) Messages: 77 Registered: July 2009 |
Member |
|
|
Hi,
Thanks for your advice.
I don't know what is the best thing to do now.
1. Is it possible to make a plug-in Editor which will implement a new getTitle()
returning the location path instead of file name. I'm particular only interested
in the C/C++ editor class.
IWorkbenchPage currentPage = window.getActivePage();
if (currentPage != null) {
IEditorPart editor = currentPage.getActiveEditor();
if (editor != null) {
String editorTitle = editor.getTitle(); <-----
title = IDEWorkbenchMessages
.format(
"WorkbenchWindow.shellTitle", new Object[] { editorTitle, title }); //$NON-NLS-1$
}
2. Second solution maybe is a new version of CDT C/C++ package which has another
getTitle().
3. Third solution is a hook function in the correct position catching an event
which could trigger a function which will set the tittle.
My approach may be odd and that is due to I'm normally not 100% occupied with Java.
C and C++ is my main target normally. That doesn't mean I'm against Java, it is a
pretty nice language.
/Thanks
Java
John Austin wrote:
> SpeedadeYxan wrote:
>
>>
>> Hi,
>>
>> Anyone who can give me a hint where to start looking.
>
>
> I'm gonna look like a freakin' genius here because I still
> have some breakpoints from my travels through AbstractTextEditor.
>
> Look near line 777 of IDEWorkbenchAdvisor.updateTitle(IWorkbenchWindow).
>
> I found this by reasoning that Shell.setText() produces that title and
> setting a breakpoint in that function. When I ran Vex or the Text Editor
> and renamed a file using the Eclipse menu Action for Rename, the code
> hit that breakpoint.
>
> That does NOT solve my problem but my Vex behavior complies with the
> Text Editor, so I'm happy and figure it's a framework bug.
>
> One could decide whether this IS an Eclipse bug by looking at a few
> other editors, like the Plugin Editor and the Java Editor. When I
> get around to checking that out, I will report the problem.
>
>> I would like to change the application title at the top
>> of the Eclipse window.
>>
>> Today it shows:
>>
>> <perspective> - <edit file> - Eclipse Platfirm
>> C/C++ - main.c - Eclipse Platfirm
>>
>> I would like to change that to include full path:
>>
>> C/C++ - /home/user/src/testapp/main.c - Eclipse Platform
>>
>>
>> I need to find out where I can add an Listener for all
>> the type of editors. Then when an event occurs, check
>> editor type and file, modify the title and display.
>>
>> All plug-in coding stuff are under control
>> except where to find the event.
>>
>> Any one who can bring some light on this.
>
>
> If you have the budget or are handy to a Barnes and Noble,
> Chapters or equivalent, check in "The Java Developers
> Guide to Eclipse". The 1st edition doesn't quite have the
> details I needed for this and the sample index from the book
> indicates there have been changes. I am in St John's
> Newfoundland and the Java section of the local bookstore
> is a bit thin.
>
|
|
|
Re: How to change the title of Eclipse's window. [message #280398 is a reply to message #280312] |
Wed, 02 February 2005 23:57 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Are you making an RCP application here?
SpeedadeYxan wrote:
>
> Hi,
>
> Anyone who can give me a hint where to start looking.
>
> I would like to change the application title at the top
> of the Eclipse window.
>
> Today it shows:
>
> <perspective> - <edit file> - Eclipse Platfirm
> C/C++ - main.c - Eclipse Platfirm
>
> I would like to change that to include full path:
>
> C/C++ - /home/user/src/testapp/main.c - Eclipse Platform
>
>
> I need to find out where I can add an Listener for all
> the type of editors. Then when an event occurs, check
> editor type and file, modify the title and display.
>
> All plug-in coding stuff are under control
> except where to find the event.
>
> Any one who can bring some light on this.
>
> /Thanks
>
|
|
|
|
Re: How to change the title of Eclipse's window. [message #280467 is a reply to message #280359] |
Thu, 03 February 2005 19:00 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Pelle Svensson![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=pelle2004%40hotmail.com) Messages: 77 Registered: July 2009 |
Member |
|
|
It is now upp and running!
Thanks John.
SpeedadeYxa wrote:
> Hi,
>
> Thanks for your advice.
>
> I don't know what is the best thing to do now.
>
> 1. Is it possible to make a plug-in Editor which will implement a new
> getTitle()
> returning the location path instead of file name. I'm particular only
> interested
> in the C/C++ editor class.
>
> IWorkbenchPage currentPage = window.getActivePage();
> if (currentPage != null) {
> IEditorPart editor = currentPage.getActiveEditor();
> if (editor != null) {
> String editorTitle = editor.getTitle(); <-----
> title = IDEWorkbenchMessages
> .format(
> "WorkbenchWindow.shellTitle", new
> Object[] { editorTitle, title }); //$NON-NLS-1$
> }
>
> 2. Second solution maybe is a new version of CDT C/C++ package which has
> another
> getTitle().
>
> 3. Third solution is a hook function in the correct position catching an
> event
> which could trigger a function which will set the tittle.
>
> My approach may be odd and that is due to I'm normally not 100% occupied
> with Java.
> C and C++ is my main target normally. That doesn't mean I'm against
> Java, it is a
> pretty nice language.
>
>
> /Thanks
>
> Java
>
> John Austin wrote:
>
>> SpeedadeYxan wrote:
>>
>>>
>>> Hi,
>>>
>>> Anyone who can give me a hint where to start looking.
>>
>>
>>
>> I'm gonna look like a freakin' genius here because I still
>> have some breakpoints from my travels through AbstractTextEditor.
>>
>> Look near line 777 of IDEWorkbenchAdvisor.updateTitle(IWorkbenchWindow).
>>
>> I found this by reasoning that Shell.setText() produces that title and
>> setting a breakpoint in that function. When I ran Vex or the Text Editor
>> and renamed a file using the Eclipse menu Action for Rename, the code
>> hit that breakpoint.
>>
>> That does NOT solve my problem but my Vex behavior complies with the
>> Text Editor, so I'm happy and figure it's a framework bug.
>>
>> One could decide whether this IS an Eclipse bug by looking at a few
>> other editors, like the Plugin Editor and the Java Editor. When I
>> get around to checking that out, I will report the problem.
>>
>>> I would like to change the application title at the top
>>> of the Eclipse window.
>>>
>>> Today it shows:
>>>
>>> <perspective> - <edit file> - Eclipse Platfirm
>>> C/C++ - main.c - Eclipse Platfirm
>>>
>>> I would like to change that to include full path:
>>>
>>> C/C++ - /home/user/src/testapp/main.c - Eclipse Platform
>>>
>>>
>>> I need to find out where I can add an Listener for all
>>> the type of editors. Then when an event occurs, check
>>> editor type and file, modify the title and display.
>>>
>>> All plug-in coding stuff are under control
>>> except where to find the event.
>>>
>>> Any one who can bring some light on this.
>>
>>
>>
>> If you have the budget or are handy to a Barnes and Noble,
>> Chapters or equivalent, check in "The Java Developers
>> Guide to Eclipse". The 1st edition doesn't quite have the
>> details I needed for this and the sample index from the book
>> indicates there have been changes. I am in St John's
>> Newfoundland and the Java section of the local bookstore
>> is a bit thin.
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03939 seconds