use of com.intellij.lang.javascript.refactoring.ui.JSEditorTextField in project intellij-plugins by JetBrains.
the class FlexCompletionInTextFieldBase method doTestForEditorTextField.
protected void doTestForEditorTextField(JSExpressionCodeFragment fragment, String suffix, String ext, final String file) throws Exception {
JSTestUtils.initJSIndexes(getProject());
JSEditorTextField editorTextField = null;
try {
myFile = fragment;
Document document = PsiDocumentManager.getInstance(myProject).getDocument(fragment);
editorTextField = new JSEditorTextField(myProject, document);
final String text = StringUtil.convertLineSeparators(VfsUtilCore.loadText(getVirtualFile(file)));
EditorInfo editorInfo = new EditorInfo(text);
// initialize editor
editorTextField.addNotify();
myEditor = editorTextField.getEditor();
myEditorsToRelease.add(myEditor);
editorTextField.setText(editorInfo.getNewFileText());
editorInfo.applyToEditor(myEditor);
complete();
} finally {
// dispose editor
if (editorTextField != null)
editorTextField.removeNotify();
}
}
use of com.intellij.lang.javascript.refactoring.ui.JSEditorTextField in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingInTextFieldTest method doTestForEditorTextField.
private void doTestForEditorTextField(JSExpressionCodeFragment fragment) throws Exception {
myFile = fragment;
Document document = PsiDocumentManager.getInstance(myProject).getDocument(fragment);
final JSEditorTextField editorTextField = new JSEditorTextField(myProject, document);
// initialize editor
editorTextField.addNotify();
myEditor = editorTextField.getEditor();
try {
checkHighlighting(new ExpectedHighlightingData(editorTextField.getDocument(), true, true, true, myFile));
} finally {
editorTextField.removeNotify();
UIUtil.dispatchAllInvocationEvents();
}
}
use of com.intellij.lang.javascript.refactoring.ui.JSEditorTextField in project intellij-plugins by JetBrains.
the class JSCreateFieldDialog method createUIComponents.
private void createUIComponents() {
Module module = ModuleUtilCore.findModuleForPsiElement(myTargetClass);
GlobalSearchScope scope = getTypeFieldScope(module, myTargetClass.getProject());
myTypeField = createTypeField(myTargetClass.getProject(), scope);
PsiCodeFragment initializerCodeFragment = createInitializerCodeFragment(myTargetClass);
Document document = PsiDocumentManager.getInstance(myTargetClass.getProject()).getDocument(initializerCodeFragment);
myInitializerField = new JSEditorTextField(myTargetClass.getProject(), document);
}
Aggregations