eas of assistance editing functions

Copy, Cut, Paste
// Copy
table.getEditHelper () Copy ();.
// Cut
table.getEditHelper () Cut ();.
// Paste
table.getEditHelper () Paste ();.
table.getEditHelper (). isPastable (); // if there is valid data can paste

delete
// delete the selected region
table.getEditHelper () delete ();.
// delete the specified region
KDTRange new new KDTRange Range = ();
range.add (new new KDTBlock ( 0, 0, 1, 1));
// delete the contents (including formulas, values, the UserObject)
table.getEditHelper () the delete (the Range);.
// delete option can also be specified
. // table.getEditHelper () delete ( the Range, KDTEditHelper.DELETE_VALUE);

// delete cells (the default is to delete only content)
table.getEditHelper () deleteCell (rowIndex, colIndex);.
// delete option can also be specified
table.getEditHelper () deleteCell (rowIndex, colIndex , KDTEditHelper.DELETE_ALL);.

Delete option definition:
content KDTEditHelper.DELETE_ALL delete cells and style
KDTEditHelper.DELETE_CONTENT cell contents (including the contents except STYLE) delete only
KDTEditHelper .DELETE_STYLE delete only the cell style
KDTEditHelper.DELETE_VALUE delete only cell values
KDTEditHelper.DELETE_FORMULA delete only cell formula
KDTEditHelper.DELETE_USEROBJECT cell userObject delete only


to rapidly create an empty data table row
// constructor has created with table row null data, is created with the following code shows five, two methods table row header row 10 and dummy data lines.
@ Method a:
KDTable new new table KDTable = (. 5,. 1, 10);
// Method two:
KDTable table = new new KDTable ();
this.createBlankTable (. 5,. 1, 10);
prohibit copy, paste, cut operation
table .getActionMap () Remove (KDTAction.COPY);.
table.getActionMap () Remove (KDTAction.PASTE).;
table.getActionMap().remove(KDTAction.CUT);




Guess you like

Origin www.cnblogs.com/luojiabao/p/10963917.html
EAS