Search in sources :

Example 1 with StringResourceEditor

use of com.android.tools.idea.editors.strings.StringResourceEditor in project android by JetBrains.

the class EditorFixture method getTranslationsEditor.

/**
   * Returns a fixture around the {@link com.android.tools.idea.editors.strings.StringResourceEditor} <b>if</b> the currently
   * displayed editor is a translations editor.
   */
@NotNull
public TranslationsEditorFixture getTranslationsEditor() {
    return GuiQuery.getNonNull(() -> {
        FileEditor[] editors = FileEditorManager.getInstance(myFrame.getProject()).getSelectedEditors();
        checkState(editors.length > 0, "no selected editors");
        FileEditor selected = editors[0];
        checkState(selected instanceof StringResourceEditor, "not a %s: %s", StringResourceEditor.class.getSimpleName(), selected);
        return new TranslationsEditorFixture(robot, (StringResourceEditor) selected);
    });
}
Also used : StringResourceEditor(com.android.tools.idea.editors.strings.StringResourceEditor) FileEditor(com.intellij.openapi.fileEditor.FileEditor) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

StringResourceEditor (com.android.tools.idea.editors.strings.StringResourceEditor)1 FileEditor (com.intellij.openapi.fileEditor.FileEditor)1 NotNull (org.jetbrains.annotations.NotNull)1