use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener 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 NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
copyURLSelectedFile();
}
});
node.addAction(SAVE_AS, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
saveAsSelectedFile();
}
});
node.addAction(DELETE, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
deleteSelectedFile();
}
});
node.addAction(SEARCH, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
fillGrid();
}
});
node.addAction(UPLOAD_BLOB, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
uploadFile();
}
});
return node;
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener in project azure-tools-for-java by Microsoft.
the class QueueFileEditor method createVirtualNode.
private FileEditorVirtualNode<EditorPart> createVirtualNode(final String name) {
final FileEditorVirtualNode<EditorPart> node = new FileEditorVirtualNode<EditorPart>(this, name);
node.addAction(REFRESH, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
fillGrid();
}
});
node.addAction(DEQUEUE, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
dequeueFirstMessage();
}
});
node.addAction(ADD, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
QueueMessageForm queueMessageForm = new QueueMessageForm(PluginUtil.getParentShell(), storageAccount, queue);
queueMessageForm.setOnAddedMessage(new Runnable() {
@Override
public void run() {
fillGrid();
}
});
queueMessageForm.open();
}
});
node.addAction(CLEAR_QUEUE, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
boolean optionDialog = DefaultLoader.getUIHelper().showConfirmation("Are you sure you want to clear the queue \"" + queue.getName() + "\"?", "Service explorer", new String[] { "Yes", "No" }, null);
if (optionDialog) {
DefaultLoader.getIdeHelper().runInBackground(null, "Clearing queue messages", false, true, "Clearing queue messages", new Runnable() {
public void run() {
/*try {
StorageClientSDKManager.getManager().clearQueue(storageAccount, queue);
DefaultLoader.getIdeHelper().invokeLater(new Runnable() {
@Override
public void run() {
fillGrid();
}
});
} catch (AzureCmdException e) {
DefaultLoader.getUIHelper().showException("Error clearing queue messages", e, "Service Explorer", false, true);
}*/
}
});
}
}
});
node.addAction(OPEN, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
viewMessageText();
}
});
return node;
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener in project azure-tools-for-java by Microsoft.
the class HDInsightUtil method setHDInsightRootModule.
public static void setHDInsightRootModule(@NotNull AzureModule azureModule) {
HDInsightRootModuleImpl hdInsightRootModule = new HDInsightRootModuleImpl(azureModule);
// add telemetry for HDInsight Node
hdInsightRootModule.addClickActionListener(new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
AppInsightsClient.create(HDInsightBundle.message("HDInsightExplorerHDInsightNodeExpand"), null);
}
});
azureModule.setHdInsightModule(hdInsightRootModule);
}
use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener 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.NodeActionListener in project azure-tools-for-java by Microsoft.
the class TableFileEditor method createVirtualNode.
private FileEditorVirtualNode<EditorPart> createVirtualNode(final String name) {
final FileEditorVirtualNode<EditorPart> node = new FileEditorVirtualNode<EditorPart>(this, name);
node.addAction(DELETE, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
deleteSelection();
}
});
node.addAction(REFRESH, new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
fillGrid();
}
});
return node;
}
Aggregations