Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] Dynamically change the title of editor's tabs

You can add a tag to the model element. Every tag is CSS class. See https://www.vogella.com/tutorials/Eclipse4CSS/article.html

On Fri, Jun 14, 2019 at 1:21 PM Arian Fornaris <boniatillo@xxxxxxxxx> wrote:

Hi, I did it. But now I want more :). I want to change the color of the tab. I guess the best way is to set a property to the part model and apply the right style it in the CSS of the theme. I will google about it.

Thanks!

Arian





On 6/13/19 7:55 AM, Lars Vogel wrote:
Hi Arian,

you can also use the e4 API. See
https://www.vogella.com/tutorials/Eclipse4Services/article.html#model-service

part.setLabel("New Label") should do the trick, after you got the part
via the model or part service.

Best regards, Lars

On Thu, Jun 13, 2019 at 1:49 PM Ed Merks <ed.merks@xxxxxxxxx> wrote:
Arian,

You should look at what editors do when you do File -> Save As.  E.g.,
in EMF's generated editors I do this:

         IFileEditorInput modelFile = new FileEditorInput(file);
         setInputWithNotify(modelFile);
         setPartName(file.getName());

Which call
org.eclipse.ui.part.EditorPart.setInputWithNotify(IEditorInput) and
org.eclipse.ui.part.EditorPart.setPartName(String) which are protected
methods; file is the IFile to which I saved.

Regards,
Ed
_______________________________________________
platform-dev mailing list
platform-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/platform-dev


--
Eclipse Platform project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com

Back to the top