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


Java NotificationsManagerImpl类代码示例

本文整理汇总了Java中com.intellij.notification.impl.NotificationsManagerImpl的典型用法代码示例。如果您正苦于以下问题:Java NotificationsManagerImpl类的具体用法?Java NotificationsManagerImpl怎么用?Java NotificationsManagerImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NotificationsManagerImpl类属于com.intellij.notification.impl包,在下文中一共展示了NotificationsManagerImpl类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showIncomingChatInvitation

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的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));
}
 
开发者ID:samebug,项目名称:samebug-idea-plugin,代码行数:21,代码来源:IncomingChatInvitationPopupController.java

示例2: showIncomingChatInvitation

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的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));
}
 
开发者ID:samebug,项目名称:samebug-idea-plugin,代码行数:23,代码来源:IncomingTipPopupController.java

示例3: showIncomingHelpRequest

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的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));
}
 
开发者ID:samebug,项目名称:samebug-idea-plugin,代码行数:26,代码来源:HelpRequestPopupController.java

示例4: showNotification

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
private static void showNotification(@NotNull DiffViewerBase viewer, @NotNull Notification notification) {
  JComponent component = viewer.getComponent();

  Window window = UIUtil.getWindow(component);
  if (window instanceof IdeFrame && NotificationsManagerImpl.findWindowForBalloon(viewer.getProject()) == window) {
    notification.notify(viewer.getProject());
    return;
  }

  Balloon balloon = NotificationsManagerImpl.createBalloon(component, notification, false, true);
  Disposer.register(viewer, balloon);

  Dimension componentSize = component.getSize();
  Dimension balloonSize = balloon.getPreferredSize();

  int width = Math.min(balloonSize.width, componentSize.width);
  int height = Math.min(balloonSize.height, componentSize.height);

  // top-right corner, 20px to the edges
  RelativePoint point = new RelativePoint(component, new Point(componentSize.width - 20 - width / 2, 20 + height / 2));
  balloon.show(point, Balloon.Position.above);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AnnotateDiffViewerAction.java

示例5: patchNotifications

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
static void patchNotifications() throws Exception {
  if (!MTConfig.getInstance().isMaterialTheme()) {
    return;
  }

  final Color notifBg = ObjectUtils.notNull(UIManager.getColor("Notifications.background"), new ColorUIResource(0x323232));
  final Color notifBorder = ObjectUtils.notNull(UIManager.getColor("Notifications.borderColor"), new ColorUIResource(0x323232));

  final Color bgColor = new JBColor(notifBg, notifBg);
  final Color borderColor = new JBColor(notifBorder, notifBorder);

  StaticPatcher.setFinalStatic(NotificationsManagerImpl.class, "FILL_COLOR", bgColor);
  StaticPatcher.setFinalStatic(NotificationsManagerImpl.class, "BORDER_COLOR", borderColor);

  replaceToolBalloons();
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:17,代码来源:UIReplacer.java

示例6: showNotification

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
private static void showNotification(@Nonnull DiffViewerBase viewer, @Nonnull Notification notification) {
  JComponent component = viewer.getComponent();

  Window window = UIUtil.getWindow(component);
  if (window instanceof IdeFrame && NotificationsManagerImpl.findWindowForBalloon(viewer.getProject()) == window) {
    notification.notify(viewer.getProject());
    return;
  }

  Balloon balloon = NotificationsManagerImpl.createBalloon(component, notification, false, true, null, viewer);

  Dimension componentSize = component.getSize();
  Dimension balloonSize = balloon.getPreferredSize();

  int width = Math.min(balloonSize.width, componentSize.width);
  int height = Math.min(balloonSize.height, componentSize.height);

  // top-right corner, 20px to the edges
  RelativePoint point = new RelativePoint(component, new Point(componentSize.width - 20 - width / 2, 20 + height / 2));
  balloon.show(point, Balloon.Position.above);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:AnnotateDiffViewerAction.java

示例7: getRangeHighlighterLocation

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
@Nullable
public RelativePoint getRangeHighlighterLocation(RangeHighlighter range) {
  Editor editor = myLogEditor.getValue();
  Project project = editor.getProject();
  Window window = NotificationsManagerImpl.findWindowForBalloon(project);
  if (range != null && window != null) {
    Point point = editor.visualPositionToXY(editor.offsetToVisualPosition(range.getStartOffset()));
    return new RelativePoint(window, SwingUtilities.convertPoint(editor.getContentComponent(), point, window));
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:EventLogConsole.java

示例8: getRangeHighlighterLocation

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
@Nullable
public RelativePoint getRangeHighlighterLocation(RangeHighlighter range) {
    Editor editor = myLogEditor.getValue();
    Project project = editor.getProject();
    Window window = NotificationsManagerImpl.findWindowForBalloon(project);
    if (range != null && window != null) {
        Point point = editor.visualPositionToXY(editor.offsetToVisualPosition(range.getStartOffset()));
        return new RelativePoint(window, SwingUtilities.convertPoint(editor.getContentComponent(), point, window));
    }
    return null;
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:12,代码来源:ConsoleLogConsole.java

示例9: getHyperlinkLocation

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
@Nullable
public RelativePoint getHyperlinkLocation(HyperlinkInfo info) {
  Editor editor = myLogEditor.getValue();
  Project project = editor.getProject();
  RangeHighlighter range = myHyperlinkSupport.getValue().findHyperlinkRange(info);
  Window window = NotificationsManagerImpl.findWindowForBalloon(project);
  if (range != null && window != null) {
    Point point = editor.visualPositionToXY(editor.offsetToVisualPosition(range.getStartOffset()));
    return new RelativePoint(window, SwingUtilities.convertPoint(editor.getContentComponent(), point, window));
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:EventLogConsole.java

示例10: create

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
@Nonnull
public static BalloonLayoutConfiguration create(@Nonnull Notification notification,
                                                @Nonnull BalloonLayoutData layoutData,
                                                boolean actions) {
  boolean title = notification.hasTitle();
  boolean content = notification.hasContent();
  if (title && content && actions) {
    return treeLines();
  }
  if (content && NotificationsManagerImpl.calculateContentHeight(title || actions ? 1 : 2) < layoutData.fullHeight) {
    return treeLines();
  }
  return twoLines();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:BalloonLayoutConfiguration.java

示例11: getRangeHighlighterLocation

import com.intellij.notification.impl.NotificationsManagerImpl; //导入依赖的package包/类
@Nullable
public RelativePoint getRangeHighlighterLocation(RangeHighlighter range) {
  Editor editor = getConsoleEditor();
  Project project = editor.getProject();
  Window window = NotificationsManagerImpl.findWindowForBalloon(project);
  if (range != null && window != null) {
    Point point = editor.visualPositionToXY(editor.offsetToVisualPosition(range.getStartOffset()));
    return new RelativePoint(window, SwingUtilities.convertPoint(editor.getContentComponent(), point, window));
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:EventLogConsole.java


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