use of com.cubrid.common.ui.spi.table.button.InputTextDialog in project cubrid-manager by CUBRID.
the class TableDashboardComposite method showEditDialog.
public void showEditDialog(Table table, int index) {
SchemaInfo info = getData();
if (info == null) {
return;
}
List<DBAttribute> attrs = info.getAttributes();
if (attrs == null) {
return;
}
if (index >= attrs.size()) {
return;
}
DBAttribute attr = attrs.get(index);
if (attr == null) {
return;
}
InputTextDialog dialog = new InputTextDialog(Display.getCurrent().getActiveShell(), com.cubrid.common.ui.cubrid.table.Messages.titleColumnDescEditor, com.cubrid.common.ui.cubrid.table.Messages.msgColumnDescEditor, com.cubrid.common.ui.cubrid.table.Messages.labelColumnDescEditor, attr.getDescription());
if (dialog.open() == IDialogConstants.OK_ID) {
// FIXME move this logic to core module
String tableName = info.getClassname();
String columnName = attr.getName();
String description = dialog.getResult();
Connection conn = null;
try {
conn = JDBCConnectionManager.getConnection(databaseInfo, true);
SchemaCommentHandler.updateDescription(databaseInfo, conn, tableName, columnName, description);
attr.setDescription(description);
columnTableView.setInput(info);
} catch (Exception e) {
e.printStackTrace();
} finally {
QueryUtil.commit(conn);
QueryUtil.freeQuery(conn);
}
}
}
use of com.cubrid.common.ui.spi.table.button.InputTextDialog in project cubrid-manager by CUBRID.
the class ColumnViewerSorter method showEditDialog.
public void showEditDialog(Table table, int index) {
if (tableListView.getTable().getItemCount() < index) {
return;
}
TableItem item = table.getItem(index);
Object objData = item.getData();
if (objData != null && objData instanceof TableDetailInfo) {
TableDetailInfo info = (TableDetailInfo) objData;
InputTextDialog dialog = new InputTextDialog(Display.getCurrent().getActiveShell(), Messages.titleTableDescEditor, Messages.msgTableDescEditor, Messages.labelTableDescEditor, info.getTableDesc());
if (dialog.open() == IDialogConstants.OK_ID) {
String tableName = info.getTableName();
String columnName = null;
String description = dialog.getResult();
Connection conn = null;
try {
conn = JDBCConnectionManager.getConnection(database.getDatabaseInfo(), true);
SchemaCommentHandler.updateDescription(database.getDatabaseInfo(), conn, tableName, columnName, description);
info.setTableDesc(description);
tableListView.setInput(tableList);
} catch (Exception e) {
e.printStackTrace();
} finally {
QueryUtil.commit(conn);
QueryUtil.freeQuery(conn);
}
}
//For bug TOOLS-3324
// if (info != null) {
// openTableDetail(info);
// }
}
}
Aggregations