public final class StatusBarWidgetProviderToFactoryAdapter extends java.lang.Object implements StatusBarWidgetFactory
EP_NAME
Constructor and Description |
---|
StatusBarWidgetProviderToFactoryAdapter(Project project,
StatusBarWidgetProvider provider) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeEnabledOn(StatusBar statusBar) |
StatusBarWidget |
createWidget(Project project)
Creates a widget to be added to the status bar.
|
void |
disposeWidget(StatusBarWidget widget) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAnchor() |
java.lang.String |
getDisplayName() |
java.lang.String |
getId() |
int |
hashCode() |
boolean |
isAvailable(Project project)
Returns availability of widget.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isConfigurable, isEnabledByDefault
public StatusBarWidgetProviderToFactoryAdapter(Project project, StatusBarWidgetProvider provider)
public java.lang.String getId()
getId
in interface StatusBarWidgetFactory
public java.lang.String getDisplayName()
getDisplayName
in interface StatusBarWidgetFactory
public boolean isAvailable(Project project)
StatusBarWidgetFactory
`False` means that IDE won't try to create a widget or will dispose it on StatusBarWidgetsManager.updateWidget(java.lang.Class<? extends com.intellij.openapi.wm.StatusBarWidgetFactory>)
call.
E.g. `false` can be returned for
Whenever availability is changed, you need to call StatusBarWidgetsManager.updateWidget(StatusBarWidgetFactory)
explicitly to get status bar updated.
isAvailable
in interface StatusBarWidgetFactory
public boolean canBeEnabledOn(StatusBar statusBar)
canBeEnabledOn
in interface StatusBarWidgetFactory
It's better to have this method aligned with EditorBasedStatusBarPopup.WidgetState.HIDDEN
,
whenever state is HIDDEN, this method should return false.
Otherwise enabling widget via context menu won't take any visual effect.
E.g. EditorBasedWidget
are available if editor is opened in a frame that given status bar is attached to
For creating editor based widgets see also StatusBarEditorBasedWidgetFactory
public StatusBarWidget createWidget(Project project)
StatusBarWidgetFactory
Once the method is invoked on project initialization, the widget won't be recreated or disposed implicitly.
You may need to recreate it if:
StatusBarWidgetFactory.isAvailable(Project)
com.intellij.openapi.wm.impl.status.widget.StatusBarWidgetSettings
To do this, you need to explicitly invoke StatusBarWidgetsManager.updateWidget(StatusBarWidgetFactory)
to recreate the widget and re-add it to the status bar.
createWidget
in interface StatusBarWidgetFactory
public void disposeWidget(StatusBarWidget widget)
disposeWidget
in interface StatusBarWidgetFactory
public java.lang.String getAnchor()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object