Skip to content

Commit 1aa7c59

Browse files
committed
[java] Removing IME
Fixes #10573
1 parent b8ede33 commit 1aa7c59

14 files changed

Lines changed: 77 additions & 472 deletions

java/src/org/openqa/selenium/WebDriver.java

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,6 @@ interface Options {
275275
*/
276276
Timeouts timeouts();
277277

278-
/**
279-
* @return the interface for controlling IME engines to generate complex-script input.
280-
* @deprecated Will be removed. IME is not part of W3C WebDriver and does not work on browsers.
281-
*/
282-
@Deprecated
283-
ImeHandler ime();
284-
285278
/**
286279
* @return the interface for managing the current window.
287280
*/
@@ -634,60 +627,6 @@ interface Navigation {
634627
void refresh();
635628
}
636629

637-
/**
638-
* @deprecated Will be removed. IME is not part of W3C WebDriver and does not work on browsers.
639-
* An interface for managing input methods.
640-
*/
641-
@Deprecated
642-
interface ImeHandler {
643-
/**
644-
* All available engines on the machine. To use an engine, it has to be activated.
645-
*
646-
* @return list of available IME engines.
647-
* @throws ImeNotAvailableException if the host does not support IME.
648-
*/
649-
List<String> getAvailableEngines();
650-
651-
/**
652-
* Get the name of the active IME engine. The name string is platform-specific.
653-
*
654-
* @return name of the active IME engine.
655-
* @throws ImeNotAvailableException if the host does not support IME.
656-
*/
657-
String getActiveEngine();
658-
659-
/**
660-
* Indicates whether IME input active at the moment (not if it's available).
661-
*
662-
* @return true if IME input is available and currently active, false otherwise.
663-
* @throws ImeNotAvailableException if the host does not support IME.
664-
*/
665-
boolean isActivated();
666-
667-
/**
668-
* De-activate IME input (turns off the currently activated engine). Note that getActiveEngine
669-
* may still return the name of the engine but isActivated will return false.
670-
*
671-
* @throws ImeNotAvailableException if the host does not support IME.
672-
*/
673-
void deactivate();
674-
675-
/**
676-
* Make an engines that is available (appears on the list returned by getAvailableEngines)
677-
* active. After this call, the only loaded engine on the IME daemon will be this one and the
678-
* input sent using sendKeys will be converted by the engine. Note that this is a
679-
* platform-independent method of activating IME (the platform-specific way being using keyboard
680-
* shortcuts).
681-
*
682-
*
683-
* @param engine name of engine to activate.
684-
* @throws ImeNotAvailableException if the host does not support IME.
685-
* @throws ImeActivationFailedException if the engine is not available or if activation failed
686-
* for other reasons.
687-
*/
688-
void activateEngine(String engine);
689-
}
690-
691630
@Beta
692631
interface Window {
693632

java/src/org/openqa/selenium/remote/DriverCommand.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ public interface DriverCommand {
138138
// W3C Actions APIs
139139
String ACTIONS = "actions";
140140
String CLEAR_ACTIONS_STATE = "clearActionState";
141-
// Those allow interactions with the Input Methods installed on
142-
// the system.
143-
String IME_GET_AVAILABLE_ENGINES = "imeGetAvailableEngines";
144-
String IME_GET_ACTIVE_ENGINE = "imeGetActiveEngine";
145-
String IME_IS_ACTIVATED = "imeIsActivated";
146-
String IME_DEACTIVATE = "imeDeactivate";
147-
String IME_ACTIVATE_ENGINE = "imeActivateEngine";
148141
// Window API
149142
String SET_CURRENT_WINDOW_POSITION = "setWindowPosition";
150143
String GET_CURRENT_WINDOW_POSITION = "getWindowPosition";

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -839,56 +839,12 @@ public Timeouts timeouts() {
839839
return new RemoteTimeouts();
840840
}
841841

842-
/**
843-
* @deprecated Will be removed. IME is not part of W3C WebDriver and does not work on browsers.
844-
*/
845-
@Override
846-
public ImeHandler ime() {
847-
return new RemoteInputMethodManager();
848-
}
849-
850842
@Override
851843
@Beta
852844
public Window window() {
853845
return new RemoteWindow();
854846
}
855847

856-
/**
857-
* @deprecated Will be removed. IME is not part of W3C WebDriver and does not work on browsers.
858-
*/
859-
@Deprecated
860-
protected class RemoteInputMethodManager implements WebDriver.ImeHandler {
861-
862-
@Override
863-
@SuppressWarnings("unchecked")
864-
public List<String> getAvailableEngines() {
865-
Response response = execute(DriverCommand.IME_GET_AVAILABLE_ENGINES);
866-
return (List<String>) response.getValue();
867-
}
868-
869-
@Override
870-
public String getActiveEngine() {
871-
Response response = execute(DriverCommand.IME_GET_ACTIVE_ENGINE);
872-
return (String) response.getValue();
873-
}
874-
875-
@Override
876-
public boolean isActivated() {
877-
Response response = execute(DriverCommand.IME_IS_ACTIVATED);
878-
return (Boolean) response.getValue();
879-
}
880-
881-
@Override
882-
public void deactivate() {
883-
execute(DriverCommand.IME_DEACTIVATE);
884-
}
885-
886-
@Override
887-
public void activateEngine(String engine) {
888-
execute(DriverCommand.IME_ACTIVATE_ENGINE(engine));
889-
}
890-
} // RemoteInputMethodManager class
891-
892848
protected class RemoteTimeouts implements Timeouts {
893849

894850
@Deprecated

java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@
1717

1818
package org.openqa.selenium.remote.codec;
1919

20+
import com.google.common.base.Objects;
21+
import com.google.common.base.Splitter;
22+
import com.google.common.base.Strings;
23+
import com.google.common.collect.ImmutableList;
24+
25+
import org.openqa.selenium.UnsupportedCommandException;
26+
import org.openqa.selenium.internal.Require;
27+
import org.openqa.selenium.json.Json;
28+
import org.openqa.selenium.net.Urls;
29+
import org.openqa.selenium.remote.Command;
30+
import org.openqa.selenium.remote.CommandCodec;
31+
import org.openqa.selenium.remote.SessionId;
32+
import org.openqa.selenium.remote.http.HttpMethod;
33+
import org.openqa.selenium.remote.http.HttpRequest;
34+
35+
import java.util.HashMap;
36+
import java.util.Map;
37+
import java.util.concurrent.ConcurrentHashMap;
38+
2039
import static com.google.common.net.HttpHeaders.CACHE_CONTROL;
2140
import static com.google.common.net.HttpHeaders.CONTENT_LENGTH;
2241
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
@@ -65,11 +84,6 @@
6584
import static org.openqa.selenium.remote.DriverCommand.GET_TITLE;
6685
import static org.openqa.selenium.remote.DriverCommand.GO_BACK;
6786
import static org.openqa.selenium.remote.DriverCommand.GO_FORWARD;
68-
import static org.openqa.selenium.remote.DriverCommand.IME_ACTIVATE_ENGINE;
69-
import static org.openqa.selenium.remote.DriverCommand.IME_DEACTIVATE;
70-
import static org.openqa.selenium.remote.DriverCommand.IME_GET_ACTIVE_ENGINE;
71-
import static org.openqa.selenium.remote.DriverCommand.IME_GET_AVAILABLE_ENGINES;
72-
import static org.openqa.selenium.remote.DriverCommand.IME_IS_ACTIVATED;
7387
import static org.openqa.selenium.remote.DriverCommand.IMPLICITLY_WAIT;
7488
import static org.openqa.selenium.remote.DriverCommand.IS_BROWSER_ONLINE;
7589
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_ENABLED;
@@ -100,25 +114,6 @@
100114
import static org.openqa.selenium.remote.http.Contents.bytes;
101115
import static org.openqa.selenium.remote.http.Contents.string;
102116

103-
import com.google.common.base.Objects;
104-
import com.google.common.base.Splitter;
105-
import com.google.common.base.Strings;
106-
import com.google.common.collect.ImmutableList;
107-
108-
import org.openqa.selenium.UnsupportedCommandException;
109-
import org.openqa.selenium.internal.Require;
110-
import org.openqa.selenium.json.Json;
111-
import org.openqa.selenium.net.Urls;
112-
import org.openqa.selenium.remote.Command;
113-
import org.openqa.selenium.remote.CommandCodec;
114-
import org.openqa.selenium.remote.SessionId;
115-
import org.openqa.selenium.remote.http.HttpMethod;
116-
import org.openqa.selenium.remote.http.HttpRequest;
117-
118-
import java.util.HashMap;
119-
import java.util.Map;
120-
import java.util.concurrent.ConcurrentHashMap;
121-
122117
/**
123118
* A command codec that adheres to the W3C's WebDriver wire protocol.
124119
*
@@ -210,13 +205,6 @@ public AbstractHttpCommandCodec() {
210205
defineCommand(GET_SCREEN_ROTATION, get(sessionId + "/rotation"));
211206
defineCommand(SET_SCREEN_ROTATION, post(sessionId + "/rotation"));
212207

213-
String ime = sessionId + "/ime";
214-
defineCommand(IME_GET_AVAILABLE_ENGINES, get(ime + "/available_engines"));
215-
defineCommand(IME_GET_ACTIVE_ENGINE, get(ime + "/active_engine"));
216-
defineCommand(IME_IS_ACTIVATED, get(ime + "/activated"));
217-
defineCommand(IME_DEACTIVATE, post(ime + "/deactivate"));
218-
defineCommand(IME_ACTIVATE_ENGINE, post(ime + "/activate"));
219-
220208
// Mobile Spec
221209
defineCommand(GET_NETWORK_CONNECTION, get(sessionId + "/network_connection"));
222210
defineCommand(SET_NETWORK_CONNECTION, post(sessionId + "/network_connection"));
@@ -236,6 +224,18 @@ public AbstractHttpCommandCodec() {
236224
defineCommand(SET_USER_VERIFIED, post(webauthnId + "/uv"));
237225
}
238226

227+
protected static CommandSpec delete(String path) {
228+
return new CommandSpec(HttpMethod.DELETE, path);
229+
}
230+
231+
protected static CommandSpec get(String path) {
232+
return new CommandSpec(HttpMethod.GET, path);
233+
}
234+
235+
protected static CommandSpec post(String path) {
236+
return new CommandSpec(HttpMethod.POST, path);
237+
}
238+
239239
@Override
240240
public boolean isSupported(String commandName) {
241241
Require.nonNull("Command name", commandName);
@@ -335,18 +335,6 @@ protected void defineCommand(String name, CommandSpec spec) {
335335
nameToSpec.put(Require.nonNull("Name", name), spec);
336336
}
337337

338-
protected static CommandSpec delete(String path) {
339-
return new CommandSpec(HttpMethod.DELETE, path);
340-
}
341-
342-
protected static CommandSpec get(String path) {
343-
return new CommandSpec(HttpMethod.GET, path);
344-
}
345-
346-
protected static CommandSpec post(String path) {
347-
return new CommandSpec(HttpMethod.POST, path);
348-
}
349-
350338
private String buildUri(
351339
String commandName,
352340
SessionId sessionId,

java/src/org/openqa/selenium/remote/server/JsonHttpCommandHandler.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@
7979
import org.openqa.selenium.remote.server.handler.GetWindowSize;
8080
import org.openqa.selenium.remote.server.handler.GoBack;
8181
import org.openqa.selenium.remote.server.handler.GoForward;
82-
import org.openqa.selenium.remote.server.handler.ImeActivateEngine;
83-
import org.openqa.selenium.remote.server.handler.ImeDeactivate;
84-
import org.openqa.selenium.remote.server.handler.ImeGetActiveEngine;
85-
import org.openqa.selenium.remote.server.handler.ImeGetAvailableEngines;
86-
import org.openqa.selenium.remote.server.handler.ImeIsActivated;
8782
import org.openqa.selenium.remote.server.handler.ImplicitlyWait;
8883
import org.openqa.selenium.remote.server.handler.MaximizeWindow;
8984
import org.openqa.selenium.remote.server.handler.RefreshPage;
@@ -199,11 +194,6 @@
199194
import static org.openqa.selenium.remote.DriverCommand.GET_WINDOW_HANDLES;
200195
import static org.openqa.selenium.remote.DriverCommand.GO_BACK;
201196
import static org.openqa.selenium.remote.DriverCommand.GO_FORWARD;
202-
import static org.openqa.selenium.remote.DriverCommand.IME_ACTIVATE_ENGINE;
203-
import static org.openqa.selenium.remote.DriverCommand.IME_DEACTIVATE;
204-
import static org.openqa.selenium.remote.DriverCommand.IME_GET_ACTIVE_ENGINE;
205-
import static org.openqa.selenium.remote.DriverCommand.IME_GET_AVAILABLE_ENGINES;
206-
import static org.openqa.selenium.remote.DriverCommand.IME_IS_ACTIVATED;
207197
import static org.openqa.selenium.remote.DriverCommand.IMPLICITLY_WAIT;
208198
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_DISPLAYED;
209199
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_ENABLED;
@@ -449,12 +439,6 @@ private void setUpMappings() {
449439
addNewMapping(MOUSE_UP, MouseUp::new);
450440
addNewMapping(SEND_KEYS_TO_ACTIVE_ELEMENT, SendKeyToActiveElement::new);
451441

452-
addNewMapping(IME_GET_AVAILABLE_ENGINES, ImeGetAvailableEngines::new);
453-
addNewMapping(IME_GET_ACTIVE_ENGINE, ImeGetActiveEngine::new);
454-
addNewMapping(IME_IS_ACTIVATED, ImeIsActivated::new);
455-
addNewMapping(IME_DEACTIVATE, ImeDeactivate::new);
456-
addNewMapping(IME_ACTIVATE_ENGINE, ImeActivateEngine::new);
457-
458442
addNewMapping(ACTIONS, W3CActions::new);
459443

460444
// Advanced Touch API

java/src/org/openqa/selenium/remote/server/handler/ImeActivateEngine.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

java/src/org/openqa/selenium/remote/server/handler/ImeDeactivate.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)