Search in sources :

Example 11 with NodeActionEvent

use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.

the class BlobExplorerFileEditor method createVirtualNode.

private FileEditorVirtualNode createVirtualNode(final String name) {
    final FileEditorVirtualNode node = new FileEditorVirtualNode(this, name);
    node.addAction(OPEN, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            downloadSelectedFile(true);
        }
    });
    node.addAction(SAVE_AS, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            saveAsSelectedFile();
        }
    });
    node.addAction(COPY_URL, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            copyURLSelectedFile();
        }
    });
    node.addAction(DELETE, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            deleteSelectedFile();
        }
    });
    node.addAction(UPLOAD, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            uploadFile();
        }
    });
    node.addAction(QUERY, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            fillGrid();
        }
    });
    return node;
}
Also used : NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)

Example 12 with NodeActionEvent

use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.

the class QueueFileEditor method createFileEditorVirtualNode.

private FileEditorVirtualNode createFileEditorVirtualNode(final String name) {
    FileEditorVirtualNode node = new FileEditorVirtualNode(this, name);
    node.addAction(REFRESH, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            fillGrid();
        }
    });
    node.addAction(DEQUEUE, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            dequeueFirstMessage();
        }
    });
    node.addAction(ADD_MESSAGE, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            QueueMessageForm queueMessageForm = new QueueMessageForm(project);
            queueMessageForm.setQueue(queue);
            queueMessageForm.setStorageAccount(storageAccount);
            queueMessageForm.setOnAddedMessage(new Runnable() {

                @Override
                public void run() {
                    fillGrid();
                }
            });
            queueMessageForm.show();
        }
    });
    node.addAction(CLEAR_QUEUE, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            int optionDialog = DefaultLoader.getUIHelper().showConfirmDialog(null, "Are you sure you want to clear the queue \"" + queue.getName() + "\"?", "Azure Explorer", new String[] { "Yes", "No" }, null, null);
        }
    });
    node.addAction(OPEN, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            viewMessageText();
        }
    });
    return node;
}
Also used : NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) QueueMessageForm(com.microsoft.intellij.forms.QueueMessageForm)

Example 13 with NodeActionEvent

use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent in project azure-tools-for-java by Microsoft.

the class TableFileEditor method createFileEditorVirtualNode.

private FileEditorVirtualNode createFileEditorVirtualNode(final String name) {
    FileEditorVirtualNode fileEditorVirtualNode = new FileEditorVirtualNode(this, name);
    fileEditorVirtualNode.addAction(EDIT, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            editEntity();
        }
    });
    fileEditorVirtualNode.addAction(DELETE, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            deleteSelection();
        }
    });
    fileEditorVirtualNode.addAction(QUERY, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            fillGrid();
        }
    });
    fileEditorVirtualNode.addAction(QUERY_DESIGNER, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            final TablesQueryDesigner form = new TablesQueryDesigner(project);
            form.setOnFinish(new Runnable() {

                @Override
                public void run() {
                    queryTextField.setText(form.getQueryText());
                }
            });
            form.show();
        }
    });
    fileEditorVirtualNode.addAction(NEW_ENTITY, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) {
            final TableEntityForm form = new TableEntityForm(project);
            form.setTableName(table.getName());
            form.setStorageAccount(storageAccount);
            form.setTableEntity(null);
            form.setTableEntityList(tableEntities);
            form.setTitle("Add Entity");
            form.setOnFinish(new Runnable() {

                @Override
                public void run() {
                    tableEntities.add(form.getTableEntity());
                    refreshGrid();
                }
            });
            form.show();
        }
    });
    return fileEditorVirtualNode;
}
Also used : TableEntityForm(com.microsoft.intellij.forms.TableEntityForm) TablesQueryDesigner(com.microsoft.intellij.forms.TablesQueryDesigner) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)

Example 14 with NodeActionEvent

use of com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent 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)14 NodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener)14 AzureCmdException (com.microsoft.azuretools.azurecommons.helpers.AzureCmdException)3 EditorPart (org.eclipse.ui.part.EditorPart)3 NotNull (com.microsoft.azuretools.azurecommons.helpers.NotNull)2 WrappedTelemetryNodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener)2 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 AddNewHDInsightReaderClusterForm (com.microsoft.azure.hdinsight.serverexplore.ui.AddNewHDInsightReaderClusterForm)1 Azure (com.microsoft.azure.toolkit.lib.Azure)1 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 ResourceGroup (com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)1 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)1 AzureTelemetry (com.microsoft.azure.toolkit.lib.common.telemetry.AzureTelemetry)1 AzureGroup (com.microsoft.azure.toolkit.lib.resource.AzureGroup)1 StorageAccountConfig (com.microsoft.azure.toolkit.lib.storage.model.StorageAccountConfig)1 AzureStorageAccount (com.microsoft.azure.toolkit.lib.storage.service.AzureStorageAccount)1 StorageAccount (com.microsoft.azure.toolkit.lib.storage.service.StorageAccount)1