/** * 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)); }
/** * Instantiates a new Validating text field. * * @param iconManager Icon manager * @param text Text to display in textfield * @param validator Validator instance */ public ValidatingJTextField( final IconManager iconManager, final String text, final Validator<String> validator) { this(iconManager.getImage("input-error"), text, validator); }