inputcontext.html
来自「API資料大全」· HTML 代码 · 共 544 行 · 第 1/2 页
HTML
544 行
This method is protected so clients cannot instantiate InputContext directly. Input contexts are obtained by calling <A HREF="../../../java/awt/im/InputContext.html#getInstance()"><CODE>getInstance()</CODE></A>.</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getInstance()"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../../java/awt/im/InputContext.html">InputContext</A> <B>getInstance</B>()</PRE><DL><DD>Returns a new InputContext instance.</DL><HR><A NAME="selectInputMethod(java.util.Locale)"><!-- --></A><H3>selectInputMethod</H3><PRE>public boolean <B>selectInputMethod</B>(<A HREF="../../../java/util/Locale.html">Locale</A> locale)</PRE><DL><DD>Selects an input method that supports the given locale. If the currently selected input method supports the desired locale or if there's no input method available that supports the desired locale, the current input method remains active. Otherwise, an input method is selected that supports text input for the desired locale. Before switching to a different input method, any currently uncommitted text is committed. If no input method supporting the desired locale is available, then false is returned. <p> A text editing component may call this method, for example, when the user changes the insertion point, so that the user can immediately continue typing in the language of the surrounding text.<DD><DL><DT><B>Parameters:</B><DD><CODE>locale</CODE> - The desired new locale.<DT><B>Returns:</B><DD>Whether the input method that's active after this call supports the desired locale.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>locale</code> is null</DL></DD></DL><HR><A NAME="getLocale()"><!-- --></A><H3>getLocale</H3><PRE>public <A HREF="../../../java/util/Locale.html">Locale</A> <B>getLocale</B>()</PRE><DL><DD>Returns the current locale of the current input method. Returns null if the input context does not have a current input method or the input method's <A HREF="../../../java/awt/im/spi/InputMethod.html#getLocale()"><CODE>InputMethod.getLocale()</CODE></A> returns null.<DD><DL><DT><B>Returns:</B><DD>the current locale of the current input method<DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="setCharacterSubsets(java.lang.Character.Subset[])"><!-- --></A><H3>setCharacterSubsets</H3><PRE>public void <B>setCharacterSubsets</B>(<A HREF="../../../java/lang/Character.Subset.html">Character.Subset</A>[] subsets)</PRE><DL><DD>Sets the subsets of the Unicode character set that input methods of this input context should be allowed to input. Null may be passed in to indicate that all characters are allowed. The initial value is null. The setting applies to the current input method as well as input methods selected after this call is made. However, applications cannot rely on this call having the desired effect, since this setting cannot be passed on to all host input methods - applications still need to apply their own character validation. If no input methods are available, then this method has no effect.<DD><DL><DT><B>Parameters:</B><DD><CODE>subsets</CODE> - The subsets of the Unicode character set from which characters may be input</DL></DD></DL><HR><A NAME="setCompositionEnabled(boolean)"><!-- --></A><H3>setCompositionEnabled</H3><PRE>public void <B>setCompositionEnabled</B>(boolean enable)</PRE><DL><DD>Enables or disables the current input method for composition, depending on the value of the parameter <code>enable</code>. <p> An input method that is enabled for composition interprets incoming events for both composition and control purposes, while a disabled input method does not interpret events for composition. Note however that events are passed on to the input method regardless whether it is enabled or not, and that an input method that is disabled for composition may still interpret events for control purposes, including to enable or disable itself for composition.<DD><DL><DT><B>Parameters:</B><DD><CODE>enable</CODE> - whether to enable the current input method for composition<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if there is no current input method available or the current input method does not support the enabling/disabling operation<DT><B>Since: </B><DD>1.3</DD><DT><B>See Also: </B><DD><A HREF="../../../java/awt/im/InputContext.html#isCompositionEnabled()"><CODE>isCompositionEnabled()</CODE></A></DL></DD></DL><HR><A NAME="isCompositionEnabled()"><!-- --></A><H3>isCompositionEnabled</H3><PRE>public boolean <B>isCompositionEnabled</B>()</PRE><DL><DD>Determines whether the current input method is enabled for composition. An input method that is enabled for composition interprets incoming events for both composition and control purposes, while a disabled input method does not interpret events for composition.<DD><DL><DT><B>Returns:</B><DD><code>true</code> if the current input method is enabled for composition; <code>false</code> otherwise<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if there is no current input method available or the current input method does not support checking whether it is enabled for composition<DT><B>Since: </B><DD>1.3</DD><DT><B>See Also: </B><DD><A HREF="../../../java/awt/im/InputContext.html#setCompositionEnabled(boolean)"><CODE>setCompositionEnabled(boolean)</CODE></A></DL></DD></DL><HR><A NAME="reconvert()"><!-- --></A><H3>reconvert</H3><PRE>public void <B>reconvert</B>()</PRE><DL><DD>Asks the current input method to reconvert text from the current client component. The input method obtains the text to be reconverted from the client component using the <A HREF="../../../java/awt/im/InputMethodRequests.html#getSelectedText(java.text.AttributedCharacterIterator.Attribute[])"><CODE>InputMethodRequests.getSelectedText</CODE></A> method. The other <code>InputMethodRequests</code> methods must be prepared to deal with further information requests by the input method. The composed and/or committed text will be sent to the client component as a sequence of <code>InputMethodEvent</code>s. If the input method cannot reconvert the given text, the text is returned as committed text in an <code>InputMethodEvent</code>.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if there is no current input method available or the current input method does not support the reconversion operation.<DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="dispatchEvent(java.awt.AWTEvent)"><!-- --></A><H3>dispatchEvent</H3><PRE>public void <B>dispatchEvent</B>(<A HREF="../../../java/awt/AWTEvent.html">AWTEvent</A> event)</PRE><DL><DD>Dispatches an event to the active input method. Called by AWT. If no input method is available, then the event will never be consumed.<DD><DL><DT><B>Parameters:</B><DD><CODE>event</CODE> - The event<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>event</code> is null</DL></DD></DL><HR><A NAME="removeNotify(java.awt.Component)"><!-- --></A><H3>removeNotify</H3><PRE>public void <B>removeNotify</B>(<A HREF="../../../java/awt/Component.html">Component</A> client)</PRE><DL><DD>Notifies the input context that a client component has been removed from its containment hierarchy, or that input method support has been disabled for the component. This method is usually called from the client component's <A HREF="../../../java/awt/Component.html#removeNotify()"><CODE>Component.removeNotify</CODE></A> method. Potentially pending input from input methods for this component is discarded. If no input methods are available, then this method has no effect.<DD><DL><DT><B>Parameters:</B><DD><CODE>client</CODE> - Client component<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>client</code> is null</DL></DD></DL><HR><A NAME="endComposition()"><!-- --></A><H3>endComposition</H3><PRE>public void <B>endComposition</B>()</PRE><DL><DD>Ends any input composition that may currently be going on in this context. Depending on the platform and possibly user preferences, this may commit or delete uncommitted text. Any changes to the text are communicated to the active component using an input method event. If no input methods are available, then this method has no effect. <p> A text editing component may call this in a variety of situations, for example, when the user moves the insertion point within the text (but outside the composed text), or when the component's text is saved to a file or copied to the clipboard.</DL><HR><A NAME="dispose()"><!-- --></A><H3>dispose</H3><PRE>public void <B>dispose</B>()</PRE><DL><DD>Disposes of the input context and release the resources used by it. Called by AWT for the default input context of each Window. If no input methods are available, then this method has no effect.</DL><HR><A NAME="getInputMethodControlObject()"><!-- --></A><H3>getInputMethodControlObject</H3><PRE>public <A HREF="../../../java/lang/Object.html">Object</A> <B>getInputMethodControlObject</B>()</PRE><DL><DD>Returns a control object from the current input method, or null. A control object provides methods that control the behavior of the input method or obtain information from the input method. The type of the object is an input method specific class. Clients have to compare the result against known input method control object classes and cast to the appropriate class to invoke the methods provided. <p> If no input methods are available or the current input method does not provide an input method control object, then null is returned.<DD><DL><DT><B>Returns:</B><DD>A control object from the current input method, or null.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InputContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../java/awt/im/InputMethodHighlight.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="InputContext.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?