diff options
author | 2014-07-30 02:45:59 +0000 | |
---|---|---|
committer | 2014-07-24 16:04:26 +0000 | |
commit | bf2a32100568a01d25edb56d3d9d46b5f5d2c0eb (patch) | |
tree | c532009e253df2ab36db3168cfb8e0c705b6c8f7 /java/src/com/android/inputmethod/event/CombinerChain.java | |
parent | 0b1fa0c1c7572893365c019780357a817158e5ea (diff) | |
parent | 7196566d4f2048a4160acc6271ccb26c73d6fcd6 (diff) | |
download | latinime-bf2a32100568a01d25edb56d3d9d46b5f5d2c0eb.tar.gz latinime-bf2a32100568a01d25edb56d3d9d46b5f5d2c0eb.tar.xz latinime-bf2a32100568a01d25edb56d3d9d46b5f5d2c0eb.zip |
Merge "[HW6] Split processing and applying the event." into lmp-dev
Diffstat (limited to 'java/src/com/android/inputmethod/event/CombinerChain.java')
-rw-r--r-- | java/src/com/android/inputmethod/event/CombinerChain.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java index 61bc11b39..8c6b3d949 100644 --- a/java/src/com/android/inputmethod/event/CombinerChain.java +++ b/java/src/com/android/inputmethod/event/CombinerChain.java @@ -81,11 +81,11 @@ public class CombinerChain { } /** - * Pass a new event through the whole chain. + * Process an event through the combining chain, and return a processed event to apply. * @param previousEvents the list of previous events in this composition * @param newEvent the new event to process */ - public void processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { + public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) { final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents); Event event = newEvent; for (final Combiner combiner : mCombiners) { @@ -97,6 +97,14 @@ public class CombinerChain { break; } } + return event; + } + + /** + * Apply a processed event. + * @param event the event to be applied + */ + public void applyProcessedEvent(final Event event) { if (null != event) { // TODO: figure out the generic way of doing this if (Constants.CODE_DELETE == event.mKeyCode) { |