use of com.microsoft.azure.toolkit.intellij.sqlserver.properties.SqlServerPropertyView in project azure-tools-for-java by Microsoft.
the class UIHelperImpl method openSqlServerPropertyView.
@Override
public void openSqlServerPropertyView(@NotNull String id, @NotNull Object project) {
EventUtil.executeWithLog(ActionConstants.SqlServer.SHOW_PROPERTIES, (operation) -> {
final ResourceId resourceId = ResourceId.fromString(id);
final FileEditorManager fileEditorManager = getFileEditorManager(resourceId.subscriptionId(), resourceId.id(), (Project) project);
if (fileEditorManager == null) {
return;
}
LightVirtualFile itemVirtualFile = searchExistingFile(fileEditorManager, SqlServerPropertyViewProvider.TYPE, resourceId.id());
if (itemVirtualFile == null) {
itemVirtualFile = createVirtualFile(resourceId.name(), resourceId.subscriptionId(), resourceId.id());
itemVirtualFile.setFileType(new AzureFileType(SqlServerPropertyViewProvider.TYPE, AzureIconLoader.loadIcon(AzureIconSymbol.SqlServer.MODULE)));
}
FileEditor[] editors = fileEditorManager.openFile(itemVirtualFile, true, true);
for (FileEditor editor : editors) {
if (editor.getName().equals(SqlServerPropertyView.ID) && editor instanceof SqlServerPropertyView) {
((SqlServerPropertyView) editor).onReadProperty(resourceId.subscriptionId(), resourceId.resourceGroupName(), resourceId.name());
}
}
});
}
Aggregations