Search in sources :

Example 1 with WrappedTelemetryNodeActionListener

use of com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener 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 WrappedTelemetryNodeActionListener(STORAGE, BLOB_COPYURL, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
            copyURLSelectedFile();
        }
    }));
    node.addAction(SAVE_AS, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_SAVEAS, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
            saveAsSelectedFile();
        }
    }));
    node.addAction(DELETE, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_DELETE, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
            deleteSelectedFile();
        }
    }));
    node.addAction(SEARCH, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_SEARCH, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
            fillGrid();
        }
    }));
    node.addAction(UPLOAD_BLOB, new WrappedTelemetryNodeActionListener(STORAGE, BLOB_UPLOAD, new NodeActionListener() {

        @Override
        protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
            uploadFile();
        }
    }));
    return node;
}
Also used : WrappedTelemetryNodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener) WrappedTelemetryNodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) EditorPart(org.eclipse.ui.part.EditorPart)

Example 2 with WrappedTelemetryNodeActionListener

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

the class FunctionNode method loadActions.

@Override
protected void loadActions() {
    addAction("Trigger Function", new WrappedTelemetryNodeActionListener(FUNCTION, TRIGGER_FUNCTION, new NodeActionListener() {

        @Override
        @AzureOperation(name = "function|trigger.start", type = AzureOperation.Type.ACTION)
        protected void actionPerformed(NodeActionEvent e) {
            final AzureString title = AzureOperationBundle.title("function|trigger.start");
            AzureTaskManager.getInstance().runInBackground(new AzureTask<>(getProject(), title, false, () -> trigger()));
        }
    }));
// todo: find whether there is sdk to enable/disable trigger
}
Also used : WrappedTelemetryNodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener) WrappedTelemetryNodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener) NodeActionListener(com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener) NodeActionEvent(com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent) AzureString(com.microsoft.azure.toolkit.lib.common.bundle.AzureString)

Aggregations

NodeActionEvent (com.microsoft.tooling.msservices.serviceexplorer.NodeActionEvent)2 NodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.NodeActionListener)2 WrappedTelemetryNodeActionListener (com.microsoft.tooling.msservices.serviceexplorer.WrappedTelemetryNodeActionListener)2 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 EditorPart (org.eclipse.ui.part.EditorPart)1