Ejemplo n.º 1
0
 /* (non-Javadoc)
  * @see fr.istic.aco.editor.core.MiniEditorEngine#editorCopy()
  */
 @Override
 public void editorCopy() {
   if (selection.getStart() == 0 && selection.getStop() == 0) {
     System.out.println("<<<<ALERT : No Range selected to do copy operation>>>>");
   } else {
     clipboard.setLine(buffer.read(selection.getStart(), selection.getStop()));
     System.out.println("DEBUG: Copy Operation done : Now we have " + clipboard.getLine());
   }
 }
Ejemplo n.º 2
0
  /* (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());
    // }

  }
Ejemplo n.º 3
0
  /* (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);
    }
  }
Ejemplo n.º 4
0
 /* (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>>>>");
 }