当前位置: 首页>>代码示例>>Java>>正文


Java StatusBarWidget类代码示例

本文整理汇总了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);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LineEndingsManager.java

示例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);
            }
        }
    });
}
 
开发者ID:editorconfig,项目名称:editorconfig-jetbrains,代码行数:17,代码来源:LineEndingsManager.java

示例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;
      }
    }
  });

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:MemoryUsagePanel.java

示例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);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ErrorNotifier.java

示例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();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DvcsStatusWidget.java

示例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());
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DvcsStatusWidget.java

示例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);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:39,代码来源:StatusBarManagerTest.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:MemoryUsagePanel.java

示例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);
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:ErrorNotifier.java

示例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;
      }
    }
  });

}
 
开发者ID:consulo,项目名称:consulo,代码行数:41,代码来源:MemoryUsagePanel.java

示例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();
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:DvcsStatusWidget.java

示例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());
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:DvcsStatusWidget.java

示例13: copy

import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Override
public StatusBarWidget copy() {
    return new GitPairWidget(ObjectUtils.assertNotNull(getProject()));
}
 
开发者ID:RoboPlugins,项目名称:git-pair.idea,代码行数:5,代码来源:GitPairWidget.java

示例14: copy

import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Override
public StatusBarWidget copy() {
    return new GTMStatusWidget(myProject);
}
 
开发者ID:git-time-metric,项目名称:gtm-jetbrains-plugin,代码行数:5,代码来源:GTMStatusWidget.java

示例15: copy

import com.intellij.openapi.wm.StatusBarWidget; //导入依赖的package包/类
@Override
public StatusBarWidget copy() {
  return new InsertOverwritePanel(getProject());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:InsertOverwritePanel.java


注:本文中的com.intellij.openapi.wm.StatusBarWidget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。