Example #1
0
 @Override
 public void executeAction(CellActionType type) {
   if (type == CellActionType.DELETE || type == CellActionType.BACKSPACE) {
     performDeleteAction(type);
     return;
   }
   if (type == CellActionType.DELETE_TO_WORD_END) {
     super.executeAction(CellActionType.DELETE);
     return;
   }
   super.executeAction(type);
 }
 @Override
 public void executeAction(CellActionType type) {
   ((jetbrains.mps.nodeEditor.EditorComponent) getEditorComponent()).assertModelNotDisposed();
   if (type == CellActionType.DELETE || type == CellActionType.BACKSPACE) {
     performDeleteAction(type);
     return;
   }
   if (type == CellActionType.DELETE_TO_WORD_END) {
     super.executeAction(CellActionType.DELETE);
     return;
   }
   super.executeAction(type);
 }
 @Override
 public void activate() {
   super.activate();
   if (myNonTrivialSelection) {
     getEditorCellLabel().setSelectionStart(mySelectionStart);
     getEditorCellLabel().setSelectionEnd(mySelectionEnd);
   }
 }
 @Override
 public void deactivate() {
   super.deactivate();
   mySelectionStart = getEditorCellLabel().getSelectionStart();
   mySelectionEnd = getEditorCellLabel().getSelectionEnd();
   myNonTrivialSelection = mySelectionStart != mySelectionEnd;
   getEditorCellLabel().deselectAll();
 }
Example #5
0
 private void performDeleteAction(CellActionType type) {
   if (getEditorCellLabel().executeTextAction(type, false)) {
     return;
   }
   if (processSideDeletes(type)) {
     return;
   }
   if (getEditorCellLabel().executeTextAction(type, true)) {
     return;
   }
   super.executeAction(type);
 }