RemoteCopySetOptionTask.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. package epson.print.copy.Component.ecopycomponent;
  2. import android.os.AsyncTask;
  3. import epson.print.copy.Component.ecopycomponent.ECopyComponent;
  4. import epson.print.copy.Component.ecopycomponent.ECopyOptionItem;
  5. import epson.print.copy.Component.eremoteoperation.ERemoteCopy;
  6. import epson.print.copy.Component.eremoteoperation.ERemoteOperation;
  7. import java.util.ArrayList;
  8. import java.util.HashMap;
  9. import java.util.Iterator;
  10. class RemoteCopySetOptionTask extends AsyncTask<Void, Void, Result> implements ECopyComponent.ITask {
  11. public static int XScale_2L_to_A4_Value = 165;
  12. public static int XScale_2L_to_A4_ValueEx = 173;
  13. public static int XScale_2L_to_KG_Value = 77;
  14. public static int XScale_2L_to_Letter_Value = 157;
  15. public static int XScale_2L_to_Postcard_Value = 76;
  16. public static int XScale_2L_to_Postcard_ValueEx = 89;
  17. public static int XScale_8x10_to_2L_Value = 61;
  18. public static int XScale_A4_to_2L_Value = 59;
  19. public static int XScale_A4_to_A3_Value = 141;
  20. public static int XScale_A4_to_A5_Value = 69;
  21. public static int XScale_A4_to_B5_Value = 85;
  22. public static int XScale_A4_to_KG_Value = 47;
  23. public static int XScale_A4_to_Postcard_Value = 46;
  24. public static int XScale_A4_to_Postcard_ValueEx = 53;
  25. public static int XScale_A5_to_A4_Value = 141;
  26. public static int XScale_Autofit_Value = ECopyOptionItem.CopyMagnificationAutofitValue;
  27. public static int XScale_B5_to_A4_Value = 114;
  28. public static int XScale_B5_to_A4_ValueEx = 120;
  29. public static int XScale_Custom_Value = 0;
  30. public static int XScale_FullSize_Value = 100;
  31. public static int XScale_KG_to_2L_Value = 115;
  32. public static int XScale_KG_to_8x10_Value = 166;
  33. public static int XScale_KG_to_A4_Value = 195;
  34. public static int XScale_KG_to_Letter_Value = 183;
  35. public static int XScale_L_to_2L_Value = 139;
  36. public static int XScale_L_to_2L_ValueEx = 151;
  37. public static int XScale_L_to_A4_Value = 235;
  38. public static int XScale_L_to_A4_ValueEx = 246;
  39. public static int XScale_L_to_Postcard_Value = 110;
  40. public static int XScale_L_to_Postcard_ValueEx = 125;
  41. public static int XScale_Legal_to_Letter_Value = 78;
  42. public static int XScale_Letter_to_11x17_Value = 129;
  43. public static int XScale_Letter_to_2L_Value = 57;
  44. public static int XScale_Letter_to_KG_Value = 45;
  45. public static int XScale_Postcard_to_A4_Value = 201;
  46. public static int XScale_Postcard_to_A4_ValueEx = 219;
  47. ArrayList<ERemoteOperation.ERemoteParam> changableParams;
  48. String clientID;
  49. HashMap<Integer, ECopyOptionItem.ECopyOptionItemChoice> copyScaleMap;
  50. ERemoteCopy operation = new ERemoteCopy();
  51. ECopyComponent.ICopyOptionListener optionChangedListener;
  52. ECopyOptionContext optionContext;
  53. ECopyOptionItem replacedItem;
  54. ECopyOptionItem selectedItem;
  55. ECopyComponent.ICopySystemSettings systemSettings;
  56. HashMap<ECopyOptionItem.ECopyOptionItemChoice, Integer> xscaleMap;
  57. static HashMap<ECopyOptionItem.ECopyOptionItemChoice, Integer> getXScaleMap(ECopyComponent.ECopyType eCopyType) {
  58. HashMap<ECopyOptionItem.ECopyOptionItemChoice, Integer> hashMap = new HashMap<>();
  59. if (eCopyType == ECopyComponent.ECopyType.Borderless) {
  60. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_FullSize, new Integer(XScale_FullSize_Value));
  61. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_Postcard, new Integer(XScale_A4_to_Postcard_ValueEx));
  62. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_Postcard, new Integer(XScale_2L_to_Postcard_ValueEx));
  63. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_Postcard, new Integer(XScale_L_to_Postcard_ValueEx));
  64. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_2L, new Integer(XScale_L_to_2L_ValueEx));
  65. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_A4, new Integer(XScale_2L_to_A4_ValueEx));
  66. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Postcard_to_A4, new Integer(XScale_Postcard_to_A4_ValueEx));
  67. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_A4, new Integer(XScale_L_to_A4_ValueEx));
  68. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_B5_to_A4, new Integer(XScale_B5_to_A4_ValueEx));
  69. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Custom, new Integer(XScale_Custom_Value));
  70. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Autofit, new Integer(XScale_Autofit_Value));
  71. } else if (eCopyType == ECopyComponent.ECopyType.Mirror) {
  72. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_FullSize, new Integer(XScale_FullSize_Value));
  73. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Custom, new Integer(XScale_Custom_Value));
  74. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Autofit, new Integer(XScale_Autofit_Value));
  75. } else if (eCopyType == ECopyComponent.ECopyType.Standard) {
  76. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_FullSize, new Integer(XScale_FullSize_Value));
  77. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Custom, new Integer(XScale_Custom_Value));
  78. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Autofit, new Integer(XScale_Autofit_Value));
  79. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Letter_to_KG, new Integer(XScale_Letter_to_KG_Value));
  80. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_KG_to_Letter, new Integer(XScale_KG_to_Letter_Value));
  81. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Letter_to_2L, new Integer(XScale_Letter_to_2L_Value));
  82. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_Letter, new Integer(XScale_2L_to_Letter_Value));
  83. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_KG_to_A4, new Integer(XScale_KG_to_A4_Value));
  84. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_KG, new Integer(XScale_A4_to_KG_Value));
  85. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_A4, new Integer(XScale_2L_to_A4_Value));
  86. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_2L, new Integer(XScale_A4_to_2L_Value));
  87. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_KG_to_8x10, new Integer(XScale_KG_to_8x10_Value));
  88. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_8x10_to_2L, new Integer(XScale_8x10_to_2L_Value));
  89. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Legal_to_Letter, new Integer(XScale_Legal_to_Letter_Value));
  90. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_Postcard, new Integer(XScale_A4_to_Postcard_Value));
  91. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_Postcard, new Integer(XScale_2L_to_Postcard_Value));
  92. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_Postcard, new Integer(XScale_L_to_Postcard_Value));
  93. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_2L, new Integer(XScale_L_to_2L_Value));
  94. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Postcard_to_A4, new Integer(XScale_Postcard_to_A4_Value));
  95. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_A4, new Integer(XScale_L_to_A4_Value));
  96. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_B5, new Integer(XScale_A4_to_B5_Value));
  97. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_B5_to_A4, new Integer(XScale_B5_to_A4_Value));
  98. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_KG, new Integer(XScale_2L_to_KG_Value));
  99. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_KG_to_2L, new Integer(XScale_KG_to_2L_Value));
  100. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A5_to_A4, new Integer(XScale_A5_to_A4_Value));
  101. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_A5, new Integer(XScale_A4_to_A5_Value));
  102. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_A3, new Integer(XScale_A4_to_A3_Value));
  103. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Letter_to_11x17, new Integer(XScale_Letter_to_11x17_Value));
  104. } else {
  105. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_FullSize, new Integer(XScale_FullSize_Value));
  106. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_Postcard, new Integer(XScale_A4_to_Postcard_Value));
  107. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_Postcard, new Integer(XScale_2L_to_Postcard_Value));
  108. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_Postcard, new Integer(XScale_L_to_Postcard_Value));
  109. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_2L, new Integer(XScale_L_to_2L_Value));
  110. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_2L_to_A4, new Integer(XScale_2L_to_A4_Value));
  111. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Postcard_to_A4, new Integer(XScale_Postcard_to_A4_Value));
  112. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_L_to_A4, new Integer(XScale_L_to_A4_Value));
  113. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_A4_to_B5, new Integer(XScale_A4_to_B5_Value));
  114. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_B5_to_A4, new Integer(XScale_B5_to_A4_Value));
  115. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Custom, new Integer(XScale_Custom_Value));
  116. hashMap.put(ECopyOptionItem.ECopyOptionItemChoice.XScale_Autofit, new Integer(XScale_Autofit_Value));
  117. }
  118. return hashMap;
  119. }
  120. static HashMap<Integer, ECopyOptionItem.ECopyOptionItemChoice> getCopyMagnificationMap(HashMap<ECopyOptionItem.ECopyOptionItemChoice, Integer> hashMap) {
  121. HashMap<Integer, ECopyOptionItem.ECopyOptionItemChoice> hashMap2 = new HashMap<>();
  122. for (ECopyOptionItem.ECopyOptionItemChoice next : hashMap.keySet()) {
  123. hashMap2.put(Integer.valueOf(hashMap.get(next).intValue()), next);
  124. }
  125. return hashMap2;
  126. }
  127. public static ECopyOptionItem.ECopyOptionItemChoice getScaleChoice(ECopyComponent.ECopyType eCopyType, int i) {
  128. ECopyOptionItem.ECopyOptionItemChoice eCopyOptionItemChoice = getCopyMagnificationMap(getXScaleMap(eCopyType)).get(Integer.valueOf(i));
  129. return eCopyOptionItemChoice != null ? eCopyOptionItemChoice : ECopyOptionItem.ECopyOptionItemChoice.XScale_Custom;
  130. }
  131. public static int getcopyMagnification(ECopyComponent.ECopyType eCopyType, ECopyOptionItem.ECopyOptionItemChoice eCopyOptionItemChoice) {
  132. int intValue = getXScaleMap(eCopyType).get(eCopyOptionItemChoice).intValue();
  133. if (intValue != 0) {
  134. return intValue;
  135. }
  136. return 0;
  137. }
  138. class Result {
  139. ArrayList<ECopyOptionItem> changedItems;
  140. ECopyComponent.ICopyOptionListener.CopyOptionChangedError error;
  141. ECopyOptionItem selectedItem;
  142. Result() {
  143. }
  144. }
  145. public RemoteCopySetOptionTask(ECopyOptionItem eCopyOptionItem, ECopyComponent.ICopyOptionListener iCopyOptionListener) {
  146. this.selectedItem = eCopyOptionItem;
  147. this.optionChangedListener = iCopyOptionListener;
  148. }
  149. public static int scaleValue(ECopyOptionItem.ECopyOptionItemChoice eCopyOptionItemChoice) {
  150. return getXScaleMap(ECopyComponent.ECopyType.Standard).get(eCopyOptionItemChoice).intValue();
  151. }
  152. public ECopyComponent.ICopyCancelRequest start() {
  153. super.execute(new Void[0]);
  154. return null;
  155. }
  156. public void setSystemSettings(ECopyComponent.ICopySystemSettings iCopySystemSettings) {
  157. this.systemSettings = iCopySystemSettings;
  158. }
  159. public void setRequestConnectionTimeout(int i) {
  160. this.operation.setRequestConnectionTimeout(i);
  161. }
  162. public void setClientID(String str) {
  163. this.clientID = str;
  164. }
  165. public void setOptionContext(ECopyOptionContext eCopyOptionContext) {
  166. this.optionContext = eCopyOptionContext;
  167. this.replacedItem = this.optionContext.replace(new ECopyOptionItem(this.selectedItem));
  168. this.changableParams = new ArrayList<>();
  169. this.changableParams.add(ERemoteOperation.ERemoteParam.print_media_size);
  170. this.changableParams.add(ERemoteOperation.ERemoteParam.print_media_type);
  171. this.changableParams.add(ERemoteOperation.ERemoteParam.scan_content_type);
  172. this.changableParams.add(ERemoteOperation.ERemoteParam.print_media_source);
  173. this.changableParams.add(ERemoteOperation.ERemoteParam.print_quality);
  174. this.xscaleMap = getXScaleMap(eCopyOptionContext.copyType);
  175. this.copyScaleMap = getCopyMagnificationMap(this.xscaleMap);
  176. }
  177. public Result getResultLocalOptions() {
  178. Result result = new Result();
  179. result.selectedItem = this.selectedItem;
  180. result.changedItems = new ArrayList<>();
  181. ECopyOptionItem.ECopyOptionItemKey key = this.selectedItem.getKey();
  182. if (key == ECopyOptionItem.ECopyOptionItemKey.CopyMagnification) {
  183. result.changedItems.add(this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.XScale));
  184. } else if (key == ECopyOptionItem.ECopyOptionItemKey.XScale) {
  185. ECopyOptionItem copyOptionItemOf = this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.CopyMagnification);
  186. int intValue = this.xscaleMap.get(this.selectedItem.getSelectedChoice()).intValue();
  187. if (intValue != XScale_Custom_Value) {
  188. copyOptionItemOf.selectValue(intValue);
  189. }
  190. if (intValue != ECopyOptionItem.CopyMagnificationAutofitValue) {
  191. copyOptionItemOf.enabled = true;
  192. } else {
  193. copyOptionItemOf.enabled = false;
  194. }
  195. result.changedItems.add(copyOptionItemOf);
  196. } else {
  197. result.changedItems = null;
  198. }
  199. return result;
  200. }
  201. protected Result doInBackground(Void... voidArr) {
  202. this.operation.setHostIP(this.systemSettings.getPrinterIPAddress());
  203. if (this.selectedItem.isLocalOption) {
  204. return getResultLocalOptions();
  205. }
  206. ERemoteCopy.ERemoteCopyOptionsResult options = this.operation.getOptions(new ERemoteCopy.IRemoteCopyOptionsParameter() {
  207. public boolean default_as_fixed() {
  208. return true;
  209. }
  210. public String client_id() {
  211. return RemoteCopySetOptionTask.this.clientID;
  212. }
  213. public ERemoteOperation.ERemoteParam layout() {
  214. return ECopyOptionItem.layoutOf(RemoteCopySetOptionTask.this.optionContext.getCopyType());
  215. }
  216. public ERemoteOperation.ERemoteParam scan_sides() {
  217. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionsResult().parameter_default(ERemoteOperation.ERemoteParam.scan_sides);
  218. }
  219. public ERemoteOperation.ERemoteParam print_sides() {
  220. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionsResult().parameter_default(ERemoteOperation.ERemoteParam.print_sides);
  221. }
  222. public ERemoteOperation.ERemoteParam scan_media_size() {
  223. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionsResult().parameter_default(ERemoteOperation.ERemoteParam.scan_media_size);
  224. }
  225. public ERemoteOperation.ERemoteParam scan_content_type() {
  226. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.ScanContentType).getSelectedChoice().param;
  227. }
  228. public ERemoteOperation.ERemoteParam print_media_type() {
  229. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.PrintMediaType).getSelectedChoice().param;
  230. }
  231. public ERemoteOperation.ERemoteParam print_media_size() {
  232. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.PrintMediaSize).getSelectedChoice().param;
  233. }
  234. public ERemoteOperation.ERemoteParam print_media_source() {
  235. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.PrintMediaSource).getSelectedChoice().param;
  236. }
  237. public ERemoteOperation.ERemoteParam print_quality() {
  238. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionItemOf(ECopyOptionItem.ECopyOptionItemKey.PrintQuality).getSelectedChoice().param;
  239. }
  240. public ERemoteOperation.ERemoteParam print_sheet_collate() {
  241. return RemoteCopySetOptionTask.this.optionContext.getCopyOptionsResult().parameter_default(ERemoteOperation.ERemoteParam.print_sheet_collate);
  242. }
  243. public ArrayList<ERemoteOperation.ERemoteParam> fixed_parameters() {
  244. return new ArrayList<>();
  245. }
  246. public ArrayList<ERemoteOperation.ERemoteParam> preferred_parameters() {
  247. ArrayList<ERemoteOperation.ERemoteParam> arrayList = new ArrayList<>();
  248. arrayList.add(ERemoteOperation.ERemoteParam.print_sheet_collate);
  249. arrayList.add(ERemoteOperation.ERemoteParam.scan_sides);
  250. arrayList.add(ERemoteOperation.ERemoteParam.layout);
  251. arrayList.add(ERemoteOperation.ERemoteParam.print_sides);
  252. arrayList.add(ERemoteOperation.ERemoteParam.scan_media_size);
  253. arrayList.add(ERemoteOperation.ERemoteParam.print_media_size);
  254. arrayList.add(ERemoteOperation.ERemoteParam.print_media_type);
  255. arrayList.add(ERemoteOperation.ERemoteParam.scan_content_type);
  256. arrayList.add(ERemoteOperation.ERemoteParam.print_quality);
  257. arrayList.add(ERemoteOperation.ERemoteParam.print_media_source);
  258. return arrayList;
  259. }
  260. public ArrayList<ERemoteOperation.ERemoteParam> priority_order() {
  261. ArrayList<ERemoteOperation.ERemoteParam> arrayList = new ArrayList<>();
  262. arrayList.add(ERemoteOperation.ERemoteParam.print_sheet_collate);
  263. arrayList.add(ERemoteOperation.ERemoteParam.scan_sides);
  264. arrayList.add(ERemoteOperation.ERemoteParam.layout);
  265. arrayList.add(ERemoteOperation.ERemoteParam.print_sides);
  266. arrayList.add(ERemoteOperation.ERemoteParam.scan_media_size);
  267. arrayList.add(ERemoteOperation.ERemoteParam.print_media_size);
  268. arrayList.add(ERemoteOperation.ERemoteParam.print_media_type);
  269. arrayList.add(ERemoteOperation.ERemoteParam.scan_content_type);
  270. arrayList.add(ERemoteOperation.ERemoteParam.print_quality);
  271. arrayList.add(ERemoteOperation.ERemoteParam.print_media_source);
  272. return arrayList;
  273. }
  274. });
  275. Result result = new Result();
  276. result.selectedItem = this.selectedItem;
  277. if (options.success()) {
  278. this.optionContext.setCopyOptionsResult(options);
  279. result.changedItems = new ArrayList<>();
  280. Iterator<ERemoteOperation.ERemoteParam> it = this.changableParams.iterator();
  281. while (it.hasNext()) {
  282. ECopyOptionItem createOptionItem = ECopyOptionItem.createOptionItem(it.next(), options);
  283. if (this.optionContext.isChanged(createOptionItem)) {
  284. result.changedItems.add(createOptionItem);
  285. this.optionContext.replace(createOptionItem);
  286. }
  287. }
  288. if (result.changedItems.size() == 0) {
  289. result.changedItems = null;
  290. }
  291. } else {
  292. if (options.isNull(ERemoteOperation.ERemoteParam.success)) {
  293. result.error = ECopyComponent.ICopyOptionListener.CopyOptionChangedError.ErrorCommunication;
  294. } else {
  295. result.error = ECopyComponent.ICopyOptionListener.CopyOptionChangedError.Error;
  296. }
  297. result.selectedItem = new ECopyOptionItem(this.replacedItem);
  298. this.optionContext.replace(this.replacedItem);
  299. }
  300. return result;
  301. }
  302. protected void onPostExecute(Result result) {
  303. this.optionChangedListener.onCopyOptionChanged(result.selectedItem, result.changedItems, result.error);
  304. }
  305. }