本文整理匯總了Java中com.intellij.openapi.wm.StatusBar.getWidget方法的典型用法代碼示例。如果您正苦於以下問題:Java StatusBar.getWidget方法的具體用法?Java StatusBar.getWidget怎麽用?Java StatusBar.getWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.wm.StatusBar
的用法示例。
在下文中一共展示了StatusBar.getWidget方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}
示例2: openFatals
import com.intellij.openapi.wm.StatusBar; //導入方法依賴的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);
}
}
}
}
示例3: 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
}
}
示例4: removeWidgets
import com.intellij.openapi.wm.StatusBar; //導入方法依賴的package包/類
private static void removeWidgets(final Project project) {
final StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
// Remove build widget
if (statusBar.getWidget(BuildWidget.getID()) != null) {
statusBar.removeWidget(BuildWidget.getID());
}
}
}