use of com.cubrid.common.ui.cubrid.table.dialog.RenameColumnDialog in project cubrid-manager by CUBRID.
the class RenameColumnAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
Object[] obj = this.getSelectedObj();
if (!isSupported(obj)) {
setEnabled(false);
return;
}
ISchemaNode cn = (ISchemaNode) obj[0];
TableColumn tc = (TableColumn) cn.getAdapter(TableColumn.class);
RenameColumnDialog dialog = new RenameColumnDialog(shell, cn.getParent().getParent().getName(), tc.getColumnName(), cn.getDatabase());
if (dialog.open() == Dialog.OK) {
CommonUITool.refreshNavigatorTree((TreeViewer) provider, cn.getParent().getParent());
ICubridNode tableNode = cn.getParent().getParent();
if (tableNode != null && tableNode instanceof ISchemaNode) {
/* Broadcast the view changed */
QueryEditorUtil.fireSchemaNodeChanged((ISchemaNode) tableNode);
}
}
}
Aggregations