Search in sources :

Example 1 with JsonSchemaMappingsConfigurable

use of com.jetbrains.jsonSchema.JsonSchemaMappingsConfigurable in project intellij-community by JetBrains.

the class JsonSchemaConflictNotificationProvider method createNotificationPanel.

@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
    final List<Pair<Boolean, String>> descriptors = myJsonSchemaService.getMatchingSchemaDescriptors(file);
    if (descriptors == null || descriptors.size() <= 1)
        return null;
    final Worker worker = new Worker();
    final String message = worker.createMessage(descriptors);
    if (message == null)
        return null;
    final EditorNotificationPanel panel = new EditorNotificationPanel(LightColors.RED);
    panel.setText(message);
    panel.createActionLabel("Edit JSON Schema Mappings", () -> {
        ShowSettingsUtil.getInstance().editConfigurable(myProject, new JsonSchemaMappingsConfigurable(myProject));
        EditorNotifications.getInstance(myProject).updateNotifications(file);
    });
    return panel;
}
Also used : EditorNotificationPanel(com.intellij.ui.EditorNotificationPanel) Pair(com.intellij.openapi.util.Pair) JsonSchemaMappingsConfigurable(com.jetbrains.jsonSchema.JsonSchemaMappingsConfigurable) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Pair (com.intellij.openapi.util.Pair)1 EditorNotificationPanel (com.intellij.ui.EditorNotificationPanel)1 JsonSchemaMappingsConfigurable (com.jetbrains.jsonSchema.JsonSchemaMappingsConfigurable)1 Nullable (org.jetbrains.annotations.Nullable)1