Lines 86-97
Link Here
|
86 |
import javax.swing.event.DocumentListener; |
86 |
import javax.swing.event.DocumentListener; |
87 |
import javax.swing.UIManager; |
87 |
import javax.swing.UIManager; |
88 |
import javax.swing.text.AttributeSet; |
88 |
import javax.swing.text.AttributeSet; |
|
|
89 |
import javax.swing.text.BadLocationException; |
89 |
import org.netbeans.api.editor.EditorRegistry; |
90 |
import org.netbeans.api.editor.EditorRegistry; |
90 |
import org.netbeans.api.editor.mimelookup.MimeLookup; |
91 |
import org.netbeans.api.editor.mimelookup.MimeLookup; |
91 |
import org.netbeans.api.editor.settings.FontColorNames; |
92 |
import org.netbeans.api.editor.settings.FontColorNames; |
92 |
import org.netbeans.api.editor.settings.FontColorSettings; |
93 |
import org.netbeans.api.editor.settings.FontColorSettings; |
93 |
import org.netbeans.api.editor.settings.SimpleValueNames; |
94 |
import org.netbeans.api.editor.settings.SimpleValueNames; |
94 |
import org.netbeans.modules.editor.lib2.EditorPreferencesDefaults; |
95 |
import org.netbeans.modules.editor.lib2.EditorPreferencesDefaults; |
|
|
96 |
import org.openide.util.Exceptions; |
95 |
import org.openide.util.NbBundle; |
97 |
import org.openide.util.NbBundle; |
96 |
import org.openide.util.WeakListeners; |
98 |
import org.openide.util.WeakListeners; |
97 |
|
99 |
|
Lines 123-131
Link Here
|
123 |
|
125 |
|
124 |
public static final String OVERWRITE_LOCALE = "status-bar-overwrite"; // NOI18N |
126 |
public static final String OVERWRITE_LOCALE = "status-bar-overwrite"; // NOI18N |
125 |
|
127 |
|
126 |
private static final String[] POS_MAX_STRINGS = new String[] { "99999 | 999" }; // NOI18N |
128 |
private static final String[] POS_MAX_STRINGS = new String[] { "99999:999/9999:9999" }; // NOI18N |
127 |
|
129 |
|
128 |
private static final String[] POS_MAX_STRINGS_OFFSET = new String[] { "99999 | 999 <99999999>" }; // NOI18N |
130 |
private static final String[] POS_MAX_STRINGS_OFFSET = new String[] { "99999:999/9999:9999 <99999999>" }; // NOI18N |
129 |
|
131 |
|
130 |
private static final Insets NULL_INSETS = new Insets(0, 0, 0, 0); |
132 |
private static final Insets NULL_INSETS = new Insets(0, 0, 0, 0); |
131 |
|
133 |
|
Lines 644-653
Link Here
|
644 |
BaseDocument doc = Utilities.getDocument(component); |
646 |
BaseDocument doc = Utilities.getDocument(component); |
645 |
if (doc != null && doc.getDefaultRootElement().getElementCount()>0) { |
647 |
if (doc != null && doc.getDefaultRootElement().getElementCount()>0) { |
646 |
int pos = c.getDot(); |
648 |
int pos = c.getDot(); |
647 |
String s = Utilities.debugPosition(doc, pos, " | "); |
649 |
String s = Utilities.debugPosition(doc, pos, ":"); |
648 |
if (CARET_OFFSET_LOG.isLoggable(Level.FINE)) { // Possibly add caret offset info |
650 |
if (CARET_OFFSET_LOG.isLoggable(Level.FINE)) { // Possibly add caret offset info |
649 |
s += " <" + pos + ">"; // NOI18N |
651 |
s += " <" + pos + ">"; // NOI18N |
650 |
} |
652 |
} |
|
|
653 |
int countOfSelectedChars = component.getSelectionEnd() - component.getSelectionStart(); |
654 |
final boolean hasSelection = countOfSelectedChars > 0; |
655 |
if (hasSelection) { |
656 |
try { |
657 |
//count of selected lines |
658 |
int lineEnd = Utilities.getLineOffset(doc, component.getSelectionEnd()); |
659 |
int lineStart = Utilities.getLineOffset(doc, component.getSelectionStart()); |
660 |
s += "/" + (lineEnd - lineStart + 1); |
661 |
} catch (BadLocationException ex) { |
662 |
} |
663 |
//count of selected characters |
664 |
s += ":" + countOfSelectedChars; |
665 |
} |
666 |
//rows:cols/countRows:countCols |
651 |
setText(CELL_POSITION, s); |
667 |
setText(CELL_POSITION, s); |
652 |
} |
668 |
} |
653 |
} |
669 |
} |