use of com.microsoft.azuretools.azureexplorer.editors.StorageEditorInput in project azure-tools-for-java by Microsoft.
the class UIHelperImpl method openItem.
@Override
public <T extends StorageServiceTreeItem> void openItem(Object projectObject, final StorageAccount storageAccount, final T item, String itemType, String itemName, String iconName) {
// Display.getDefault().syncExec(new Runnable() {
// @Override
// public void run() {
// try {
// BlobExplorerView view = (BlobExplorerView) PlatformUI
// .getWorkbench().getActiveWorkbenchWindow()
// .getActivePage().showView("com.microsoft.azureexplorer.views.BlobExplorerView");
// view.init(storageAccount, (BlobContainer) blobContainer);
// } catch (PartInitException e) {
// Activator.getDefault().log("Error opening container", e);
// }
// }
// });
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor(type2Editor.get(item.getClass()));
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart newEditor = page.openEditor(new StorageEditorInput(storageAccount.name(), StorageClientSDKManager.getConnectionString(storageAccount), item), editorDescriptor.getId());
} catch (PartInitException e) {
Activator.getDefault().log("Error opening " + item.getName(), e);
}
}
use of com.microsoft.azuretools.azureexplorer.editors.StorageEditorInput in project azure-tools-for-java by Microsoft.
the class UIHelperImpl method openItem.
@Override
public <T extends StorageServiceTreeItem> void openItem(Object projectObject, final ClientStorageAccount clientStorageAccount, final T item, String itemType, String itemName, String iconName) {
// Display.getDefault().syncExec(new Runnable() {
// @Override
// public void run() {
// try {
// BlobExplorerView view = (BlobExplorerView) PlatformUI
// .getWorkbench().getActiveWorkbenchWindow()
// .getActivePage().showView("com.microsoft.azureexplorer.views.BlobExplorerView");
// view.init(storageAccount, (BlobContainer) blobContainer);
// } catch (PartInitException e) {
// Activator.getDefault().log("Error opening container", e);
// }
// }
// });
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().findEditor(type2Editor.get(item.getClass()));
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart newEditor = page.openEditor(new StorageEditorInput(clientStorageAccount.getName(), clientStorageAccount.getConnectionString(), item), editorDescriptor.getId());
} catch (PartInitException e) {
Activator.getDefault().log("Error opening " + item.getName(), e);
}
}
Aggregations