OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 13 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 156
Line 14... Line 14...
14
import java.awt.Dimension;
14
import java.awt.Dimension;
15
import java.awt.Font;
15
import java.awt.Font;
16
import java.awt.FontMetrics;
16
import java.awt.FontMetrics;
17
import java.awt.Insets;
17
import java.awt.Insets;
18
import java.awt.LayoutManager;
18
import java.awt.LayoutManager;
-
 
19
import java.awt.Rectangle;
19
import java.awt.datatransfer.Clipboard;
20
import java.awt.datatransfer.Clipboard;
20
import java.awt.datatransfer.DataFlavor;
21
import java.awt.datatransfer.DataFlavor;
21
import java.awt.datatransfer.StringSelection;
22
import java.awt.datatransfer.StringSelection;
22
import java.awt.event.ActionEvent;
23
import java.awt.event.ActionEvent;
23
import java.awt.event.ActionListener;
24
import java.awt.event.ActionListener;
Line 33... Line 34...
33
import java.awt.event.MouseEvent;
34
import java.awt.event.MouseEvent;
34
import java.awt.event.MouseMotionListener;
35
import java.awt.event.MouseMotionListener;
35
import java.util.Enumeration;
36
import java.util.Enumeration;
36
import java.util.Vector;
37
import java.util.Vector;
37
 
38
 
38
import javax.swing.Action;
-
 
39
import javax.swing.JPopupMenu;
39
import javax.swing.JPopupMenu;
40
import javax.swing.JScrollBar;
40
import javax.swing.JScrollBar;
41
import javax.swing.SwingUtilities;
41
import javax.swing.SwingUtilities;
42
import javax.swing.Timer;
42
import javax.swing.Timer;
43
import javax.swing.event.CaretEvent;
43
import javax.swing.event.CaretEvent;
Line 47... Line 47...
47
import javax.swing.event.EventListenerList;
47
import javax.swing.event.EventListenerList;
48
import javax.swing.text.BadLocationException;
48
import javax.swing.text.BadLocationException;
49
import javax.swing.text.Element;
49
import javax.swing.text.Element;
50
import javax.swing.text.JTextComponent;
50
import javax.swing.text.JTextComponent;
51
import javax.swing.text.Segment;
51
import javax.swing.text.Segment;
52
import javax.swing.text.TextAction;
-
 
53
import javax.swing.text.Utilities;
52
import javax.swing.text.Utilities;
54
import javax.swing.undo.AbstractUndoableEdit;
53
import javax.swing.undo.AbstractUndoableEdit;
55
import javax.swing.undo.CannotRedoException;
54
import javax.swing.undo.CannotRedoException;
56
import javax.swing.undo.CannotUndoException;
55
import javax.swing.undo.CannotUndoException;
57
import javax.swing.undo.UndoableEdit;
56
import javax.swing.undo.UndoableEdit;
Line 1803... Line 1802...
1803
        CaretUndo(int start, int end) {
1802
        CaretUndo(int start, int end) {
1804
            this.start = start;
1803
            this.start = start;
1805
            this.end = end;
1804
            this.end = end;
1806
        }
1805
        }
1807
 
1806
 
-
 
1807
        @Override
1808
        public boolean isSignificant() {
1808
        public boolean isSignificant() {
1809
            return false;
1809
            return false;
1810
        }
1810
        }
1811
 
1811
 
-
 
1812
        @Override
1812
        public String getPresentationName() {
1813
        public String getPresentationName() {
1813
            return "caret move";
1814
            return "caret move";
1814
        }
1815
        }
1815
 
1816
 
-
 
1817
        @Override
1816
        public void undo() throws CannotUndoException {
1818
        public void undo() throws CannotUndoException {
1817
            super.undo();
1819
            super.undo();
1818
 
1820
 
1819
            select(start, end);
1821
            select(start, end);
1820
        }
1822
        }
1821
 
1823
 
-
 
1824
        @Override
1822
        public void redo() throws CannotRedoException {
1825
        public void redo() throws CannotRedoException {
1823
            super.redo();
1826
            super.redo();
1824
 
1827
 
1825
            select(start, end);
1828
            select(start, end);
1826
        }
1829
        }
1827
 
1830
 
-
 
1831
        @Override
1828
        public boolean addEdit(UndoableEdit edit) {
1832
        public boolean addEdit(UndoableEdit edit) {
1829
            if (edit instanceof CaretUndo) {
1833
            if (edit instanceof CaretUndo) {
1830
                CaretUndo cedit = (CaretUndo) edit;
1834
                CaretUndo cedit = (CaretUndo) edit;
1831
                start = cedit.start;
1835
                start = cedit.start;
1832
                end = cedit.end;
1836
                end = cedit.end;
Line 1842... Line 1846...
1842
        caretTimer = new Timer(500, new CaretBlinker());
1846
        caretTimer = new Timer(500, new CaretBlinker());
1843
        caretTimer.setInitialDelay(500);
1847
        caretTimer.setInitialDelay(500);
1844
        caretTimer.start();
1848
        caretTimer.start();
1845
    }
1849
    }
1846
 
1850
 
-
 
1851
    @Override
1847
    public void updateUI() {
1852
    public void updateUI() {
1848
 
-
 
1849
        invalidate();
1853
        invalidate();
1850
    }
1854
    }
1851
 
1855
 
-
 
1856
    @Override
-
 
1857
    public Rectangle modelToView(int pos) throws BadLocationException {
-
 
1858
        return new Rectangle(0, 0, 0, 0);
-
 
1859
    }
-
 
1860
 
1852
    /**
1861
    /**
1853
     * Fetches the command list for the editor. This is the list of commands supported by the
1862
     * Fetches the command list for the editor. This is the list of commands supported by the
1854
     * plugged-in UI augmented by the collection of commands that the editor itself supports. These
1863
     * plugged-in UI augmented by the collection of commands that the editor itself supports. These
1855
     * are useful for binding to events, such as in a keymap.
1864
     * are useful for binding to events, such as in a keymap.
1856
     * 
1865
     *