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

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

Back to the top