/** Mutes or unmutes the associated <tt>Call</tt> upon clicking this button. */ public void toggleMute() { if (muteRunner == null) { muteRunner = new Thread(this, getToolTipText()); muteRunner.setDaemon(true); setEnabled(false); muteRunner.start(); } }
/** Toggles state on call in different thread. */ public void run() { try { doRun(); } finally { synchronized (this) { if (Thread.currentThread().equals(muteRunner)) { muteRunner = null; setEnabled(true); } } } }