Search in sources :

Example 1 with QueueMessageForm

use of com.microsoft.intellij.forms.QueueMessageForm 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)

Aggregations

QueueMessageForm (com.microsoft.intellij.forms.QueueMessageForm)1 NodeActionEvent (com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)1 NodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener)1