PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|Java|javax|swing|AbstractButton.java =

page 31 of 31



	
	/**
	 * Returns the titled border text
	 *
	 * @return the titled border text, if supported, of the object; 
	 * otherwise, null
	 * @since 1.4
	 */
	public String getTitledBorderText() {
	    return super.getTitledBorderText();
	}
	    
	/**
	 * Returns key bindings associated with this object
	 *
	 * @return the key bindings, if supported, of the object; 
	 * otherwise, null
	 * @see AccessibleKeyBinding
	 * @since 1.4
	 */
	public AccessibleKeyBinding getAccessibleKeyBinding() {
	    int mnemonic = AbstractButton.this.getMnemonic();
	    if (mnemonic == 0) {
		return null;
	    }
	    return new ButtonKeyBinding(mnemonic);
	}

	class ButtonKeyBinding implements AccessibleKeyBinding {
	    int mnemonic;

	    ButtonKeyBinding(int mnemonic) {
		this.mnemonic = mnemonic;
	    }

	    /**
	     * Returns the number of key bindings for this object
	     *
	     * @return the zero-based number of key bindings for this object
	     */
	    public int getAccessibleKeyBindingCount() {
		return 1;
	    }
	    
	    /**
	     * Returns a key binding for this object.  The value returned is an
	     * java.lang.Object which must be cast to appropriate type depending
	     * on the underlying implementation of the key.  For example, if the
	     * Object returned is a javax.swing.KeyStroke, the user of this
	     * method should do the following:
	     * <nf><code>
	     * Component c = <get the component that has the key bindings>
	     * AccessibleContext ac = c.getAccessibleContext();
	     * AccessibleKeyBinding akb = ac.getAccessibleKeyBinding();
	     * for (int i = 0; i < akb.getAccessibleKeyBindingCount(); i++) {
	     *     Object o = akb.getAccessibleKeyBinding(i);
	     *     if (o instanceof javax.swing.KeyStroke) {
	     *         javax.swing.KeyStroke keyStroke = (javax.swing.KeyStroke)o;
	     *         <do something with the key binding>
	     *     }
	     * }
	     * </code></nf>
	     *
	     * @param i zero-based index of the key bindings
	     * @return a javax.lang.Object which specifies the key binding
	     * @exception IllegalArgumentException if the index is
	     * out of bounds
	     * @see #getAccessibleKeyBindingCount
	     */
	    public java.lang.Object getAccessibleKeyBinding(int i) {
		if (i != 0) {
		    throw new IllegalArgumentException();
		}
		return KeyStroke.getKeyStroke(mnemonic, 0);
	    }
	}
    }
}
=31=
THE END

1.25|26|27|28|29|30| < PREV = PAGE 31 =

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 

E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.016489 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)