StatusBarWidget.TextPresentation does not return tooltip in Intellij 2023

已回答

I am trying to create a plugin in java for IntelliJ version 2023. When I want to create a status bar widget with some tooltip text but I cannot make it work. It shows the desired text in status bar but no tooltip on mouse hover. But if I change platform version to 2022 in the developments properties when debugging it works and the tooltip is showing on mouse hover.
I cannot find any examples how to make it work on IntelliJ 2023.

Can you please tell me what changed from version 2022 to version 2023 regarding the creation of status bar widgets.

My classes looks like this

 

public class MyWidget implements StatusBarWidget{
private StatusBar myStatusBar;

@Override
public void install(@NotNull StatusBar statusBar) {
myStatusBar = statusBar;
}

@Override
public @NotNull @NonNls String ID() {
return "PluginID";
}

@Override
public @NotNull WidgetPresentation getPresentation() {
return new PluginStatusBar();
}

@Override
public void dispose() {
}

}

public class PluginStatusBar implements StatusBarWidget.TextPresentation {

@Override
public @NotNull String getTooltipText() {
return "Tooltip Text";
}

@Override
public Consumer<MouseEvent> getClickConsumer() {
return null;
}

@Override
public float getAlignment() {
return 0;
}

@NotNull
@Override
public String getText() {
return "plugin";
}
}

public class  WidgetFactory implements StatusBarWidgetFactory {

@Override
public @NotNull @NonNls String getId() {
return "PluginID";
}

@Override
public @NotNull @NlsContexts.ConfigurableName String getDisplayName() {
return "Plugin";
}

@Override
public boolean isAvailable(@NotNull Project project) {
return true;
}

@Override
public @NotNull StatusBarWidget createWidget(@NotNull Project project) {
return new MyWidget();
}

@Override
public void disposeWidget(@NotNull StatusBarWidget widget) {
}

@Override
public boolean canBeEnabledOn(@NotNull StatusBar statusBar) {
return false;
}
}

0

请先登录再写评论。