Esempio n. 1
0
 /// <summary>
 /// Adds the specified action listener to receive
 /// <code>ActionEvent</code>s from this <code>TrayIcon</code>.
 /// Action events usually occur when a user selects the tray icon,
 /// using either the mouse or keyboard.  The conditions in which
 /// action events are generated are platform-dependent.
 ///
 /// <para>Calling this method with a <code>null</code> value has no
 /// effect.
 /// </para>
 /// <para>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
 /// >AWT Threading Issues</a> for details on AWT's threading model.
 ///
 /// </para>
 /// </summary>
 /// <param name="listener"> the action listener </param>
 /// <seealso cref=           #removeActionListener </seealso>
 /// <seealso cref=           #getActionListeners </seealso>
 /// <seealso cref=           java.awt.event.ActionListener </seealso>
 /// <seealso cref= #setActionCommand(String) </seealso>
 public virtual void AddActionListener(ActionListener listener)
 {
     lock (this)
     {
         if (listener == null)
         {
             return;
         }
         ActionListener = AWTEventMulticaster.Add(ActionListener, listener);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Adds the specified adjustment listener to receive adjustment
 /// events from this <code>ScrollPaneAdjustable</code>.
 /// If <code>l</code> is <code>null</code>, no exception is thrown
 /// and no action is performed.
 /// <para>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
 /// >AWT Threading Issues</a> for details on AWT's threading model.
 ///
 /// </para>
 /// </summary>
 /// <param name="l">   the adjustment listener. </param>
 /// <seealso cref=      #removeAdjustmentListener </seealso>
 /// <seealso cref=      #getAdjustmentListeners </seealso>
 /// <seealso cref=      java.awt.event.AdjustmentListener </seealso>
 /// <seealso cref=      java.awt.event.AdjustmentEvent </seealso>
 public virtual void AddAdjustmentListener(AdjustmentListener l)
 {
     lock (this)
     {
         if (l == null)
         {
             return;
         }
         AdjustmentListener = AWTEventMulticaster.Add(AdjustmentListener, l);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Adds the specified mouse listener to receive mouse events from
 /// this <code>TrayIcon</code>.  Calling this method with a
 /// <code>null</code> value has no effect.
 ///
 /// <para><b>Note</b>: The {@code MouseEvent}'s coordinates (received
 /// from the {@code TrayIcon}) are relative to the screen, not the
 /// {@code TrayIcon}.
 ///
 /// </para>
 /// <para> <b>Note: </b>The <code>MOUSE_ENTERED</code> and
 /// <code>MOUSE_EXITED</code> mouse events are not supported.
 /// </para>
 /// <para>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
 /// >AWT Threading Issues</a> for details on AWT's threading model.
 ///
 /// </para>
 /// </summary>
 /// <param name="listener"> the mouse listener </param>
 /// <seealso cref=      java.awt.event.MouseEvent </seealso>
 /// <seealso cref=      java.awt.event.MouseListener </seealso>
 /// <seealso cref=      #removeMouseListener(MouseListener) </seealso>
 /// <seealso cref=      #getMouseListeners </seealso>
 public virtual void AddMouseListener(MouseListener listener)
 {
     lock (this)
     {
         if (listener == null)
         {
             return;
         }
         MouseListener = AWTEventMulticaster.Add(MouseListener, listener);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Adds the specified item listener to receive item events from
 /// this check box menu item.  Item events are sent in response to user
 /// actions, but not in response to calls to setState().
 /// If l is null, no exception is thrown and no action is performed.
 /// <para>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
 /// >AWT Threading Issues</a> for details on AWT's threading model.
 ///
 /// </para>
 /// </summary>
 /// <param name="l"> the item listener </param>
 /// <seealso cref=           #removeItemListener </seealso>
 /// <seealso cref=           #getItemListeners </seealso>
 /// <seealso cref=           #setState </seealso>
 /// <seealso cref=           java.awt.event.ItemEvent </seealso>
 /// <seealso cref=           java.awt.event.ItemListener
 /// @since         JDK1.1 </seealso>
 public virtual void AddItemListener(ItemListener l)
 {
     lock (this)
     {
         if (l == null)
         {
             return;
         }
         ItemListener  = AWTEventMulticaster.Add(ItemListener, l);
         NewEventsOnly = true;
     }
 }