示例#1
0
 protected RestorableSelection createRestorableSelection(EditorContext editorContext) {
   EditorCell selectedCell = editorContext.getSelectedCell();
   String cellId = check_j6szs9_a0b0a(selectedCell);
   SNode selectedNode = check_j6szs9_a0c0a(selectedCell);
   if (cellId == null || selectedNode == null) {
     return null;
   }
   CellIdLocator locator = new CellIdLocator(cellId, selectedNode);
   CellSelector selector;
   if (selectedCell instanceof EditorCell_Label) {
     EditorCell_Label label = ((EditorCell_Label) selectedCell);
     selector =
         new LabelCellSelector(
             label.getCaretPosition(), label.getSelectionStart(), label.getSelectionEnd());
   } else {
     selector = new WholeCellSelector();
   }
   return new RestorableSelectionByCell(locator, selector);
 }
示例#2
0
 public EditorCellLabelSelection(EditorCell_Label editorCell) {
   super(editorCell);
   mySelectionStart = editorCell.getSelectionStart();
   mySelectionEnd = editorCell.getSelectionEnd();
   myNonTrivialSelection = mySelectionStart != mySelectionEnd;
 }