use of com.microsoft.azure.toolkit.intellij.mysql.MySQLPropertyView in project azure-tools-for-java by Microsoft.
the class UIHelperImpl method openMySQLPropertyView.
@Override
public void openMySQLPropertyView(@NotNull String id, @NotNull Object project) {
EventUtil.executeWithLog(ActionConstants.MySQL.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, MySQLPropertyViewProvider.TYPE, resourceId.id());
if (itemVirtualFile == null) {
itemVirtualFile = createVirtualFile(resourceId.name(), resourceId.subscriptionId(), resourceId.id());
itemVirtualFile.setFileType(new AzureFileType(MySQLPropertyViewProvider.TYPE, AzureIconLoader.loadIcon(AzureIconSymbol.MySQL.MODULE)));
}
FileEditor[] editors = fileEditorManager.openFile(itemVirtualFile, true, true);
for (FileEditor editor : editors) {
if (editor.getName().equals(MySQLPropertyView.ID) && editor instanceof MySQLPropertyView) {
((MySQLPropertyView) editor).onReadProperty(resourceId.subscriptionId(), resourceId.resourceGroupName(), resourceId.name());
}
}
});
}
Aggregations