Search in sources :

Example 1 with TablesQueryDesigner

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

Aggregations

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