本文整理汇总了Java中com.intellij.openapi.wm.StatusBar.addWidget方法的典型用法代码示例。如果您正苦于以下问题:Java StatusBar.addWidget方法的具体用法?Java StatusBar.addWidget怎么用?Java StatusBar.addWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.wm.StatusBar
的用法示例。
在下文中一共展示了StatusBar.addWidget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installGtmWidget
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private void installGtmWidget() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (statusBar != null) {
statusBar.addWidget(myStatusWidget, myProject);
myStatusWidget.installed();
if (!GTMRecord.initGtmExePath()) {
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder(GTMConfig.getInstance().gtmNotFound, ERROR, null)
.setFadeoutTime(30000)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()),
Balloon.Position.atRight);
return;
}
if (!GTMRecord.checkVersion()) {
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder(GTMConfig.getInstance().gtmVerOutdated, WARNING, null)
.setFadeoutTime(30000)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()),
Balloon.Position.atRight);
}
}
}
示例2: projectOpened
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
public void projectOpened() {
this.checkProject();
// attach toolbar popup (right bottom)
StatusBar statusBar = WindowManager.getInstance().getStatusBar(this.project);
if(statusBar == null) {
return;
}
// clean bar on project open; we can have multiple projects att some time
if(statusBar.getWidget(SymfonyProfilerWidget.ID) != null) {
statusBar.removeWidget(SymfonyProfilerWidget.ID);
}
if(isEnabled()) {
SymfonyProfilerWidget symfonyProfilerWidget = new SymfonyProfilerWidget(this.project);
statusBar.addWidget(symfonyProfilerWidget);
}
}
示例3: addStepicWidget
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private void addStepicWidget() {
StudyStepicUserWidget widget = StudyUtils.getStepicWidget();
if (widget == null) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
statusBar.addWidget(new StudyStepicUserWidget(), "before Position");
}
else {
widget.update();
}
}
示例4: install
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private void install() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (statusBar != null) {
statusBar.addWidget(myStatusWidget, myProject);
myStatusWidget.installed();
}
}
示例5: installDefaultProjectStatusBarWidgets
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private void installDefaultProjectStatusBarWidgets(@NotNull final Project project) {
final StatusBar statusBar = getStatusBar();
final PositionPanel positionPanel = new PositionPanel(project);
statusBar.addWidget(positionPanel, "before " + IdeMessagePanel.FATAL_ERROR);
final IdeNotificationArea notificationArea = new IdeNotificationArea();
statusBar.addWidget(notificationArea, "before " + IdeMessagePanel.FATAL_ERROR);
final EncodingPanel encodingPanel = new EncodingPanel(project);
statusBar.addWidget(encodingPanel, "after Position");
final LineSeparatorPanel lineSeparatorPanel = new LineSeparatorPanel(project);
statusBar.addWidget(lineSeparatorPanel, "before " + encodingPanel.ID());
final ToggleReadOnlyAttributePanel readOnlyAttributePanel = new ToggleReadOnlyAttributePanel(project);
final InsertOverwritePanel insertOverwritePanel = new InsertOverwritePanel(project);
statusBar.addWidget(insertOverwritePanel, "after Encoding");
statusBar.addWidget(readOnlyAttributePanel, "after InsertOverwrite");
Disposer.register(project, new Disposable() {
public void dispose() {
statusBar.removeWidget(encodingPanel.ID());
statusBar.removeWidget(lineSeparatorPanel.ID());
statusBar.removeWidget(positionPanel.ID());
statusBar.removeWidget(notificationArea.ID());
statusBar.removeWidget(readOnlyAttributePanel.ID());
statusBar.removeWidget(insertOverwritePanel.ID());
((StatusBarEx)statusBar).removeCustomIndicationComponents();
}
});
}
示例6: startRecording
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
public void startRecording(String macroName) {
LOG.assertTrue(!myIsRecording);
myIsRecording = true;
myRecordingMacro = new ActionMacro(macroName);
final StatusBar statusBar = WindowManager.getInstance().getIdeFrame(null).getStatusBar();
myWidget = new Widget(statusBar);
statusBar.addWidget(myWidget);
}
示例7: activate
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
@CalledInAwt
public void activate() {
MessageBusConnection busConnection = myProject.getMessageBus().connect();
busConnection.subscribe(HgVcs.STATUS_TOPIC, this);
busConnection.subscribe(HgVcs.INCOMING_OUTGOING_CHECK_TOPIC, this);
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (null != statusBar && isVisible()) {
statusBar.addWidget(this, myProject);
isAlreadyShown = true;
}
}
示例8: updateWidgets
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private static void updateWidgets(final StatusBar statusBar, final Project project, final boolean allowPrompt) {
// Update the build widget
BuildWidget buildWidget = (BuildWidget) statusBar.getWidget(BuildWidget.getID());
if (buildWidget == null) {
buildWidget = new BuildWidget();
statusBar.addWidget(buildWidget, project);
}
// Attempt to get the current repository context (if none, then the status stays as it was)
final RepositoryContext repositoryContext = VcsHelper.getRepositoryContext(project);
if (repositoryContext != null) {
final BuildWidget widget = buildWidget;
// Create the operation and start the background work to get the latest build information
final BuildStatusLookupOperation op = OperationFactory.createBuildStatusLookupOperation(repositoryContext, allowPrompt);
op.addListener(new Operation.Listener() {
@Override
public void notifyLookupStarted() { /* do nothing */ }
@Override
public void notifyLookupCompleted() { /* do nothing */ }
@Override
public void notifyLookupResults(final Operation.Results results) {
updateBuildWidget(project, statusBar, widget, (BuildStatusLookupOperation.BuildStatusResults) results);
}
});
op.doWorkAsync(null);
} else {
// The repository hasn't been opened yet, we should get an event when it is opened
}
}
示例9: projectOpened
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
public void projectOpened() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
ContainerStatusBarWidget containerStatusBarWidget = new ContainerStatusBarWidget(project);
statusBar.addWidget(containerStatusBarWidget);
containerStatusBarWidget.setText("");
}
ContainerResolver.put(project, new JsonFileContainer(project, Configuration.getInstance(project).containerDefinitionFileName));
}
示例10: install
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private void install() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.addWidget(statusWidget, project);
statusWidget.installed();
}
}
示例11: installDefaultProjectStatusBarWidgets
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
private void installDefaultProjectStatusBarWidgets(@NotNull final Project project) {
final StatusBar statusBar = getStatusBar();
final PositionPanel positionPanel = new PositionPanel(project);
statusBar.addWidget(positionPanel, "before " + IdeMessagePanel.FATAL_ERROR);
final IdeNotificationArea notificationArea = new IdeNotificationArea();
statusBar.addWidget(notificationArea, "before " + IdeMessagePanel.FATAL_ERROR);
final EncodingPanel encodingPanel = new EncodingPanel(project);
statusBar.addWidget(encodingPanel, "after Position");
final LineSeparatorPanel lineSeparatorPanel = new LineSeparatorPanel(project);
statusBar.addWidget(lineSeparatorPanel, "before " + encodingPanel.ID());
final ToggleReadOnlyAttributePanel readOnlyAttributePanel = new ToggleReadOnlyAttributePanel();
InsertOverwritePanel insertOverwritePanel = null;
if (!SystemInfo.isMac) {
insertOverwritePanel = new InsertOverwritePanel(project);
statusBar.addWidget(insertOverwritePanel, "after Encoding");
statusBar.addWidget(readOnlyAttributePanel, "after InsertOverwrite");
} else {
statusBar.addWidget(readOnlyAttributePanel, "after Encoding");
}
final InsertOverwritePanel finalInsertOverwritePanel = insertOverwritePanel;
Disposer.register(project, new Disposable() {
public void dispose() {
statusBar.removeWidget(encodingPanel.ID());
statusBar.removeWidget(lineSeparatorPanel.ID());
statusBar.removeWidget(positionPanel.ID());
statusBar.removeWidget(notificationArea.ID());
statusBar.removeWidget(readOnlyAttributePanel.ID());
if (finalInsertOverwritePanel != null) statusBar.removeWidget(finalInsertOverwritePanel.ID());
((StatusBarEx)statusBar).removeCustomIndicationComponents();
}
});
}
示例12: activate
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
public void activate() {
myBusConnection = myProject.getMessageBus().connect();
myBusConnection.subscribe(HgVcs.STATUS_TOPIC, this);
myBusConnection.subscribe(HgVcs.INCOMING_OUTGOING_CHECK_TOPIC, this);
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (null != statusBar && isVisible()) {
statusBar.addWidget(this, myProject);
isAlreadyShown = true;
}
}
示例13: show
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
public void show() {
if (isAlreadyShown) {
return;
}
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (null != statusBar && isVisible()) {
statusBar.addWidget(this, myProject);
isAlreadyShown = true;
myProject.getMessageBus().syncPublisher(HgVcs.REMOTE_TOPIC).update(myProject, null);
}
}
示例14: projectOpened
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
@Override
public void projectOpened() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (statusBar != null) {
statusBar.addWidget(new FileLanguagePanel(myProject));
}
}
示例15: projectOpened
import com.intellij.openapi.wm.StatusBar; //导入方法依赖的package包/类
@Override
public void projectOpened() {
if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
myBranchWidget = new SvnBranchWidget(myProject);
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (statusBar != null) {
statusBar.addWidget(myBranchWidget, myProject);
}
}
LOG.debug("Project opened");
}