Example usage for com.intellij.openapi.fileEditor FileEditorProvider getEditorTypeId

List of usage examples for com.intellij.openapi.fileEditor FileEditorProvider getEditorTypeId

Introduction

In this page you can find the example usage for com.intellij.openapi.fileEditor FileEditorProvider getEditorTypeId.

Prototype

@NotNull
@NonNls
String getEditorTypeId();

Source Link

Usage

From source file:com.android.tools.idea.ddms.screenshot.ScreenshotViewer.java

License:Apache License

private FileEditorProvider getImageFileEditorProvider() {
    FileEditorProvider[] providers = FileEditorProviderManager.getInstance().getProviders(myProject,
            myBackingVirtualFile);//  w w  w  .j a v  a  2  s .  co  m
    assert providers.length > 0;

    // Note: In case there are multiple providers for image files, we'd prefer to get the bundled
    // image editor, but we don't have access to any of its implementation details so we rely
    // on the editor type id being "images" as defined by ImageFileEditorProvider#EDITOR_TYPE_ID.
    for (FileEditorProvider p : providers) {
        if (p.getEditorTypeId().equals("images")) {
            return p;
        }
    }

    return providers[0];
}