Search in sources :

Example 1 with NodeActionListener

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;
}
Also used : AzureCmdException(com.microsoft.azuretools.azurecommons.helpers.AzureCmdException) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) EditorPart(org.eclipse.ui.part.EditorPart)

Example 2 with NodeActionListener

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;
}
Also used : AzureCmdException(com.microsoft.azuretools.azurecommons.helpers.AzureCmdException) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) QueueMessageForm(com.microsoft.azuretools.azureexplorer.forms.QueueMessageForm) EditorPart(org.eclipse.ui.part.EditorPart)

Example 3 with NodeActionListener

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);
}
Also used : HDInsightRootModuleImpl(com.microsoft.azure.hdinsight.serverexplore.HDInsightRootModuleImpl) AzureCmdException(com.microsoft.azuretools.azurecommons.helpers.AzureCmdException) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)

Example 4 with NodeActionListener

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();
}
Also used : NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)

Example 5 with NodeActionListener

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;
}
Also used : AzureCmdException(com.microsoft.azuretools.azurecommons.helpers.AzureCmdException) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) EditorPart(org.eclipse.ui.part.EditorPart)

Aggregations

NodeActionEvent (com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)10 NodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener)10 AzureCmdException (com.microsoft.azuretools.azurecommons.helpers.AzureCmdException)5 EditorPart (org.eclipse.ui.part.EditorPart)3 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 ClusterDetail (com.microsoft.azure.hdinsight.sdk.cluster.ClusterDetail)1 EmulatorClusterDetail (com.microsoft.azure.hdinsight.sdk.cluster.EmulatorClusterDetail)1 HDInsightAdditionalClusterDetail (com.microsoft.azure.hdinsight.sdk.cluster.HDInsightAdditionalClusterDetail)1 IClusterDetail (com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail)1 HDInsightRootModuleImpl (com.microsoft.azure.hdinsight.serverexplore.HDInsightRootModuleImpl)1 QueueMessageForm (com.microsoft.azuretools.azureexplorer.forms.QueueMessageForm)1 QueueMessageForm (com.microsoft.intellij.forms.QueueMessageForm)1 TableEntityForm (com.microsoft.intellij.forms.TableEntityForm)1 TablesQueryDesigner (com.microsoft.intellij.forms.TablesQueryDesigner)1 NodeAction (com.microsoft.tooling.msservices.serviceexplorer.NodeAction)1 NotNull (org.jetbrains.annotations.NotNull)1