forked from microsoft/copilot-for-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopilotStatusManager.java
More file actions
34 lines (27 loc) · 919 Bytes
/
Copy pathCopilotStatusManager.java
File metadata and controls
34 lines (27 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package com.microsoft.copilot.eclipse.ui;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.ui.PlatformUI;
import com.microsoft.copilot.eclipse.core.events.CopilotEventConstants;
import com.microsoft.copilot.eclipse.ui.utils.UiUtils;
/**
* Manager dealing with the copilot status in the Eclipse status bar.
*/
public class CopilotStatusManager {
private IEventBroker eventBroker;
/**
* Constructor for the CopilotStatusManager.
*/
public CopilotStatusManager() {
eventBroker = PlatformUI.getWorkbench().getService(IEventBroker.class);
if (eventBroker != null) {
eventBroker.subscribe(CopilotEventConstants.TOPIC_AUTH_STATUS_CHANGED, event -> {
onDidCopilotStatusChange();
});
}
}
private void onDidCopilotStatusChange() {
UiUtils.refreshCopilotMenu();
}
}