org.eclipse.datatools.sqltools.common.ui.tableviewer
Class PasteRowActionUtil

java.lang.Object
  extended by org.eclipse.datatools.sqltools.common.ui.tableviewer.PasteRowActionUtil

public class PasteRowActionUtil
extends java.lang.Object

A util for PasteRowAction, add postfix for pasted row to avoid duplicate name error for wizard and editor

Author:
Hao-yue

Constructor Summary
PasteRowActionUtil()
           
 
Method Summary
static void addPostfix(org.eclipse.datatools.sqltools.common.core.tableviewer.RowData rowData, int col, org.eclipse.datatools.sqltools.common.core.tableviewer.ITableData data)
          When the user pastes a row, a new row which is exactly identical with the original row is appended.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasteRowActionUtil

public PasteRowActionUtil()
Method Detail

addPostfix

public static void addPostfix(org.eclipse.datatools.sqltools.common.core.tableviewer.RowData rowData,
                              int col,
                              org.eclipse.datatools.sqltools.common.core.tableviewer.ITableData data)
When the user pastes a row, a new row which is exactly identical with the original row is appended. In some cases, there will be a "Duplicate name found" error. It will be nice if we automatically append a postfix to the name of pasted row. We use "_number" as the postfix. For example, in Table Schema Editor, if the column "id" is pasted, the name is changed to "id_1"; and if column "id_3" is pasted, the name is changed to "id_4". The rule is, the paste action won't introduce new error into the columns page. Steps to add postfix: