Search in sources :

Example 1 with SQLPropertyDialog

use of org.talend.sqlbuilder.ui.SQLPropertyDialog in project tdi-studio-se by Talend.

the class ShowQueryPropertyAction method run.

@Override
public void run() {
    RepositoryNode node = (RepositoryNode) getStructuredSelection().getFirstElement();
    QueryRepositoryObject object = (QueryRepositoryObject) node.getObject();
    Query query = object.getQuery();
    String oldQuery = query.getLabel();
    // Finds the root
    node = SQLBuilderRepositoryNodeManager.getRoot(node);
    List<String> existingName = repositoryNodeManager.getALLQueryLabels(node);
    SQLPropertyDialog saveSQLDialog = new SQLPropertyDialog(dialog.getShell(), true);
    saveSQLDialog.setQuery(query);
    if (Window.OK == saveSQLDialog.open()) {
        query = saveSQLDialog.getQuery();
        repositoryNodeManager.saveQuery(node, query, oldQuery);
        dialog.refreshNode(node);
        dialog.notifySQLBuilder(node.getObject());
    }
}
Also used : QueryRepositoryObject(org.talend.sqlbuilder.dbstructure.DBTreeProvider.QueryRepositoryObject) Query(org.talend.core.model.metadata.builder.connection.Query) RepositoryNode(org.talend.repository.model.RepositoryNode) SQLPropertyDialog(org.talend.sqlbuilder.ui.SQLPropertyDialog)

Aggregations

Query (org.talend.core.model.metadata.builder.connection.Query)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1 QueryRepositoryObject (org.talend.sqlbuilder.dbstructure.DBTreeProvider.QueryRepositoryObject)1 SQLPropertyDialog (org.talend.sqlbuilder.ui.SQLPropertyDialog)1