Пример #1
0
 @Override
 public void actionPerformed(final ActionEvent e) {
   if (e.getSource() == show) {
     feedbackDialogProvider.displayOrRequestFocus();
   }
   eventBus.publishAsync(new StatusBarComponentRemovedEvent(this));
 }
Пример #2
0
  /**
   * Creates a new feedback nag.
   *
   * @param iconManager The icon manager to use to find the feedback nag icon.
   * @param feedbackDialogProvider Provider of feedback dialogs.
   * @param eventBus The event bus to post messages to
   */
  @Inject
  public FeedbackNag(
      final IconManager iconManager,
      final DialogProvider<FeedbackDialog> feedbackDialogProvider,
      final EventBus eventBus) {
    this.feedbackDialogProvider = feedbackDialogProvider;
    this.eventBus = eventBus;

    menu = new JPopupMenu();
    show = new JMenuItem("Open");
    final JMenuItem dismiss = new JMenuItem("Dismiss");

    setIcon(iconManager.getIcon("feedback"));
    setBorder(BorderFactory.createEtchedBorder());
    setToolTipText("We would appreciate any feedback you may have about " + "DMDirc.");

    menu.add(show);
    menu.add(dismiss);

    show.addActionListener(this);
    dismiss.addActionListener(this);
    addMouseListener(this);
    // TODO: There should be some other class which adds the nag to the status bar
    eventBus.publishAsync(new StatusBarComponentAddedEvent(this));
  }
Пример #3
0
 @Override
 public void mouseReleased(final MouseEvent e) {
   if (e.getButton() == 1) {
     feedbackDialogProvider.displayOrRequestFocus();
     eventBus.publishAsync(new StatusBarComponentRemovedEvent(this));
   }
   checkMouseEvent(e);
 }
Пример #4
0
 /**
  * Called when an error needs to be deleted from the list.
  *
  * @param error ProgramError that changed
  */
 public void deleteError(final ProgramError error) {
   errors.remove(error);
   eventBus.publishAsync(new ProgramErrorDeletedEvent(error));
 }