Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to change the title of Eclipse's window.
How to change the title of Eclipse's window. [message #280312] Tue, 01 February 2005 20:25 Go to next message
Pelle Svensson is currently offline Pelle SvenssonFriend
Messages: 77
Registered: July 2009
Member
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 #280328 is a reply to message #280312] Wed, 02 February 2005 01:11 Go to previous messageGo to next message
John Austin is currently offline John AustinFriend
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 messageGo to next message
Pelle Svensson is currently offline Pelle SvenssonFriend
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 messageGo to next message
Eclipse UserFriend
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 #280431 is a reply to message #280398] Thu, 03 February 2005 12:08 Go to previous messageGo to next message
Pelle Svensson is currently offline Pelle SvenssonFriend
Messages: 77
Registered: July 2009
Member
No, I don't think so. I'm only interested in Eclipse as a
development tool for C/C++ embedded development. For convenience
I would like the title reflecting full path instead of name
for each file that is open in Eclipse. Full path is displayed
in the tooltip and in the project but it is not handy.

I have added all extra functionality I need in a plugg-in and
now the only thing left is the title until the platform fulfill
what I need.


CL [dnoyeb] Gilbert wrote:
> 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
Pelle Svensson is currently offline Pelle SvenssonFriend
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.
>>
Previous Topic:TeamProvider getFileModificationValidator() method never called
Next Topic:[OT] Ant Classfileset Question
Goto Forum:
  


Current Time: Wed Jul 17 17:27:14 GMT 2024

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

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

Back to the top