本文整理匯總了Java中com.intellij.openapi.ui.popup.Balloon類的典型用法代碼示例。如果您正苦於以下問題:Java Balloon類的具體用法?Java Balloon怎麽用?Java Balloon使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Balloon類屬於com.intellij.openapi.ui.popup包,在下文中一共展示了Balloon類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: hyperlinkActivated
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
final Module moduleByName = ModuleManager.getInstance(myProject).findModuleByName(e.getDescription());
if (moduleByName != null) {
myConfiguration.getConfigurationModule().setModule(moduleByName);
try {
Executor executor = myIsDebug ? DefaultDebugExecutor.getDebugExecutorInstance()
: DefaultRunExecutor.getRunExecutorInstance();
ExecutionEnvironmentBuilder.create(myProject, executor, myConfiguration).contentToReuse(null).buildAndExecute();
Balloon balloon = myToolWindowManager.getToolWindowBalloon(myTestRunDebugId);
if (balloon != null) {
balloon.hide();
}
}
catch (ExecutionException e1) {
LOG.error(e1);
}
}
}
示例2: handleBadRequest
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
private void handleBadRequest(final HybrisHttpResult httpResult, final Project project) {
if (httpResult.getStatusCode() != SC_OK) {
final StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (httpResult.getStatusCode() == SC_NOT_FOUND || httpResult.getStatusCode() == SC_MOVED_TEMPORARILY) {
JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(
"Hybris Host URL '" + httpResult.getErrorMessage() + "' was incorrect. Please, check your settings.",
MessageType.ERROR,
null
).setFadeoutTime(FADEOUT_TIME)
.createBalloon().show(
RelativePoint.getCenterOf(statusBar.getComponent()),
Balloon.Position.atRight
);
}
}
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:18,代碼來源:ExecuteHybrisConsole.java
示例3: projectOpened
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
@Override
public void projectOpened() {
ApplicationManager.getApplication().invokeLater((DumbAwareRunnable)() -> ApplicationManager.getApplication().runWriteAction(
(DumbAwareRunnable)() -> {
if (PropertiesComponent.getInstance().getBoolean(ourShowPopup, true)) {
final String content = "<html>If you'd like to learn more about PyCharm Edu, " +
"click <a href=\"https://www.jetbrains.com/pycharm-edu/quickstart/\">here</a> to watch a tutorial</html>";
final Notification notification = new Notification("Watch Tutorials!", "", content, NotificationType.INFORMATION,
new NotificationListener.UrlOpeningListener(true));
StartupManager.getInstance(myProject).registerPostStartupActivity(() -> Notifications.Bus.notify(notification));
Balloon balloon = notification.getBalloon();
if (balloon != null) {
balloon.addListener(new JBPopupAdapter() {
@Override
public void onClosed(LightweightWindowEvent event) {
notification.expire();
}
});
}
notification.whenExpired(() -> PropertiesComponent.getInstance().setValue(ourShowPopup, false, true));
}
}));
}
示例4: generateProject
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
@Override
public void generateProject(@NotNull Project project, @NotNull VirtualFile baseDir, @NotNull GravProjectSettings settings, @NotNull Module module) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(new File(settings.gravInstallationPath));
if (vf == null || !GravSdkType.isValidGravSDK(vf)) {
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder("Project couldn't be created because Grav Installation isn't valid", MessageType.ERROR, null)
.setFadeoutTime(3500)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()), Balloon.Position.above);
} else {
storage.setDefaultGravDownloadPath(settings.gravInstallationPath);
PropertiesComponent.getInstance().setValue(LAST_USED_GRAV_HOME, new File(settings.gravInstallationPath).getAbsolutePath());
GravProjectGeneratorUtil projectGenerator = new GravProjectGeneratorUtil();
projectGenerator.generateProject(project, baseDir, settings, module);
try {
List<String> includePath = new ArrayList<>();
includePath.add(baseDir.getPath());
PhpIncludePathManager.getInstance(project).setIncludePath(includePath);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例5: moduleCreated
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
@Override
public void moduleCreated(@NotNull Module module) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
String msg = String.format("Please wait while module for project %s is created", project.getName());
settings = GravProjectSettings.getInstance(project);
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder(msg, MessageType.WARNING, null)
.setFadeoutTime(4000)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()), Balloon.Position.above);
VirtualFile[] roots1 = ModuleRootManager.getInstance(module).getContentRoots();
if (roots1.length != 0) {
final VirtualFile src = roots1[0];
settings.withSrcDirectory = withSrcDirectory;
settings.gravInstallationPath = getGravInstallPath().getPath();
// settings.withSrcDirectory =
GravProjectGeneratorUtil generatorUtil = new GravProjectGeneratorUtil();
generatorUtil.generateProject(project, src, settings, module);
}
}
示例6: showMessage
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
private static void showMessage(final Project project, final MessageType messageType, final String format, final Object[] args) {
StatusBar statusBar = windowManager.getStatusBar(project);
if(statusBar == null || statusBar.getComponent() == null){
return;
}
String message = String.format(format, args);
jbPopupFactory.createHtmlTextBalloonBuilder(message, messageType, null)
.setFadeoutTime(7500)
.createBalloon()
.show(RelativePoint.getNorthEastOf(statusBar.getComponent()), Balloon.Position.atRight);
if(messageType == MessageType.INFO){
log.info(message);
}
else if(messageType == MessageType.WARNING) {
log.warn(message);
}
else{
log.debug(message);
}
}
示例7: displayUploadResultBalloonMessage
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
private void displayUploadResultBalloonMessage(String fileName, Boolean isSuccess) {
String message = fileName + " Uploaded Successfully";
MessageType messageType = MessageType.INFO;
if (!isSuccess) {
message = fileName + " Failed to Upload";
messageType = MessageType.ERROR;
}
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder("<h3>" + message + "</h3>", messageType, null)
.setFadeoutTime(3000)
.createBalloon()
.show(RelativePoint.getNorthEastOf(WindowManager.getInstance().getIdeFrame(project).getComponent()),
Balloon.Position.above);
}
示例8: installGtmWidget
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的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);
}
}
}
示例9: showIncomingChatInvitation
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
public void showIncomingChatInvitation(@NotNull ChatInvitation chatInvitation, @NotNull IncomingChatInvitationNotification notification) {
IncomingChatInvitationPopup.Model popupModel = IdeaSamebugPlugin.getInstance().conversionService.convertIncomingChatInvitationPopup(chatInvitation);
IncomingChatInvitationPopup popup = new IncomingChatInvitationPopup(popupModel);
IncomingChatInvitationPopupListener incomingChatInvitationPopupListener = new IncomingChatInvitationPopupListener(this, chatInvitation);
ListenerService.putListenerToComponent(popup, IIncomingChatInvitationPopup.Listener.class, incomingChatInvitationPopupListener);
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(popup);
balloonBuilder.setFillColor(ColorService.forCurrentTheme(ColorService.Background));
balloonBuilder.setContentInsets(new Insets(40, 0, 40, 0));
balloonBuilder.setBorderInsets(new Insets(0, 0, 0, 0));
balloonBuilder.setBorderColor(ColorService.forCurrentTheme(ColorService.Background));
balloonBuilder.setShadow(true);
IdeFrame window = (IdeFrame) NotificationsManagerImpl.findWindowForBalloon(myProject);
RelativePoint pointToShowPopup = null;
if (window != null) pointToShowPopup = RelativePoint.getSouthEastOf(window.getComponent());
Balloon balloon = balloonBuilder.createBalloon();
balloon.show(pointToShowPopup, Balloon.Position.atLeft);
TrackingService.trace(SwingRawEvent.notificationShow(popup));
}
示例10: showIncomingChatInvitation
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
public void showIncomingChatInvitation(@NotNull IncomingAnswer incomingTip, @NotNull IncomingTipNotification notification) {
IIncomingTipPopup.Model popupModel = IdeaSamebugPlugin.getInstance().conversionService.convertIncomingTipPopup(incomingTip);
IncomingTipPopup popup = new IncomingTipPopup(popupModel);
DataService.putData(popup, TrackingKeys.Location, new Locations.TipAnswerNotification(incomingTip.getSolution().getId()));
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(popup);
balloonBuilder.setFillColor(ColorService.forCurrentTheme(ColorService.Background));
balloonBuilder.setContentInsets(new Insets(40, 0, 40, 0));
balloonBuilder.setBorderInsets(new Insets(0, 0, 0, 0));
balloonBuilder.setBorderColor(ColorService.forCurrentTheme(ColorService.Background));
balloonBuilder.setShadow(true);
IdeFrame window = (IdeFrame) NotificationsManagerImpl.findWindowForBalloon(myProject);
RelativePoint pointToShowPopup = null;
if (window != null) pointToShowPopup = RelativePoint.getSouthEastOf(window.getComponent());
Balloon balloon = balloonBuilder.createBalloon();
data.put(popup, incomingTip);
notifications.put(popup, notification);
balloons.put(popup, balloon);
balloon.show(pointToShowPopup, Balloon.Position.atLeft);
TrackingService.trace(SwingRawEvent.notificationShow(popup));
}
示例11: showIncomingHelpRequest
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
public void showIncomingHelpRequest(@NotNull IncomingHelpRequest helpRequest, @NotNull IncomingHelpRequestNotification notification) {
IHelpRequestPopup.Model popupModel = IdeaSamebugPlugin.getInstance().conversionService.convertHelpRequestPopup(helpRequest);
HelpRequestPopup popup = new HelpRequestPopup(popupModel);
DataService.putData(popup, TrackingKeys.Location, new Locations.HelpRequestNotification(helpRequest.getMatch().getHelpRequest().getId()));
DataService.putData(popup, TrackingKeys.WriteTipTransaction, Funnels.newTransactionId());
HelpRequestPopupListener helpRequestPopupListener = new HelpRequestPopupListener(this);
ListenerService.putListenerToComponent(popup, IHelpRequestPopup.Listener.class, helpRequestPopupListener);
BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createBalloonBuilder(popup);
balloonBuilder.setFillColor(ColorService.forCurrentTheme(ColorService.Background));
balloonBuilder.setContentInsets(new Insets(40, 0, 40, 0));
balloonBuilder.setBorderInsets(new Insets(0, 0, 0, 0));
balloonBuilder.setBorderColor(ColorService.forCurrentTheme(ColorService.Background));
balloonBuilder.setShadow(true);
IdeFrame window = (IdeFrame) NotificationsManagerImpl.findWindowForBalloon(myProject);
RelativePoint pointToShowPopup = null;
if (window != null) pointToShowPopup = RelativePoint.getSouthEastOf(window.getComponent());
Balloon balloon = balloonBuilder.createBalloon();
data.put(popup, helpRequest);
notifications.put(popup, notification);
balloons.put(popup, balloon);
balloon.show(pointToShowPopup, Balloon.Position.atLeft);
TrackingService.trace(SwingRawEvent.notificationShow(popup));
}
示例12: reportException
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
private void reportException(final String htmlContent) {
Runnable balloonShower = new Runnable() {
@Override
public void run() {
Balloon balloon = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(htmlContent, MessageType.WARNING, null).
setShowCallout(false).setHideOnClickOutside(true).setHideOnAction(true).setHideOnFrameResize(true).setHideOnKeyOutside(true).
createBalloon();
final Rectangle rect = myPanel.getPanel().getBounds();
final Point p = new Point(rect.x + rect.width - 100, rect.y + 50);
final RelativePoint point = new RelativePoint(myPanel.getPanel(), p);
balloon.show(point, Balloon.Position.below);
Disposer.register(myProject != null ? myProject : ApplicationManager.getApplication(), balloon);
}
};
ApplicationManager.getApplication().invokeLater(balloonShower, new Condition() {
@Override
public boolean value(Object o) {
return !(myProject == null || myProject.isDefault()) && ((!myProject.isOpen()) || myProject.isDisposed());
}
}
);
}
示例13: showBalloonForComponent
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
public static void showBalloonForComponent(@NotNull Component component, @NotNull final String message, final MessageType type,
final boolean atTop, @Nullable final Disposable disposable) {
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
if (popupFactory == null) return;
BalloonBuilder balloonBuilder = popupFactory.createHtmlTextBalloonBuilder(message, type, null);
balloonBuilder.setDisposable(disposable == null ? ApplicationManager.getApplication() : disposable);
Balloon balloon = balloonBuilder.createBalloon();
Dimension size = component.getSize();
Balloon.Position position;
int x;
int y;
if (size == null) {
x = y = 0;
position = Balloon.Position.above;
}
else {
x = Math.min(10, size.width / 2);
y = size.height;
position = Balloon.Position.below;
}
balloon.show(new RelativePoint(component, new Point(x, y)), position);
}
示例14: showBalloon
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
/**
* Asks to show balloon that contains information related to the given component.
*
* @param component component for which we want to show information
* @param messageType balloon message type
* @param message message to show
*/
public static void showBalloon(@NotNull JComponent component, @NotNull MessageType messageType, @NotNull String message) {
final BalloonBuilder builder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, messageType, null)
.setDisposable(ApplicationManager.getApplication())
.setFadeoutTime(BALLOON_FADEOUT_TIME);
Balloon balloon = builder.createBalloon();
Dimension size = component.getSize();
Balloon.Position position;
int x;
int y;
if (size == null) {
x = y = 0;
position = Balloon.Position.above;
}
else {
x = Math.min(10, size.width / 2);
y = size.height;
position = Balloon.Position.below;
}
balloon.show(new RelativePoint(component, new Point(x, y)), position);
}
示例15: addNotify
import com.intellij.openapi.ui.popup.Balloon; //導入依賴的package包/類
@Override
public void addNotify() {
super.addNotify();
final String key = "toolwindow.stripes.buttons.info.shown";
if (UISettings.getInstance().HIDE_TOOL_STRIPES && !PropertiesComponent.getInstance().isTrueValue(key)) {
PropertiesComponent.getInstance().setValue(key, String.valueOf(true));
final Alarm alarm = new Alarm();
alarm.addRequest(new Runnable() {
@Override
public void run() {
GotItMessage.createMessage(UIBundle.message("tool.window.quick.access.title"), UIBundle.message(
"tool.window.quick.access.message"))
.setDisposable(ToolWindowsWidget.this)
.show(new RelativePoint(ToolWindowsWidget.this, new Point(10, 0)), Balloon.Position.above);
Disposer.dispose(alarm);
}
}, 20000);
}
}