38a3f4a15fb4477b3042d6e3ec612bb038ddc95b
[scilab.git] / scilab / modules / xpad / src / java / org / scilab / modules / xpad / actions / IndentAction.java
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2009 - DIGITEO - Bruno JOFRET
4  *
5  * This file must be used under the terms of the CeCILL.
6  * This source file is licensed as described in the file COPYING, which
7  * you should have received as part of this distribution.  The terms
8  * are also available at
9  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10  *
11  */
12
13 package org.scilab.modules.xpad.actions;
14
15 import org.scilab.modules.xpad.Xpad;
16 import org.scilab.modules.xpad.style.ScilabStyleDocument;
17
18 public class IndentAction extends DefaultAction {
19         
20         public IndentAction(Xpad editor) {
21                 super("Indent", editor);
22         }
23         
24         public void doAction() {
25                 
26                 //int start = getEditor().getTextPane().getSelectionStart();
27                 //int end = getEditor().getTextPane().getSelectionEnd();
28                 ((ScilabStyleDocument) getEditor().getTextPane().getStyledDocument()).indent(/*start, end*/);
29                 //getEditor().getTextPane().setSelectionStart(/*start*/);
30                 getEditor().getTextPane().setSelectionEnd(getEditor().getTextPane().getCaretPosition());
31                 //((ScilabStyleDocument) _editor.getStyledDocument()).indent();
32         }
33
34 }