Is there a way to programmatically change the color of an editor tab in my Eclipse Plugin? - eclipse

I have a SharedHeaderFormEditor in my Eclipse RCP plugin.
One of my requirements is to draw attention to the editor's tab when something happens outside of the editor and it needs a refresh.
Some of the ideas discussed included
changing the color of the tab
adding an icon to the editor's text (instead of the standard * for a dirty editor)
Are either of those possible? I've been looking around and have not found anything that could address this issue.
Thanks!

ViewPart and EditorPart both allow changing the title label and icon (setPartName(…) and setTitleImage(…) respectively). The Eclipse Workbench also offers an IWorkbenchPartProgressService to each part, which allows a part to indicate that it's busy (via incrementBusy()/decrementBusy()) and that its content has changed (via warnOfContentChange()). You can see this used in the Search and Console views (org.eclipse.search2.internal.ui.SearchView and org.eclipse.ui.internal.console.ConsoleView).

Related

Terminal is on top of vscode explorer [duplicate]

Is there a way to make terminal span the entire width of the application without closing the sidenav? I use it quite a bit, and often I have to hide the sidenav in order to see it in full width. It would be great if I could set it up so the sidenav is just alongside the editor, allowing terminal to take up the full width of the application.
This is in Stable v1.64 now.
Go to View/Appearance/Align Panel/Justify or use the Layout Control icon on the upper right mentioned below.
Other options for the Panel alignment are center/left/right.
Note that that the Layout icon on the upper right was recently added with this setting:
Workbench > Layout Control: Enabled
Also, as of v1.75 this can be done via the context menu for the Panel. Right-click on an open space of the Panel to the right of the View headers to open the context menu:
See Release Notes: Manage Panel Alignment
It's already available since version 1.64.
Let's switch to Justify option.
**Unfortunately, it is not possible at the moment.
There is a ticket for this feature in the VSCode repository - https://github.com/microsoft/vscode/issues/42149
UPDATE:
It's already available since version 1.64.
See other answers below for more information

Is there a way to make the terminal in VSCode take up the entire width of the application even if the sidebar is open?

Is there a way to make terminal span the entire width of the application without closing the sidenav? I use it quite a bit, and often I have to hide the sidenav in order to see it in full width. It would be great if I could set it up so the sidenav is just alongside the editor, allowing terminal to take up the full width of the application.
This is in Stable v1.64 now.
Go to View/Appearance/Align Panel/Justify or use the Layout Control icon on the upper right mentioned below.
Other options for the Panel alignment are center/left/right.
Note that that the Layout icon on the upper right was recently added with this setting:
Workbench > Layout Control: Enabled
Also, as of v1.75 this can be done via the context menu for the Panel. Right-click on an open space of the Panel to the right of the View headers to open the context menu:
See Release Notes: Manage Panel Alignment
It's already available since version 1.64.
Let's switch to Justify option.
**Unfortunately, it is not possible at the moment.
There is a ticket for this feature in the VSCode repository - https://github.com/microsoft/vscode/issues/42149
UPDATE:
It's already available since version 1.64.
See other answers below for more information

How can I customize the "jumping" from the Eclipse problems view?

I am trying to customize the way double clicking works in the ProblemsView for my RCP application. Right now, the resource is set to a file and the location is set to a line number. That works great for a text-based editor, but I am creating a multipage form based editor.
How can I change the behavior of the ProblemsView so that I can get in the middle of the double clicking and the jumping and interpret the location (or some other marker attribute) so that my form editor will respond in the right way?
Implement an IGotoMarker adapter for your editor, and then handle it how you will.
http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/ide/IGotoMarker.html

Eclipse GEF graphical editor without header

I am developing RCP plug-in with GEF framework.
I've created basic graphical editor (GraphicalEditor and IEditorInput)
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(new TEditorInput("T"), TGraphicalEditor.ID,false);
When I run the application I get editor with a header that contains the tab with the name of the editor and control buttons to maximize and minimize the editor.
What I need is to display just the editor, without the header.
Can it be done?
To my knowledge, it is not possible to just hide an editor's tab.
However, you can try two workarounds:
Have your GEF editor be displayed in an Eclipse view instead of an editor and open such a view as a standalone view. An example of how to open a GEF diagram in a view can be found in GEF's Directed Graph Example. An example of how to open a view as standalone can be found in one the Eclipse RCP official tutorials.
Extend the presentation factories extension point to control how workbench parts are displayed (which includes control over the part stack tab).
I suggest you try the first approach, as to me it seems easier to implement.
The idea with editors is that you can instantiate them multiply for different editor inputs. I am not aware of any way to restrict the number of open editors to just one (well, it appears you can in Eclipse 4.2 if that helps you)
For views, what you want can be done by setting the perspective to fixed and set showTitle of the org.eclipse.ui.perspectiveExtensions extension to false on the view. Maybe you can use a view instead of an editor and control the editor input yourself?
(For example, using an editor, the default Open action would instantiate a new editor, while you probably want to replace the contents in your only editor, right?)

Is that possible to show info about class which is currently editing?

In intelliJ IDEA I can always see what class I'm working on because of clear path to this class shown in the top bar. Is there a possibility to have something like that in Eclipse?
Yes. You can turn on "breadcrumbs" in the Java editor. I can never remember the key binding, but there's a button for it on the default toolbar.
Alternatively, you can have either the Project Explorer or the Package Explorer (depending on which you prefer/use) link with the editor so that the currently edited file is always shown in those views. It's the button on the view toolbar with the two yellow arrows.