提交 95c2e18f 编写于 作者: H Hollokin

删除多余空格

Signed-off-by: NHollokin <taoyuxin2@huawei.com>
上级 cee270cb
......@@ -31,13 +31,13 @@ import inputMethod from '@ohos.inputMethod';
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| name<sup>9+</sup> | string | 是 | 否 | 输入法内部名称。必填。|
| id<sup>9+</sup> | string | 是 | 否 | 输入法唯一标识。必填。|
| label<sup>9+</sup> | string | 是 | 否 | 输入法对外显示名称。 非必填。|
| labelId<sup>10+</sup> | string | 是 | 否 | 输入法对外显示名称资源号。 非必填。|
| icon<sup>9+</sup> | string | 是 | 否 | 输入法图标数据。非必填。 |
| iconId<sup>9+</sup> | number | 是 | 否 | 输入法图标资源号。非必填。 |
| extra<sup>10+</sup> | object | 是 | 是 | 输入法扩展信息。 非必填。|
| name<sup>9+</sup> | string | 是 | 否 | 必填。输入法内部名称。|
| id<sup>9+</sup> | string | 是 | 否 | 必填。输入法唯一标识。|
| label<sup>9+</sup> | string | 是 | 否 | 非必填。输入法对外显示名称。|
| labelId<sup>10+</sup> | string | 是 | 否 | 非必填。输入法对外显示名称资源号。|
| icon<sup>9+</sup> | string | 是 | 否 | 非必填。输入法图标数据。|
| iconId<sup>9+</sup> | number | 是 | 否 | 非必填。输入法图标资源号。 |
| extra<sup>10+</sup> | object | 是 | 是 | 非必填。输入法扩展信息。|
| packageName<sup>(deprecated)</sup> | string | 是 | 否 | 输入法包名。必填。<br/>**说明:** 从API version 8开始支持,从API version 9开始废弃,建议使用name替代。 |
| methodId<sup>(deprecated)</sup> | string | 是 | 否 | 输入法唯一标识。必填。<br/>**说明:** 从API version 8开始支持,从API version 9开始废弃,建议使用id替代。 |
......@@ -126,15 +126,15 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback&lt;boolea
**示例:**
```js
let prop = inputMethod.getCurrentInputMethod();
let currentIme = inputMethod.getCurrentInputMethod();
try{
inputMethod.switchInputMethod(prop, (err, result) => {
inputMethod.switchInputMethod(currentIme, (err, result) => {
if (err) {
console.error(`Failed to switchInputMethod: ${JSON.stringify(err)}`);
return;
}
if (result) {
console.info('Succeeded in switching inputmethod.');
console.log('Succeeded in switching inputmethod.');
} else {
console.error('Failed to switchInputMethod.');
}
......@@ -176,11 +176,11 @@ switchInputMethod(target: InputMethodProperty): Promise&lt;boolean&gt;
**示例:**
```js
let prop = inputMethod.getCurrentInputMethod();
let currentIme = inputMethod.getCurrentInputMethod();
try {
inputMethod.switchInputMethod(prop).then((result) => {
inputMethod.switchInputMethod(currentIme).then((result) => {
if (result) {
console.info('Succeeded in switching inputmethod.');
console.log('Succeeded in switching inputmethod.');
} else {
console.error('Failed to switchInputMethod.');
}
......@@ -258,7 +258,7 @@ try {
return;
}
if (result) {
console.info('Succeeded in switching currentInputMethodSubtype.');
console.log('Succeeded in switching currentInputMethodSubtype.');
} else {
console.error('Failed to switchCurrentInputMethodSubtype');
}
......@@ -315,7 +315,7 @@ try {
extra: {}
}).then((result) => {
if (result) {
console.info('Succeeded in switching currentInputMethodSubtype.');
console.log('Succeeded in switching currentInputMethodSubtype.');
} else {
console.error('Failed to switchCurrentInputMethodSubtype.');
}
......@@ -377,16 +377,16 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
**示例:**
```js
let im = inputMethod.getCurrentInputMethod();
let currentIme = inputMethod.getCurrentInputMethod();
let imSubType = inputMethod.getCurrentInputMethodSubtype();
try {
inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType, (err,result) => {
inputMethod.switchCurrentInputMethodAndSubtype(currentIme, imSubType, (err,result) => {
if (err) {
console.error(`Failed to switchCurrentInputMethodAndSubtype: ${JSON.stringify(err)}`);
return;
}
if (result) {
console.info('Succeeded in switching currentInputMethodAndSubtype.');
console.log('Succeeded in switching currentInputMethodAndSubtype.');
} else {
console.error('Failed to switchCurrentInputMethodAndSubtype.');
}
......@@ -431,12 +431,12 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
**示例:**
```js
let im = inputMethod.getCurrentInputMethod();
let currentIme = inputMethod.getCurrentInputMethod();
let imSubType = inputMethod.getCurrentInputMethodSubtype();
try {
inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType).then((result) => {
inputMethod.switchCurrentInputMethodAndSubtype(currentIme, imSubType).then((result) => {
if (result) {
console.info('Succeeded in switching currentInputMethodAndSubtype.');
console.log('Succeeded in switching currentInputMethodAndSubtype.');
} else {
console.error('Failed to switchCurrentInputMethodAndSubtype.');
}
......@@ -500,7 +500,7 @@ let inputMethodSetting = inputMethod.getInputMethodSetting();
文本输入类型。
**系统能力**: SystemCapability.MiscServices.InputMethodFramework
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 值 |说明 |
| -------- | -------- |-------- |
......@@ -518,7 +518,7 @@ let inputMethodSetting = inputMethod.getInputMethodSetting();
输入法Enter键所代表的功能类型。
**系统能力**: SystemCapability.MiscServices.InputMethodFramework
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 值 |说明 |
| -------- | -------- |-------- |
......@@ -535,7 +535,7 @@ let inputMethodSetting = inputMethod.getInputMethodSetting();
输入法软键盘状态。
**系统能力**: SystemCapability.MiscServices.InputMethodFramework
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 值 |说明 |
| -------- | -------- |-------- |
......@@ -547,7 +547,7 @@ let inputMethodSetting = inputMethod.getInputMethodSetting();
光标移动方向。
**系统能力**: SystemCapability.MiscServices.InputMethodFramework
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 值 |说明 |
| -------- | -------- |-------- |
......@@ -560,7 +560,7 @@ let inputMethodSetting = inputMethod.getInputMethodSetting();
对编辑框中文本的扩展编辑操作类型。
**系统能力**: SystemCapability.MiscServices.InputMethodFramework
**系统能力:** SystemCapability.MiscServices.InputMethodFramework
| 名称 | 值 |说明 |
| -------- | -------- |-------- |
......@@ -680,7 +680,7 @@ try {
console.error(`Failed to attach: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in attaching the inputMethod.');
console.log('Succeeded in attaching the inputMethod.');
});
} catch(err) {
console.error(`Failed to attach: ${JSON.stringify(err)}`);
......@@ -730,7 +730,7 @@ try {
}
};
inputMethodController.attach(true, textConfig).then(() => {
console.info('Succeeded in attaching inputMethod.');
console.log('Succeeded in attaching inputMethod.');
}).catch((err) => {
console.error(`Failed to attach: ${JSON.stringify(err)}`);
})
......@@ -773,7 +773,7 @@ inputMethodController.showTextInput((err) => {
console.error(`Failed to showTextInput: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in showing the inputMethod.');
console.log('Succeeded in showing the inputMethod.');
});
```
......@@ -807,7 +807,7 @@ showTextInput(): Promise&lt;void&gt;
```js
inputMethodController.showTextInput().then(() => {
console.info('Succeeded in showing text input.');
console.log('Succeeded in showing text input.');
}).catch((err) => {
console.error(`Failed to showTextInput: ${JSON.stringify(err)}`);
});
......@@ -849,7 +849,7 @@ inputMethodController.hideTextInput((err) => {
console.error(`Failed to hideTextInput: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in hiding text input.');
console.log('Succeeded in hiding text input.');
});
```
......@@ -885,7 +885,7 @@ hideTextInput(): Promise&lt;void&gt;
```js
inputMethodController.hideTextInput().then(() => {
console.info('Succeeded in hiding inputMethod.');
console.log('Succeeded in hiding inputMethod.');
}).catch((err) => {
console.error(`Failed to hideTextInput: ${JSON.stringify(err)}`);
})
......@@ -922,7 +922,7 @@ inputMethodController.detach((err) => {
console.error(`Failed to detach: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in detaching inputMethod.');
console.log('Succeeded in detaching inputMethod.');
});
```
......@@ -953,7 +953,7 @@ detach(): Promise&lt;void&gt;
```js
inputMethodController.detach().then(() => {
console.info('Succeeded in detaching inputMethod.');
console.log('Succeeded in detaching inputMethod.');
}).catch((err) => {
console.error(`Failed to detach: ${JSON.stringify(err)}`);
});
......@@ -996,7 +996,7 @@ try {
console.error(`Failed to setCallingWindow: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in setting callingWindow.');
console.log('Succeeded in setting callingWindow.');
});
} catch(err) {
console.error(`Failed to setCallingWindow: ${JSON.stringify(err)}`);
......@@ -1041,7 +1041,7 @@ setCallingWindow(windowId: number): Promise&lt;void&gt;
try {
let windowId: number = 2000;
inputMethodController.setCallingWindow(windowId).then(() => {
console.info('Succeeded in setting callingWindow.');
console.log('Succeeded in setting callingWindow.');
}).catch((err) => {
console.error(`Failed to setCallingWindow: ${JSON.stringify(err)}`);
})
......@@ -1086,7 +1086,7 @@ try {
console.error(`Failed to updateCursor: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in updating cursorInfo.');
console.log('Succeeded in updating cursorInfo.');
});
} catch(err) {
console.error(`Failed to updateCursor: ${JSON.stringify(err)}`);
......@@ -1130,7 +1130,7 @@ updateCursor(cursorInfo: CursorInfo): Promise&lt;void&gt;
```js
try {
inputMethodController.updateCursor({left: 0, top: 0, width: 600, height: 800}).then(() => {
console.info('Succeeded in updating cursorInfo.');
console.log('Succeeded in updating cursorInfo.');
}).catch((err) => {
console.error(`Failed to updateCursor: ${JSON.stringify(err)}`);
})
......@@ -1175,7 +1175,7 @@ try {
console.error(`Failed to changeSelection: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in changing selection.');
console.log('Succeeded in changing selection.');
});
} catch(err) {
console.error(`Failed to changeSelection: ${JSON.stringify(err)}`);
......@@ -1219,7 +1219,7 @@ changeSelection(text: string, start: number, end: number): Promise&lt;void&gt;
```js
try {
inputMethodController.changeSelection('test', 0, 5).then(() => {
console.info('Succeeded in changing selection.');
console.log('Succeeded in changing selection.');
}).catch((err) => {
console.error(`Failed to changeSelection: ${JSON.stringify(err)}`);
})
......@@ -1262,7 +1262,7 @@ try {
console.error(`Failed to updateAttribute: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in updating attribute.');
console.log('Succeeded in updating attribute.');
});
} catch(err) {
console.error(`Failed to updateAttribute: ${JSON.stringify(err)}`);
......@@ -1304,7 +1304,7 @@ updateAttribute(attribute: InputAttribute): Promise&lt;void&gt;
```js
try {
inputMethodController.updateAttribute({textInputType: 0, enterKeyType: 1}).then(() => {
console.info('Succeeded in updating attribute.');
console.log('Succeeded in updating attribute.');
}).catch((err) => {
console.error(`Failed to updateAttribute: ${JSON.stringify(err)}`);
})
......@@ -1348,7 +1348,7 @@ try {
return;
}
if (result) {
console.info('Succeeded in stopping inputSession.');
console.log('Succeeded in stopping inputSession.');
} else {
console.error('Failed to stopInputSession.');
}
......@@ -1389,7 +1389,7 @@ stopInputSession(): Promise&lt;boolean&gt;
try {
inputMethodController.stopInputSession().then((result) => {
if (result) {
console.info('Succeeded in stopping inputSession.');
console.log('Succeeded in stopping inputSession.');
} else {
console.error('Failed to stopInputSession.');
}
......@@ -1433,7 +1433,7 @@ showSoftKeyboard(callback: AsyncCallback&lt;void&gt;): void
```js
inputMethodController.showSoftKeyboard((err) => {
if (!err) {
console.info('Succeeded in showing softKeyboard.');
console.log('Succeeded in showing softKeyboard.');
} else {
console.error(`Failed to show softKeyboard: ${JSON.stringify(err)}`);
}
......@@ -1509,7 +1509,7 @@ hideSoftKeyboard(callback: AsyncCallback&lt;void&gt;): void
```js
inputMethodController.hideSoftKeyboard((err) => {
if (!err) {
console.info('Succeeded in hiding softKeyboard.');
console.log('Succeeded in hiding softKeyboard.');
} else {
console.error(`Failed to hide softKeyboard: ${JSON.stringify(err)}`);
}
......@@ -1582,7 +1582,7 @@ inputMethodController.stopInput((err, result) => {
return;
}
if (result) {
console.info('Succeeded in stopping input.');
console.log('Succeeded in stopping input.');
} else {
console.error('Failed to stopInput.');
}
......@@ -1614,7 +1614,7 @@ stopInput(): Promise&lt;boolean&gt;
```js
inputMethodController.stopInput().then((result) => {
if (result) {
console.info('Succeeded in stopping input.');
console.log('Succeeded in stopping input.');
} else {
console.error('Failed to stopInput.');
}
......@@ -1651,7 +1651,7 @@ on(type: 'insertText', callback: (text: string) => void): void;
```js
try {
inputMethodController.on('insertText', (text) => {
console.info(`Succeeded in subscribing insertText: ${text}`);
console.log(`Succeeded in subscribing insertText: ${text}`);
});
} catch(err) {
console.error(`Failed to subscribe insertText: ${JSON.stringify(err)}`);
......@@ -1706,7 +1706,7 @@ on(type: 'deleteLeft' | 'deleteRight', callback: (length: number) => void): void
```js
try {
inputMethodController.on('deleteLeft', (length) => {
console.info(`Succeeded in subscribing deleteLeft, length: ${length}`);
console.log(`Succeeded in subscribing deleteLeft, length: ${length}`);
});
} catch(err) {
console.error(`Failed to subscribe deleteLeft: ${JSON.stringify(err)}`);
......@@ -1714,7 +1714,7 @@ try {
try {
inputMethodController.on('deleteRight', (length) => {
console.info(`Succeeded in subscribing deleteRight, length: ${length}`);
console.log(`Succeeded in subscribing deleteRight, length: ${length}`);
});
} catch(err) {
console.error(`Failed to subscribe deleteRight: ${JSON.stringify(err)}`);
......@@ -1770,7 +1770,7 @@ on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => voi
```js
try {
inputMethodController.on('sendKeyboardStatus', (keyBoardStatus) => {
console.info(`Succeeded in subscribing sendKeyboardStatus, keyBoardStatus: ${keyBoardStatus}`);
console.log(`Succeeded in subscribing sendKeyboardStatus, keyBoardStatus: ${keyBoardStatus}`);
});
} catch(err) {
console.error(`Failed to subscribe sendKeyboardStatus: ${JSON.stringify(err)}`);
......@@ -1825,7 +1825,7 @@ on(type: 'sendFunctionKey', callback: (functionKey: FunctionKey) => void): void
```js
try {
inputMethodController.on('sendFunctionKey', (functionKey) => {
console.info(`Succeeded in subscribing sendFunctionKey, functionKey.enterKeyType: ${functionKey.enterKeyType}`);
console.log(`Succeeded in subscribing sendFunctionKey, functionKey.enterKeyType: ${functionKey.enterKeyType}`);
});
} catch(err) {
console.error(`Failed to subscribe sendFunctionKey: ${JSON.stringify(err)}`);
......@@ -1880,7 +1880,7 @@ on(type: 'moveCursor', callback: (direction: Direction) => void): void
```js
try {
inputMethodController.on('moveCursor', (direction) => {
console.info(`Succeeded in subscribing moveCursor, direction: ${direction}`);
console.log(`Succeeded in subscribing moveCursor, direction: ${direction}`);
});
} catch(err) {
console.error(`Failed to subscribe moveCursor: ${JSON.stringify(err)}`);
......@@ -1935,7 +1935,7 @@ on(type: 'handleExtendAction', callback: (action: ExtendAction) => void): void
```js
try {
inputMethodController.on('handleExtendAction', (action) => {
console.info(`Succeeded in subscribing handleExtendAction, action: ${action}`);
console.log(`Succeeded in subscribing handleExtendAction, action: ${action}`);
});
} catch(err) {
console.error(`Failed to subscribe handleExtendAction: ${JSON.stringify(err)}`);
......@@ -1981,7 +1981,7 @@ on(type: 'selectByRange', callback: Callback&lt;Range&gt;): void
```js
inputMethodController.on('selectByRange', (range) => {
console.info('Succeeded in subscribing selectByRange: start: ' + range.start + " , end: " + range.end);
console.log(`Succeeded in subscribing selectByRange: start: ${range.start} , end: ${range.end}`);
});
```
......@@ -2024,7 +2024,7 @@ on(type: 'selectByMovement', callback: Callback&lt;Movement&gt;): void
```js
inputMethodController.on('selectByMovement', (movement) => {
console.info('Succeeded in subscribing selectByMovement: direction: ' + movement.direction);
console.log('Succeeded in subscribing selectByMovement: direction: ' + movement.direction);
});
```
......@@ -2071,7 +2071,7 @@ on(type: 'imeChange', callback: (inputMethodProperty: InputMethodProperty, input
```js
inputMethodSetting.on('imeChange', (inputMethodProperty, inputMethodSubtype) => {
console.info('Succeeded in subscribing imeChange: inputMethodProperty: ' + JSON.stringify(inputMethodProperty) + " , inputMethodSubtype: " + JSON.stringify(inputMethodSubtype));
console.log('Succeeded in subscribing imeChange: inputMethodProperty: ' + JSON.stringify(inputMethodProperty) + " , inputMethodSubtype: " + JSON.stringify(inputMethodSubtype));
});
```
......@@ -2178,7 +2178,7 @@ let inputMethodProperty = {
}
try {
inputMethodSetting.listInputMethodSubtype(inputMethodProperty).then((data) => {
console.info('Succeeded in listing inputMethodSubtype.');
console.log('Succeeded in listing inputMethodSubtype.');
}).catch((err) => {
console.error(`Failed to listInputMethodSubtype: ${JSON.stringify(err)}`);
})
......@@ -2254,7 +2254,7 @@ listCurrentInputMethodSubtype(): Promise&lt;Array&lt;InputMethodSubtype&gt;&gt;
```js
try {
inputMethodSetting.listCurrentInputMethodSubtype().then((data) => {
console.info('Succeeded in listing currentInputMethodSubtype.');
console.log('Succeeded in listing currentInputMethodSubtype.');
}).catch((err) => {
console.error(`Failed to listCurrentInputMethodSubtype: ${JSON.stringify(err)}`);
})
......@@ -2337,7 +2337,7 @@ getInputMethods(enable: boolean): Promise&lt;Array&lt;InputMethodProperty&gt;&gt
```js
try {
inputMethodSetting.getInputMethods(true).then((data) => {
console.info('Succeeded in getting inputMethods.');
console.log('Succeeded in getting inputMethods.');
}).catch((err) => {
console.error(`Failed to getInputMethods: ${JSON.stringify(err)}`);
})
......@@ -2377,7 +2377,7 @@ try {
console.error(`Failed to showOptionalInputMethods: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in showing optionalInputMethods.');
console.log('Succeeded in showing optionalInputMethods.');
});
} catch (err) {
console.error(`Failed to showOptionalInputMethods: ${JSON.stringify(err)}`);
......@@ -2410,7 +2410,7 @@ showOptionalInputMethods(): Promise&lt;boolean&gt;
```js
inputMethodSetting.showOptionalInputMethods().then((data) => {
console.info('Succeeded in showing optionalInputMethods.');
console.log('Succeeded in showing optionalInputMethods.');
}).catch((err) => {
console.error(`Failed to showOptionalInputMethods: ${JSON.stringify(err)}`);
})
......@@ -2468,7 +2468,7 @@ listInputMethod(): Promise&lt;Array&lt;InputMethodProperty&gt;&gt;
```js
inputMethodSetting.listInputMethod().then((data) => {
console.info('Succeeded in listing inputMethod.');
console.log('Succeeded in listing inputMethod.');
}).catch((err) => {
console.error(`Failed to listInputMethod: ${JSON.stringify(err)}`);
})
......@@ -2500,7 +2500,7 @@ inputMethodSetting.displayOptionalInputMethod((err) => {
console.error(`Failed to displayOptionalInputMethod: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in displaying optionalInputMethod.');
console.log('Succeeded in displaying optionalInputMethod.');
});
```
......@@ -2526,7 +2526,7 @@ displayOptionalInputMethod(): Promise&lt;void&gt;
```js
inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info('Succeeded in displaying optionalInputMethod.');
console.log('Succeeded in displaying optionalInputMethod.');
}).catch((err) => {
console.error(`Failed to displayOptionalInputMethod: ${JSON.stringify(err)}`);
})
......
......@@ -508,8 +508,8 @@ createPanel(ctx: BaseContext, info: PanelInfo, callback: AsyncCallback\<Panel>):
```js
let panelInfo: inputMethodEngine.PanelInfo = {
panelType: SOFT_KEYBOARD,
panelFlag: FLG_FIXED
panelType: inputMethodEngine.PanelType.SOFT_KEYBOARD,
panelFlag: inputMethodEngine.PanelFlag.FLG_FIXED
}
try {
inputMethodEngine.getInputMethodAbility().createPanel(this.context, panelInfo, (err, panel) => {
......@@ -556,8 +556,8 @@ createPanel(ctx: BaseContext, info: PanelInfo): Promise\<Panel>
```js
let panelInfo: inputMethodEngine.PanelInfo = {
panelType: SOFT_KEYBOARD,
panelFlag: FLG_FIXED
panelType: inputMethodEngine.PanelType.SOFT_KEYBOARD,
panelFlag: inputMethodEngine.PanelFlag.FLG_FIXED
}
inputMethodEngine.getInputMethodAbility().createPanel(this.context, panelInfo).then((panel) => {
console.log('Succeed in creating panel.');
......@@ -585,8 +585,8 @@ destroyPanel(panel: Panel, callback: AsyncCallback\<void>): void;
```js
let panelInfo: inputMethodEngine.PanelInfo = {
panelType: SOFT_KEYBOARD,
panelFlag: FLG_FIXED
panelType: inputMethodEngine.PanelType.SOFT_KEYBOARD,
panelFlag: inputMethodEngine.PanelFlag.FLG_FIXED
}
try {
inputMethodEngine.getInputMethodAbility().createPanel(this.context, panelInfo, (err, panel) => {
......@@ -637,8 +637,8 @@ destroyPanel(panel: Panel): Promise\<void>;
```js
let panelInfo: inputMethodEngine.PanelInfo = {
panelType: SOFT_KEYBOARD,
panelFlag: FLG_FIXED
panelType: inputMethodEngine.PanelType.SOFT_KEYBOARD,
panelFlag: inputMethodEngine.PanelFlag.FLG_FIXED
}
try {
inputMethodEngine.getInputMethodAbility().createPanel(this.context, panelInfo, (err, panel) => {
......@@ -687,13 +687,13 @@ on(type: 'keyDown'|'keyUp', callback: (event: KeyEvent) => boolean): void
```js
inputMethodEngine.getKeyboardDelegate().on('keyUp', (keyEvent) => {
console.info('inputMethodEngine keyCode.(keyUp):' + JSON.stringify(keyEvent.keyCode));
console.info('inputMethodEngine keyAction.(keyUp):' + JSON.stringify(keyEvent.keyAction));
console.log('inputMethodEngine keyCode.(keyUp):' + JSON.stringify(keyEvent.keyCode));
console.log('inputMethodEngine keyAction.(keyUp):' + JSON.stringify(keyEvent.keyAction));
return true;
});
inputMethodEngine.getKeyboardDelegate().on('keyDown', (keyEvent) => {
console.info('inputMethodEngine keyCode.(keyDown):' + JSON.stringify(keyEvent.keyCode));
console.info('inputMethodEngine keyAction.(keyDown):' + JSON.stringify(keyEvent.keyAction));
console.log('inputMethodEngine keyCode.(keyDown):' + JSON.stringify(keyEvent.keyCode));
console.log('inputMethodEngine keyAction.(keyDown):' + JSON.stringify(keyEvent.keyAction));
return true;
});
```
......@@ -898,7 +898,7 @@ try {
console.error(`Failed to setUiContent: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in setting the content.');
console.log('Succeeded in setting the content.');
});
} catch (err) {
console.error(`Failed to setUiContent: ${JSON.stringify(err)}`);
......@@ -931,7 +931,7 @@ setUiContent(path: string): Promise\<void>
try {
let promise = panel.setUiContent('pages/page2/page2');
promise.then(() => {
console.info('Succeeded in setting the content.');
console.log('Succeeded in setting the content.');
}).catch((err) =>{
console.error(`Failed to setUiContent: ${JSON.stringify(err)}`);
});
......@@ -967,7 +967,7 @@ try {
console.error(`Failed to setUiContent: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in setting the content.');
console.log('Succeeded in setting the content.');
});
} catch (err) {
console.error(`Failed to setUiContent: ${JSON.stringify(err)}`);
......@@ -1003,7 +1003,7 @@ storage.setOrCreate('storageSimpleProp',121);
try {
let promise = panel.setUiContent('pages/page2/page2');
promise.then(() => {
console.info('Succeeded in setting the content.');
console.log('Succeeded in setting the content.');
}).catch((err) =>{
console.error(`Failed to setUiContent: ${JSON.stringify(err)}`);
});
......@@ -1039,7 +1039,7 @@ try {
console.error(`Failed to resize panel: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in changing the panel size.');
console.log('Succeeded in changing the panel size.');
});
} catch (err) {
console.error(`Failed to resize panel: ${JSON.stringify(err)}`);
......@@ -1075,7 +1075,7 @@ resize(width: number, height: number): Promise\<void>;
try {
let promise = panel.resize(500, 1000);
promise.then(() => {
console.info('Succeeded in changing the panel size.');
console.log('Succeeded in changing the panel size.');
}).catch((err) =>{
console.error(`Failed to resize panel: ${JSON.stringify(err)}`);
});
......@@ -1111,7 +1111,7 @@ try {
console.error(`Failed to move panel: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in moving the panel.');
console.log('Succeeded in moving the panel.');
});
} catch (err) {
console.error(`Failed to move panel: ${JSON.stringify(err)}`);
......@@ -1147,7 +1147,7 @@ moveTo(x: number, y: number): Promise\<void>
try {
let promise = windowClass.moveTo(300, 300);
promise.then(() => {
console.info('Succeeded in moving the panel.');
console.log('Succeeded in moving the panel.');
}).catch((err) =>{
console.error(`Failed to move panel: ${JSON.stringify(err)}`);
});
......@@ -1178,7 +1178,7 @@ panel.show((err) => {
console.error(`Failed to show panel: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in showing the panel.');
console.log('Succeeded in showing the panel.');
});
```
......@@ -1201,7 +1201,7 @@ show(): Promise\<void>
```js
let promise = panel.show();
promise.then(() => {
console.info('Succeeded in showing the panel.');
console.log('Succeeded in showing the panel.');
}).catch((err) =>{
console.error(`Failed to show panel: ${JSON.stringify(err)}`);
});
......@@ -1229,7 +1229,7 @@ panel.hide((err) => {
console.error(`Failed to hide panel: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in hiding the panel.');
console.log('Succeeded in hiding the panel.');
});
```
......@@ -1252,7 +1252,7 @@ hide(): Promise\<void>
```js
let promise = panel.hide();
promise.then(() => {
console.info('Succeeded in hiding the panel.');
console.log('Succeeded in hiding the panel.');
}).catch((err) =>{
console.error(`Failed to hide panel: ${JSON.stringify(err)}`);
});
......@@ -1277,7 +1277,7 @@ on(type: 'show' | 'hide', callback: () => void): void
```js
panel.on('show', () => {
console.info('Panel is showing.');
console.log('Panel is showing.');
});
```
......@@ -1387,9 +1387,9 @@ hide(): Promise&lt;void&gt;
```js
keyboardController.hide().then(() => {
console.info('Succeeded in hiding keyboard.');
console.log('Succeeded in hiding keyboard.');
}).catch((err) => {
console.info(`Failed to hide: ${JSON.stringify(err)}`);
console.log(`Failed to hide: ${JSON.stringify(err)}`);
});
```
......@@ -1445,9 +1445,9 @@ hideKeyboard(): Promise&lt;void&gt;
```js
keyboardController.hideKeyboard().then(() => {
console.info('Succeeded in hiding keyboard.');
console.log('Succeeded in hiding keyboard.');
}).catch((err) => {
console.info(`Failed to hideKeyboard: ${JSON.stringify(err)}`);
console.log(`Failed to hideKeyboard: ${JSON.stringify(err)}`);
});
```
......@@ -1536,9 +1536,9 @@ try {
return;
}
if (result) {
console.info('Succeeded in sending key function. ');
console.log('Succeeded in sending key function.');
} else {
console.error('Failed to sendKeyFunction. ');
console.error('Failed to sendKeyFunction.');
}
});
} catch (err) {
......@@ -1581,9 +1581,9 @@ let action = 1;
try {
inputClient.sendKeyFunction(action).then((result) => {
if (result) {
console.info('Succeeded in sending key function. ');
console.log('Succeeded in sending key function.');
} else {
console.error('Failed to sendKeyFunction. ');
console.error('Failed to sendKeyFunction.');
}
}).catch((err) => {
console.error(`Failed to sendKeyFunction: ${JSON.stringify(err)}`);
......@@ -1669,7 +1669,7 @@ getForward(length:number): Promise&lt;string&gt;
let length = 1;
try {
inputClient.getForward(length).then((text) => {
console.info('Succeeded in getting forward, text: ' + text);
console.log('Succeeded in getting forward, text: ' + text);
}).catch((err) => {
console.error(`Failed to getForward: ${JSON.stringify(err)}`);
});
......@@ -1754,7 +1754,7 @@ getBackward(length:number): Promise&lt;string&gt;
let length = 1;
try {
inputClient.getBackward(length).then((text) => {
console.info('Succeeded in getting backward, text: ' + text);
console.log('Succeeded in getting backward, text: ' + text);
}).catch((err) => {
console.error(`Failed to getBackward: ${JSON.stringify(err)}`);
});
......@@ -1798,7 +1798,7 @@ try {
return;
}
if (result) {
console.info('Succeeded in deleting forward. ');
console.log('Succeeded in deleting forward.');
} else {
console.error(`Failed to deleteForward: ${JSON.stringify(err)}`);
}
......@@ -1844,9 +1844,9 @@ let length = 1;
try {
inputClient.deleteForward(length).then((result) => {
if (result) {
console.info('Succeeded in deleting forward. ');
console.log('Succeeded in deleting forward.');
} else {
console.error('Failed to delete Forward. ');
console.error('Failed to delete Forward.');
}
}).catch((err) => {
console.error(`Failed to deleteForward: ${JSON.stringify(err)}`);
......@@ -1891,7 +1891,7 @@ try {
return;
}
if (result) {
console.info('Succeeded in deleting backward. ');
console.log('Succeeded in deleting backward.');
} else {
console.error(`Failed to deleteBackward: ${JSON.stringify(err)}`);
}
......@@ -1936,9 +1936,9 @@ deleteBackward(length:number): Promise&lt;boolean&gt;
let length = 1;
inputClient.deleteBackward(length).then((result) => {
if (result) {
console.info('Succeeded in deleting backward. ');
console.log('Succeeded in deleting backward.');
} else {
console.error('Failed to deleteBackward. ');
console.error('Failed to deleteBackward.');
}
}).catch((err) => {
console.error(`Failed to deleteBackward: ${JSON.stringify(err)}`);
......@@ -1978,9 +1978,9 @@ inputClient.insertText('test', (err, result) => {
return;
}
if (result) {
console.info('Succeeded in inserting text. ');
console.log('Succeeded in inserting text.');
} else {
console.error('Failed to insertText. ');
console.error('Failed to insertText.');
}
});
```
......@@ -2020,9 +2020,9 @@ insertText(text:string): Promise&lt;boolean&gt;
try {
inputClient.insertText('test').then((result) => {
if (result) {
console.info('Succeeded in inserting text. ');
console.log('Succeeded in inserting text.');
} else {
console.error('Failed to insertText. ');
console.error('Failed to insertText.');
}
}).catch((err) => {
console.error(`Failed to insertText: ${JSON.stringify(err)}`);
......@@ -2093,8 +2093,8 @@ getEditorAttribute(): Promise&lt;EditorAttribute&gt;
```js
inputClient.getEditorAttribute().then((editorAttribute) => {
console.info('editorAttribute.inputPattern: ' + JSON.stringify(editorAttribute.inputPattern));
console.info('editorAttribute.enterKeyType: ' + JSON.stringify(editorAttribute.enterKeyType));
console.log('editorAttribute.inputPattern: ' + JSON.stringify(editorAttribute.inputPattern));
console.log('editorAttribute.enterKeyType: ' + JSON.stringify(editorAttribute.enterKeyType));
}).catch((err) => {
console.error(`Failed to getEditorAttribute: ${JSON.stringify(err)}`);
});
......@@ -2132,7 +2132,7 @@ try {
console.error(`Failed to moveCursor: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in moving cursor.');
console.log('Succeeded in moving cursor.');
});
} catch (err) {
console.error(`Failed to moveCursor: ${JSON.stringify(err)}`);
......@@ -2214,7 +2214,7 @@ try {
console.error(`Failed to selectByRange: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in selecting by range.');
console.log('Succeeded in selecting by range.');
});
} catch (err) {
console.error(`Failed to selectByRange: ${JSON.stringify(err)}`);
......@@ -2297,7 +2297,7 @@ try {
console.error(`Failed to selectByMovement: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in selecting by movement.');
console.log('Succeeded in selecting by movement.');
});
} catch (err) {
console.error(`Failed to selectByMovement: ${JSON.stringify(err)}`);
......@@ -2378,7 +2378,7 @@ inputClient.getTextIndexAtCursor((err, index) => {
console.error(`Failed to getTextIndexAtCursor: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in getTextIndexAtCursor: ' + index);
console.log('Succeeded in getTextIndexAtCursor: ' + index);
});
```
......@@ -2409,7 +2409,7 @@ getTextIndexAtCursor(): Promise&lt;number&gt;
```js
inputClient.getTextIndexAtCursor().then((index) => {
console.info('Succeeded in getTextIndexAtCursor: ' + index);
console.log('Succeeded in getTextIndexAtCursor: ' + index);
}).catch((err) => {
console.error(`Failed to getTextIndexAtCursor: ${JSON.stringify(err)}`);
});
......@@ -2450,7 +2450,7 @@ try {
console.error(`Failed to sendExtendAction: ${JSON.stringify(err)}`);
return;
}
console.info('Succeeded in sending extend action.');
console.log('Succeeded in sending extend action.');
});
} catch(err) {
console.error(`Failed to sendExtendAction: ${JSON.stringify(err)}`);
......@@ -2493,7 +2493,7 @@ sendExtendAction(action: ExtendAction): Promise&lt;void&gt;
```js
try {
inputClient.sendExtendAction(inputMethodEngine.ExtendAction.COPY).then(() => {
console.info('Succeeded in sending extend action.');
console.log('Succeeded in sending extend action.');
}).catch((err) => {
console.error(`Failed to sendExtendAction: ${JSON.stringify(err)}`);
});
......@@ -2626,7 +2626,7 @@ getForward(length:number): Promise&lt;string&gt;
```js
let length = 1;
textInputClient.getForward(length).then((text) => {
console.info('Succeeded in getting forward, text: ' + text);
console.log('Succeeded in getting forward, text: ' + text);
}).catch((err) => {
console.error(`Failed to getForward: ${JSON.stringify(err)}`);
});
......@@ -2693,7 +2693,7 @@ getBackward(length:number): Promise&lt;string&gt;
```js
let length = 1;
textInputClient.getBackward(length).then((text) => {
console.info('Succeeded in getting backward: ' + JSON.stringify(text));
console.log('Succeeded in getting backward: ' + JSON.stringify(text));
}).catch((err) => {
console.error(`Failed to getBackward: ${JSON.stringify(err)}`);
});
......@@ -2728,9 +2728,9 @@ textInputClient.deleteForward(length, (err, result) => {
return;
}
if (result) {
console.info('Succeeded in deleting forward. ');
console.log('Succeeded in deleting forward.');
} else {
console.error('Failed to deleteForward. ');
console.error('Failed to deleteForward.');
}
});
```
......@@ -2765,9 +2765,9 @@ deleteForward(length:number): Promise&lt;boolean&gt;
let length = 1;
textInputClient.deleteForward(length).then((result) => {
if (result) {
console.info('Succeeded in deleting forward. ');
console.log('Succeeded in deleting forward.');
} else {
console.error('Failed to delete forward. ');
console.error('Failed to delete forward.');
}
}).catch((err) => {
console.error(`Failed to deleteForward: ${JSON.stringify(err)}`);
......@@ -2803,9 +2803,9 @@ textInputClient.deleteBackward(length, (err, result) => {
return;
}
if (result) {
console.info('Succeeded in deleting backward. ');
console.log('Succeeded in deleting backward.');
} else {
console.error('Failed to deleteBackward. ');
console.error('Failed to deleteBackward.');
}
});
```
......@@ -2840,9 +2840,9 @@ deleteBackward(length:number): Promise&lt;boolean&gt;
let length = 1;
textInputClient.deleteBackward(length).then((result) => {
if (result) {
console.info('Succeeded in deleting backward. ');
console.log('Succeeded in deleting backward.');
} else {
console.error('Failed to deleteBackward. ');
console.error('Failed to deleteBackward.');
}
}).catch((err) => {
console.error(`Failed to deleteBackward: ${JSON.stringify(err)}`);
......@@ -2877,9 +2877,9 @@ textInputClient.sendKeyFunction(action, (err, result) => {
return;
}
if (result) {
console.info('Succeeded in sending key function. ');
console.log('Succeeded in sending key function.');
} else {
console.error('Failed to sendKeyFunction. ');
console.error('Failed to sendKeyFunction.');
}
});
```
......@@ -2914,9 +2914,9 @@ sendKeyFunction(action: number): Promise&lt;boolean&gt;
let action = 1;
textInputClient.sendKeyFunction(action).then((result) => {
if (result) {
console.info('Succeeded in sending key function. ');
console.log('Succeeded in sending key function.');
} else {
console.error('Failed to sendKeyFunction. ');
console.error('Failed to sendKeyFunction.');
}
}).catch((err) => {
console.error(`Failed to sendKeyFunction: ${JSON.stringify(err)}`);
......@@ -2951,9 +2951,9 @@ textInputClient.insertText('test', (err, result) => {
return;
}
if (result) {
console.info('Succeeded in inserting text. ');
console.log('Succeeded in inserting text.');
} else {
console.error('Failed to insertText. ');
console.error('Failed to insertText.');
}
});
```
......@@ -2987,9 +2987,9 @@ insertText(text:string): Promise&lt;boolean&gt;
```js
textInputClient.insertText('test').then((result) => {
if (result) {
console.info('Succeeded in inserting text. ');
console.log('Succeeded in inserting text.');
} else {
console.error('Failed to insertText. ');
console.error('Failed to insertText.');
}
}).catch((err) => {
console.error(`Failed to insertText: ${JSON.stringify(err)}`);
......@@ -3049,8 +3049,8 @@ getEditorAttribute(): Promise&lt;EditorAttribute&gt;
```js
textInputClient.getEditorAttribute().then((editorAttribute) => {
console.info('editorAttribute.inputPattern: ' + JSON.stringify(editorAttribute.inputPattern));
console.info('editorAttribute.enterKeyType: ' + JSON.stringify(editorAttribute.enterKeyType));
console.log('editorAttribute.inputPattern: ' + JSON.stringify(editorAttribute.inputPattern));
console.log('editorAttribute.enterKeyType: ' + JSON.stringify(editorAttribute.enterKeyType));
}).catch((err) => {
console.error(`Failed to getEditorAttribute: ${JSON.stringify(err)}`);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册