Search in sources :

Example 1 with EditorPart

use of org.eclipse.ui.part.EditorPart 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 EditorPart

use of org.eclipse.ui.part.EditorPart 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 EditorPart

use of org.eclipse.ui.part.EditorPart 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

AzureCmdException (com.microsoft.azuretools.azurecommons.helpers.AzureCmdException)3 NodeActionEvent (com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)3 NodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener)3 EditorPart (org.eclipse.ui.part.EditorPart)3 QueueMessageForm (com.microsoft.azuretools.azureexplorer.forms.QueueMessageForm)1