inputmethod.html

来自「API資料大全」· HTML 代码 · 共 674 行 · 第 1/3 页

HTML
674
字号
 events to the client component and to request information from the client component.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../java/awt/im/spi/InputMethod.html#setLocale(java.util.Locale)">setLocale</A></B>(<A HREF="../../../../java/util/Locale.html">Locale</A>&nbsp;locale)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempts to set the input locale.</TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="setInputMethodContext(java.awt.im.spi.InputMethodContext)"><!-- --></A><H3>setInputMethodContext</H3><PRE>public void <B>setInputMethodContext</B>(<A HREF="../../../../java/awt/im/spi/InputMethodContext.html">InputMethodContext</A>&nbsp;context)</PRE><DL><DD>Sets the input method context, which is used to dispatch input method events to the client component and to request information from the client component. <p> This method is called once immediately after instantiating this input method.<DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - the input method context for this input method<DT><B>Throws:</B><DD><CODE><A HREF="../../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>context</code> is null</DL></DD></DL><HR><A NAME="setLocale(java.util.Locale)"><!-- --></A><H3>setLocale</H3><PRE>public boolean <B>setLocale</B>(<A HREF="../../../../java/util/Locale.html">Locale</A>&nbsp;locale)</PRE><DL><DD>Attempts to set the input locale. If the input method supports the desired locale, it changes its behavior to support input for the locale and returns true. Otherwise, it returns false and does not change its behavior. <p> This method is called <ul> <li>by <A HREF="../../../../java/awt/im/InputContext.html#selectInputMethod(java.util.Locale)"><CODE>InputContext.selectInputMethod</CODE></A>, <li>when switching to this input method through the user interface if the user     specified a locale or if the previously selected input method's     <A HREF="../../../../java/awt/im/spi/InputMethod.html#getLocale()"><CODE>getLocale</CODE></A> method     returns a non-null value. </ul><DD><DL><DT><B>Parameters:</B><DD><CODE>locale</CODE> - locale to input<DT><B>Returns:</B><DD>whether the specified locale is supported<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 input locale. Might return null in exceptional cases. <p> This method is called <ul> <li>by <A HREF="../../../../java/awt/im/InputContext.html#getLocale()"><CODE>InputContext.getLocale</CODE></A> and <li>when switching from this input method to a different one through the     user interface. </ul><DD><DL><DT><B>Returns:</B><DD>the current input locale, or null</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>[]&nbsp;subsets)</PRE><DL><DD>Sets the subsets of the Unicode character set that this input method is allowed to input. Null may be passed in to indicate that all characters are allowed. <p> This method is called <ul> <li>immediately after instantiating this input method, <li>when switching to this input method from a different one, and <li>by <A HREF="../../../../java/awt/im/InputContext.html#setCharacterSubsets(java.lang.Character.Subset[])"><CODE>InputContext.setCharacterSubsets</CODE></A>. </ul><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&nbsp;enable)</PRE><DL><DD>Enables or disables this 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. <p> This method is called <ul> <li>by <A HREF="../../../../java/awt/im/InputContext.html#setCompositionEnabled(boolean)"><CODE>InputContext.setCompositionEnabled</CODE></A>, <li>when switching to this input method from a different one using the     user interface or     <A HREF="../../../../java/awt/im/InputContext.html#selectInputMethod(java.util.Locale)"><CODE>InputContext.selectInputMethod</CODE></A>,     if the previously selected input method's     <A HREF="../../../../java/awt/im/spi/InputMethod.html#isCompositionEnabled()"><CODE>isCompositionEnabled</CODE></A>     method returns without throwing an exception. </ul><DD><DL><DT><B>Parameters:</B><DD><CODE>enable</CODE> - whether to enable the input method for composition<DT><B>Throws:</B><DD><CODE><A HREF="../../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if this input method does not support the enabling/disabling operation<DT><B>See Also: </B><DD><A HREF="../../../../java/awt/im/spi/InputMethod.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 this input method is enabled. 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. <p> This method is called <ul> <li>by <A HREF="../../../../java/awt/im/InputContext.html#isCompositionEnabled()"><CODE>InputContext.isCompositionEnabled</CODE></A> and <li>when switching from this input method to a different one using the     user interface or     <A HREF="../../../../java/awt/im/InputContext.html#selectInputMethod(java.util.Locale)"><CODE>InputContext.selectInputMethod</CODE></A>. </ul><DD><DL><DT><B>Returns:</B><DD><code>true</code> if this 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 this input method does not support checking whether it is enabled for composition<DT><B>See Also: </B><DD><A HREF="../../../../java/awt/im/spi/InputMethod.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>Starts the reconversion operation. The input method obtains the text to be reconverted from the current client component using the <A HREF="../../../../java/awt/im/InputMethodRequests.html#getSelectedText(java.text.AttributedCharacterIterator.Attribute[])"><CODE>InputMethodRequests.getSelectedText</CODE></A> method. It can use other <code>InputMethodRequests</code> methods to request additional information required for the reconversion operation. The composed and committed text produced by the operation is sent to the client component as a sequence of <code>InputMethodEvent</code>s. If the given text cannot be reconverted, the same text should be sent to the client component as committed text. <p> This method is called by <A HREF="../../../../java/awt/im/InputContext.html#reconvert()"><CODE>InputContext.reconvert</CODE></A>.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the input method does not support the reconversion operation.</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>&nbsp;event)</PRE><DL><DD>Dispatches the event to the input method. If input method support is enabled for the focussed component, incoming events of certain types are dispatched to the current input method for this component before they are dispatched to the component's methods or event listeners. The input method decides whether it needs to handle the event. If it does, it also calls the event's <code>consume</code> method; this causes the event to not get dispatched to the component's event processing methods or event listeners. <p> Events are dispatched if they are instances of InputEvent or its subclasses. This includes instances of the AWT classes KeyEvent and MouseEvent. <p> This method is called by <A HREF="../../../../java/awt/im/InputContext.html#dispatchEvent(java.awt.AWTEvent)"><CODE>InputContext.dispatchEvent</CODE></A>.<DD><DL><DT><B>Parameters:</B><DD><CODE>event</CODE> - the event being dispatched to the input method<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="notifyClientWindowChange(java.awt.Rectangle)"><!-- --></A><H3>notifyClientWindowChange</H3><PRE>public void <B>notifyClientWindowChange</B>(<A HREF="../../../../java/awt/Rectangle.html">Rectangle</A>&nbsp;bounds)</PRE><DL><DD>Notifies this input method of changes in the client window location or state. This method is called while this input method is the current input method of its input context and notifications for it are enabled (see <A HREF="../../../../java/awt/im/spi/InputMethodContext.html#enableClientWindowNotification(java.awt.im.spi.InputMethod, boolean)"><CODE>InputMethodContext.enableClientWindowNotification</CODE></A>). Calls to this method are temporarily suspended if the input context's <A HREF="../../../../java/awt/im/InputContext.html#removeNotify(java.awt.Component)"><CODE>removeNotify</CODE></A> method is called, and resume when the input method is activated

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?