How to remove toolwindow id ?

Hi,

  I have a toolwindow with id as "Cloud" and it has 2 tabs with name "Devices" and "DumpProperties".

Currently it is showing like this:-

I want to remove the id getting displayed here.But when i removed it from the plugin.xml,

the id displayed in the sidebar while opening it (given in the following pic) is also getting removed

The id in the sidebar should retain.Is there a solution for this?Please advise

0
5 comments
Avatar
Permanently deleted user

Please advice since i am in an urgent phase.

-1
Avatar
Permanently deleted user

You should setup tool window component like this:

toolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, Boolean.TRUE);

0
Avatar
Permanently deleted user

Hi,

I have changed the code like this:-

 

@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
this.toolWindow = toolWindow;
this.project = project;
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(windowContent, DEVICES_WINDOW_ID, false);
toolWindow.getContentManager().addContent(content);
toolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, Boolean.TRUE);
}



But still the toolwindow is showing its id.
0
Avatar
Permanently deleted user

Oh, sorry! This part of API is tricky and not friendly at all, sorry! Line order matters here and actually it works with String value "true", not Boolean value. Please rewrite your code like this:

@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
this.toolWindow = toolWindow;
this.project = project;
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(windowContent, DEVICES_WINDOW_ID, false);
toolWindow.getComponent.putClientProperty(ToolWindowContentUI.HIDE_ID_LABEL, "true");

toolWindow.getContentManager().addContent(content);
}
1
Avatar
Permanently deleted user

@Vassiliy It worked.Thanks for the help. :)

0

Please sign in to leave a comment.