|
|
@@ -17,7 +17,7 @@ import MouseSelectionHandler from './tableselection/mouseselectionhandler';
|
|
|
/**
|
|
|
* The table selection plugin.
|
|
|
*
|
|
|
- * It introduces the ability to select table cells. Table selection is described by two nodes: start and end.
|
|
|
+ * It introduces the ability to select table cells. The table selection is described by two nodes: start and end.
|
|
|
* Both are the oposite corners of an rectangle that spans over them.
|
|
|
*
|
|
|
* Consider a table:
|
|
|
@@ -31,10 +31,10 @@ import MouseSelectionHandler from './tableselection/mouseselectionhandler';
|
|
|
* 2 | h | i | j |
|
|
|
* +---+---+---+---+
|
|
|
*
|
|
|
- * Setting table selection start as table cell "b" and end as table cell "g" will select table cells: "b", "c", "d", "f", and "g".
|
|
|
- * The cells that spans over multiple rows or columns can extend over the selection rectangle. For instance setting a selection from
|
|
|
- * table cell "a" to table cell "i" will create a selection in which table cell "i" will be extended over a rectangular of the selected
|
|
|
- * cell: "a", "b", "e", "f", "h", and "i".
|
|
|
+ * Setting the table selection start in table cell "b" and the end in table cell "g" will select table cells: "b", "c", "d", "f", and "g".
|
|
|
+ * The cells that span over multiple rows or columns can extend over the selection rectangle. For instance, setting a selection from
|
|
|
+ * the table cell "a" to the table cell "i" will create a selection in which the table cell "i" will be (partially) outside the rectangle of selected
|
|
|
+ * cells: "a", "b", "e", "f", "h", and "i".
|
|
|
*
|
|
|
* @extends module:core/plugin~Plugin
|
|
|
*/
|
|
|
@@ -69,16 +69,16 @@ export default class TableSelection extends Plugin {
|
|
|
this._mouseHandler = new MouseSelectionHandler( this, this.editor.editing );
|
|
|
|
|
|
/**
|
|
|
- * A table utilities.
|
|
|
+ * A reference to the table utilities used across the class.
|
|
|
*
|
|
|
* @private
|
|
|
* @readonly
|
|
|
- * @member {module:table/tableutils~TableUtils}
|
|
|
+ * @member {module:table/tableutils~TableUtils} #_tableUtils
|
|
|
*/
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Flag indicating that there are selected table cells and the selection has more than one table cell.
|
|
|
+ * A flag indicating that there are selected table cells and the selection includes more than one table cell.
|
|
|
*
|
|
|
* @type {Boolean}
|
|
|
*/
|
|
|
@@ -109,7 +109,7 @@ export default class TableSelection extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Starts a selection process.
|
|
|
+ * Starts the selection process.
|
|
|
*
|
|
|
* This method enables the table selection process.
|
|
|
*
|
|
|
@@ -151,13 +151,13 @@ export default class TableSelection extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Stops selection process (but do not clear the current selection). The selecting process is ended but the selection in model remains.
|
|
|
+ * Stops the selection process (but do not clear the current selection). The selection process is finished but the selection in the model remains.
|
|
|
*
|
|
|
* editor.plugins.get( 'TableSelection' ).startSelectingFrom( startTableCell );
|
|
|
* editor.plugins.get( 'TableSelection' ).setSelectingTo( endTableCell );
|
|
|
* editor.plugins.get( 'TableSelection' ).stopSelection();
|
|
|
*
|
|
|
- * To clear selection use {@link #clearSelection}.
|
|
|
+ * To clear the selection use {@link #clearSelection}.
|
|
|
*
|
|
|
* @param {module:engine/model/element~Element} [tableCell]
|
|
|
*/
|
|
|
@@ -170,7 +170,7 @@ export default class TableSelection extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Stops current selection process and clears table selection.
|
|
|
+ * Stops the current selection process and clears the table selection in the model.
|
|
|
*
|
|
|
* editor.plugins.get( 'TableSelection' ).startSelectingFrom( startTableCell );
|
|
|
* editor.plugins.get( 'TableSelection' ).setSelectingTo( endTableCell );
|
|
|
@@ -184,13 +184,13 @@ export default class TableSelection extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns iterator for selected table cells.
|
|
|
+ * Returns an iterator for selected table cells.
|
|
|
*
|
|
|
* tableSelection.startSelectingFrom( startTableCell );
|
|
|
* tableSelection.stopSelection( endTableCell );
|
|
|
*
|
|
|
* const selectedTableCells = Array.from( tableSelection.getSelectedTableCells() );
|
|
|
- * // The above array will consist a rectangular table selection.
|
|
|
+ * // The above array will represent a rectangular table selection.
|
|
|
*
|
|
|
* @returns {Iterable.<module:engine/model/element~Element>}
|
|
|
*/
|
|
|
@@ -216,7 +216,7 @@ export default class TableSelection extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set proper model selection for currently selected table cells.
|
|
|
+ * Synchronizes the model selection with currently selected table cells.
|
|
|
*
|
|
|
* @private
|
|
|
*/
|
|
|
@@ -241,7 +241,7 @@ export default class TableSelection extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Checks if selection has changed from an external source and it is required to clear internal state.
|
|
|
+ * Checks if the selection has changed via an external change and if it is required to clear the internal state of the plugin.
|
|
|
*
|
|
|
* @param {module:engine/model/documentselection~DocumentSelection} selection
|
|
|
* @private
|