use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.
the class WebappNode method loadActions.
@Override
protected void loadActions() {
addAction(ACTION_STOP, WEB_STOP_ICON, new NodeActionListener() {
@Override
public void actionPerformed(NodeActionEvent e) {
DefaultLoader.getIdeHelper().runInBackground(null, "Stopping Web App", false, true, "Stopping Web App...", new Runnable() {
@Override
public void run() {
webApp.stop();
setIconPath(WEB_STOP_ICON);
}
});
}
});
addAction("Start", new NodeActionListener() {
@Override
public void actionPerformed(NodeActionEvent e) {
DefaultLoader.getIdeHelper().runInBackground(null, "Starting Web App", false, true, "Starting Web App...", new Runnable() {
@Override
public void run() {
webApp.start();
setIconPath(WEB_RUN_ICON);
}
});
}
});
addAction(ACTION_RESTART, new NodeActionListener() {
@Override
public void actionPerformed(NodeActionEvent e) {
DefaultLoader.getIdeHelper().runInBackground(null, "Restarting Web App", false, true, "Restarting Web App...", new Runnable() {
@Override
public void run() {
webApp.restart();
setIconPath(WEB_RUN_ICON);
}
});
}
});
addAction("Delete", new DeleteWebAppAction());
super.loadActions();
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method createAddNewHDInsightReaderClusterAction.
@NotNull
public NodeActionListener createAddNewHDInsightReaderClusterAction(@NotNull HDInsightRootModule module, @NotNull ClusterDetail clusterDetail) {
return new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent nodeActionEvent) throws AzureCmdException {
AddNewHDInsightReaderClusterForm linkClusterForm = new AddNewHDInsightReaderClusterForm(PluginUtil.getParentShell(), module, clusterDetail);
linkClusterForm.open();
}
};
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.
the class CosmosSparkClusterRootModuleImpl method loadActions.
@Override
protected void loadActions() {
super.loadActions();
addAction("Open Notebook", new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) {
try {
Desktop.getDesktop().browse(URI.create(SPARK_NOTEBOOK_LINK));
} catch (IOException ignore) {
}
}
});
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.
the class BlobExplorerFileEditor method createVirtualNode.
private FileEditorVirtualNode<EditorPart> createVirtualNode(final String name) {
final FileEditorVirtualNode<EditorPart> node = new FileEditorVirtualNode<EditorPart>(this, name);
node.addAction(COPY_URL, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_COPYURL, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
copyURLSelectedFile();
}
}));
node.addAction(SAVE_AS, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_SAVEAS, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
saveAsSelectedFile();
}
}));
node.addAction(DELETE, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_DELETE, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
deleteSelectedFile();
}
}));
node.addAction(SEARCH, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_SEARCH, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
fillGrid();
}
}));
node.addAction(UPLOAD_BLOB, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_UPLOAD, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
uploadFile();
}
}));
return node;
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.
the class CreateArmStorageAccountAction method actionPerformed.
@Override
public void actionPerformed(NodeActionEvent e) {
SignInCommandHandler.requireSignedIn(PluginUtil.getParentShell(), () -> {
CreateArmStorageAccountForm createStorageAccountForm = new CreateArmStorageAccountForm(PluginUtil.getParentShell(), null, null);
createStorageAccountForm.setOnCreate(() -> {
AzureTaskManager.getInstance().runInBackground("Creating storage account " + createStorageAccountForm.getStorageAccount().getName() + "...", new Runnable() {
@Override
public void run() {
EventUtil.executeWithLog(STORAGE, CREATE_STORAGE_ACCOUNT, (operation) -> {
createStorageAccount(createStorageAccountForm.getStorageAccount());
storageModule.load(false);
}, (e) -> AzureTaskManager.getInstance().runLater(() -> PluginUtil.displayErrorDialog(PluginUtil.getParentShell(), Messages.err, "An error occurred while creating the storage account: " + e.getMessage())));
}
});
});
createStorageAccountForm.open();
});
}
Aggregations