use of com.microsoft.intellij.forms.TableEntityForm 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;
}
use of com.microsoft.intellij.forms.TableEntityForm in project azure-tools-for-java by Microsoft.
the class TableFileEditor method editEntity.
private void editEntity() {
TableEntity[] selectedEntities = getSelectedEntities();
if (selectedEntities != null && selectedEntities.length > 0) {
final TableEntity selectedEntity = selectedEntities[0];
final TableEntityForm form = new TableEntityForm(project);
form.setTableName(table.getName());
form.setStorageAccount(storageAccount);
form.setTableEntity(selectedEntity);
form.setTitle("Edit Entity");
form.setOnFinish(new Runnable() {
@Override
public void run() {
tableEntities.set(entitiesTable.getSelectedRow(), form.getTableEntity());
refreshGrid();
}
});
form.show();
}
}
Aggregations