本文整理汇总了Java中com.intellij.openapi.wm.StatusBarWidget类的典型用法代码示例。如果您正苦于以下问题:Java StatusBarWidget类的具体用法?Java StatusBarWidget怎么用?Java StatusBarWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatusBarWidget类属于com.intellij.openapi.wm包,在下文中一共展示了StatusBarWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateStatusBar
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private void updateStatusBar() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
IdeFrame frame = WindowManager.getInstance().getIdeFrame(myProject);
StatusBar statusBar = frame != null ? frame.getStatusBar() : null;
StatusBarWidget widget = statusBar != null ? statusBar.getWidget("LineSeparator") : null;
if (widget instanceof LineSeparatorPanel) {
FileEditorManagerEvent event = new FileEditorManagerEvent(FileEditorManager.getInstance(myProject),
null, null, null, null);
((LineSeparatorPanel)widget).selectionChanged(event);
}
}
});
}
示例2: updateStatusBar
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private void updateStatusBar() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
IdeFrame frame = WindowManager.getInstance().getIdeFrame(project);
StatusBar statusBar = frame.getStatusBar();
StatusBarWidget widget = statusBar != null ? statusBar.getWidget("LineSeparator") : null;
if (widget instanceof LineSeparatorPanel) {
FileEditorManagerEvent event = new FileEditorManagerEvent(FileEditorManager.getInstance(project),
null, null, null, null);
((LineSeparatorPanel)widget).selectionChanged(event);
}
}
});
}
示例3: MemoryUsagePanel
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
public MemoryUsagePanel() {
setOpaque(false);
setFocusable(false);
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.gc();
updateState();
}
});
setBorder(StatusBarWidget.WidgetBorder.INSTANCE);
updateUI();
new UiNotifyConnector(this, new Activatable() {
private ScheduledFuture<?> myFuture;
@Override
public void showNotify() {
myFuture = JobScheduler.getScheduler().scheduleWithFixedDelay(new Runnable() {
public void run() {
if (isDisplayable()) {
updateState();
}
}
}, 1, 5, TimeUnit.SECONDS);
}
@Override
public void hideNotify() {
if (myFuture != null) {
myFuture.cancel(true);
myFuture = null;
}
}
});
}
示例4: openFatals
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private static void openFatals(HyperlinkEvent event, LogMessage message) {
Object source = event.getSource();
if (source instanceof Component) {
Window window = SwingUtilities.getWindowAncestor((Component)source);
if (window instanceof IdeFrame) {
final StatusBar statusBar = ((IdeFrame)window).getStatusBar();
StatusBarWidget widget = statusBar == null ? null : statusBar.getWidget(IdeMessagePanel.FATAL_ERROR);
if (widget instanceof IdeMessagePanel) {
((IdeMessagePanel)widget).openFatals(message);
}
}
}
}
示例5: installWidgetToStatusBar
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private void installWidgetToStatusBar(@NotNull final Project project, @NotNull final StatusBarWidget widget) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null && !isDisposed()) {
statusBar.addWidget(widget, "after " + (SystemInfo.isMac ? "Encoding" : "InsertOverwrite"), project);
subscribeToRepoChangeEvents(project);
update();
}
}
});
}
示例6: removeWidgetFromStatusBar
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private void removeWidgetFromStatusBar(@NotNull final Project project, @NotNull final StatusBarWidget widget) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null && !isDisposed()) {
statusBar.removeWidget(widget.ID());
}
}
});
}
示例7: setupLocalTests
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Before
public void setupLocalTests() {
MockitoAnnotations.initMocks(this);
buildStatusLookupOperation = new MyBuildStatusLookupOperation();
PowerMockito.mockStatic(WindowManager.class);
when(WindowManager.getInstance()).thenReturn(windowManager);
when(windowManager.getStatusBar(any(Project.class))).thenReturn(statusBar);
when(statusBar.getWidget(anyString()))
.thenReturn(null) // First time return null
.thenReturn(new BuildWidget()); // All other calls should return something other than null
doNothing().when(statusBar).addWidget(any(StatusBarWidget.class));
doNothing().when(statusBar).updateWidget(anyString());
PowerMockito.mockStatic(ProjectManager.class);
when(ProjectManager.getInstance()).thenReturn(projectManager);
when(projectManager.getOpenProjects()).thenReturn(new Project[]{project});
PowerMockito.mockStatic(VcsHelper.class);
when(VcsHelper.getRepositoryContext(any(Project.class))).thenReturn(RepositoryContext.createGitContext("/root/one", "repo1", "branch1", "repoUrl1"));
PowerMockito.mockStatic(GitBranchUtil.class);
when(GitBranchUtil.getCurrentRepository(any(Project.class))).thenReturn(gitRepository);
when(GitBranchUtil.getDisplayableBranchText(any(GitRepository.class))).thenReturn("branch");
when(applicationNamesInfo.getProductName()).thenReturn("IDEA");
PowerMockito.mockStatic(ApplicationNamesInfo.class);
when(ApplicationNamesInfo.getInstance()).thenReturn(applicationNamesInfo);
when(gitRepository.getRemotes()).thenReturn(Collections.singletonList(
new GitRemote("origin", Collections.singletonList("https://test.visualstudio.com/"),
Collections.singletonList("https://test.visualstudio.com/"),
Collections.singletonList("https://test.visualstudio.com/"),
Collections.singletonList("https://test.visualstudio.com/"))));
PowerMockito.mockStatic(OperationFactory.class);
when(OperationFactory.createBuildStatusLookupOperation(any(RepositoryContext.class), anyBoolean())).thenReturn(buildStatusLookupOperation);
}
示例8: MemoryUsagePanel
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
public MemoryUsagePanel() {
setOpaque(false);
setFocusable(false);
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.gc();
updateState();
}
});
setBorder(StatusBarWidget.WidgetBorder.INSTANCE);
updateUI();
}
示例9: openFatals
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private static void openFatals(HyperlinkEvent event, LogMessage message) {
Object source = event.getSource();
if (source instanceof Component) {
Window window = SwingUtilities.getWindowAncestor((Component)source);
if (window instanceof IdeFrame) {
StatusBarWidget widget = ((IdeStatusBarImpl)((IdeFrame)window).getStatusBar()).getWidget(IdeMessagePanel.FATAL_ERROR);
if (widget instanceof IdeMessagePanel) {
((IdeMessagePanel)widget).openFatals(message);
}
}
}
}
示例10: MemoryUsagePanel
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
public MemoryUsagePanel() {
setOpaque(false);
setFocusable(false);
addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.gc();
updateState();
}
});
setBorder(StatusBarWidget.WidgetBorder.INSTANCE);
updateUI();
new UiNotifyConnector(this, new Activatable() {
private ScheduledFuture<?> myFuture;
@Override
public void showNotify() {
myFuture = JobScheduler.getScheduler().scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
if (isDisplayable()) {
updateState();
}
}
}, 1, 5, TimeUnit.SECONDS);
}
@Override
public void hideNotify() {
if (myFuture != null) {
myFuture.cancel(true);
myFuture = null;
}
}
});
}
示例11: installWidgetToStatusBar
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private void installWidgetToStatusBar(@Nonnull final Project project, @Nonnull final StatusBarWidget widget) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null && !isDisposed()) {
statusBar.addWidget(widget, "after " + (SystemInfo.isMac ? "Encoding" : "InsertOverwrite"), project);
subscribeToMappingChanged();
subscribeToRepoChangeEvents(project);
update();
}
}
});
}
示例12: removeWidgetFromStatusBar
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
private void removeWidgetFromStatusBar(@Nonnull final Project project, @Nonnull final StatusBarWidget widget) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null && !isDisposed()) {
statusBar.removeWidget(widget.ID());
}
}
});
}
示例13: copy
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Override
public StatusBarWidget copy() {
return new GitPairWidget(ObjectUtils.assertNotNull(getProject()));
}
示例14: copy
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Override
public StatusBarWidget copy() {
return new GTMStatusWidget(myProject);
}
示例15: copy
import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Override
public StatusBarWidget copy() {
return new InsertOverwritePanel(getProject());
}