@Override
	public void keyPressed(KeyEvent e) {

        
		switch(e.getKeyCode()) {
		case KeyEvent.VK_UP:
			this.editor.getCursor().selectLineUp();
			break;
		case KeyEvent.VK_DOWN:
			this.editor.getCursor().selectLineDown();
			break;
		case KeyEvent.VK_LEFT:
			this.editor.getCursor().movePositionLeft();
			break;
		case KeyEvent.VK_RIGHT:
			this.editor.getCursor().movePositionRight();
			break;
		case KeyEvent.VK_DELETE:
			if(this.editor.getCursor().getCurrentPosition() < this.editor.getCursor().getCurrentLine().length())
				this.editor.getSelectedLine().deleteCharAt(this.editor.getSelectedCharacterNb());
			break;
		case KeyEvent.VK_BACK_SPACE:
			if(this.editor.getCursor().getCurrentPosition() > 0) {
				this.editor.getSelectedLine().deleteCharAt(this.editor.getSelectedCharacterNb()-1);
				this.editor.getCursor().movePositionLeft();
			}	
			break;
		}

		view.getDocument().setText(this.editor.print());
	}