SWT コントロールでEclilpse Nebulaを介して組み込みの CKEditor を使用しようとしています。Eclipse RCP の組み込みブラウザー エンジンを介して CKEditor を使用します。コントロールは、 CKEditorの startupFocusを使用して、HTML ページのシンプルな HTML テキスト領域で CKEditor を初期化しようとしますが、呼び出しに失敗します。一貫して機能するわけではなく、あるマシンでは機能しますが、他のマシンでは機能しません。以下は、Nebula クラスのコード スニペットです。常に機能しない理由を正しい方向に教えてください。前もって感謝します。
CKEDITOR.replace( 'editor',
{
startupFocus : true,
on: {
'instanceReady' : function(event) {
//maximize the editor after the editor instance is ready
maximizeEditorHeight();
event.editor.on('resize', function(resizeEvent) {
if ((prevHeight == null) || prevHeight != resizeEvent.editor.container.$.clientHeight) {
prevHeight = CKEDITOR.instances.editor.container.$.clientHeight;
if (!mouseDown) {
// if the resize is trigger by an external event,
// e.g. toolbar expand/collapse
maximizeEditorHeight();
}
if (resizeCallbackEnabled) {
resizeParentContainer();
}
}
else if (prevHeight == CKEDITOR.instances.editor.container.$.clientHeight) {
prevHeight = null;
}
});
},
//notify the FocusListener
'focus' : function() { focusIn(); },
'blur' : function() { focusOut(); },
//notify the ModifyListener
'change' : function() { textModified(); },
//ensure the key pressed event is fired if Enter is pressed
'key' : function(event) { event.data.preventDefault(false); },
//notify the KeyListener
'contentDom' : function() {
this.document.on('keydown', function(evt) {
if (evt.data.$.ctrlKey && evt.data.getKey() == 70) {
//prevent opening of browser find dialog on CTRL + F
evt.data.preventDefault(false);
//open the ckeditor find and replace dialog
CKEDITOR.instances.editor.execCommand('find')
}
else if (evt.data.$.ctrlKey && evt.data.getKey() == 72) {
evt.data.preventDefault(false);
//open the ckeditor find and replace dialog
CKEDITOR.instances.editor.execCommand('replace')
}
keyPressed(evt.data.getKey(), evt.data.getKeystroke());
});
this.document.on('keyup', function(evt) {
keyReleased(evt.data.getKey(), evt.data.getKeystroke());
});
}
}
});