use of com.cubrid.common.ui.cubrid.table.dialog.CloneTableDialog in project cubrid-manager by CUBRID.
the class MakeCloneQueryAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
final Object[] obj = this.getSelectedObj();
if (!isSupported(obj)) {
setEnabled(false);
return;
}
final DefaultSchemaNode tableNode = (DefaultSchemaNode) obj[0];
CubridDatabase db = tableNode.getDatabase();
DatabaseInfo dbInfo = db.getDatabaseInfo();
GetTablesTask getTableTask = new GetTablesTask(dbInfo);
List<String> tableList = getTableTask.getAllTableAndViews();
String tableName = null;
if (NodeType.USER_TABLE.equals(tableNode.getType())) {
tableName = tableNode.getName();
}
final CloneTableDialog dialog = new CloneTableDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), tableList, tableName);
if (IDialogConstants.OK_ID == dialog.open()) {
targetName = dialog.getTargetName();
ICubridNode[] nodeArray = { tableNode };
super.doRun(nodeArray);
}
}
Aggregations