/* (non-Javadoc) * @see fr.istic.aco.editor.core.MiniEditorEngine#editorCut() */ @Override public void editorCut() { /*if(selection.getStart()==0 && selection.getStop()==0) { System.out.println("<<<<ALERT : No Range selected to do cut operation>>>>"); } else {*/ clipboard.setLine(buffer.read(selection.getStart(), selection.getStop())); buffer.write(selection.getStart(), selection.getStop(), ""); System.out.println("DEBUG: Cut Operation done : Now we have " + clipboard.getLine()); // } }
/* (non-Javadoc) * @see fr.istic.aco.editor.core.MiniEditorEngine#editorInsert(java.lang.String) */ @Override public void editorInsert(String substring) { if ((selection.getStop() - selection.getStart()) == 0) { if (buffer.getLine() != null) { buffer.setLine(buffer.getLine().concat(substring)); } else { buffer.setLine(substring); } } else { buffer.write(selection.getStart(), selection.getStop(), substring); } }
/* (non-Javadoc) * @see fr.istic.aco.editor.core.MiniEditorEngine#editorPaste() */ @Override public void editorPaste() { if (clipboard.getLine() != null) buffer.write(selection.getStart(), selection.getStop(), clipboard.getLine()); else System.out.println("<<<<ALERT : Nothing to Paste from ClipBoard>>>>"); }