@Override public void setText(String newText) { setText((CharSequence) newText); }
@Override public void setText(String newText) { setText((CharSequence) newText); }
public void setText(String newText) { setText((CharSequence) newText); }
/** * Grab a list of camelCase-separated suffixes from the typeName, for * example: * * "JavaElementName" => { "Java", "Element", "Name } * * "ASTNode" => { "AST", "Node" } * */ private String[] getSuffixes(String typeName) { List<String> suffixes= new ArrayList<>(); JavaWordIterator iterator= new JavaWordIterator(); iterator.setText(typeName); int lastmatch= 0; int match; while ( (match= iterator.next()) != BreakIterator.DONE) { suffixes.add(typeName.substring(lastmatch, match)); lastmatch= match; } return suffixes.toArray(new String[0]); }
/** * Grab a list of camelCase-separated suffixes from the typeName, for * example: * * "JavaElementName" => { "Java", "Element", "Name } * * "ASTNode" => { "AST", "Node" } * */ private String[] getSuffixes(String typeName) { List<String> suffixes= new ArrayList<>(); JavaWordIterator iterator= new JavaWordIterator(); iterator.setText(typeName); int lastmatch= 0; int match; while ( (match= iterator.next()) != BreakIterator.DONE) { suffixes.add(typeName.substring(lastmatch, match)); lastmatch= match; } return suffixes.toArray(new String[0]); }
/** * Grab a list of camelCase-separated suffixes from the typeName, for * example: * * "JavaElementName" => { "Java", "Element", "Name } * * "ASTNode" => { "AST", "Node" } * */ private String[] getSuffixes(String typeName) { List suffixes= new ArrayList(); JavaWordIterator iterator= new JavaWordIterator(); iterator.setText(typeName); int lastmatch= 0; int match; while ( (match= iterator.next()) != BreakIterator.DONE) { suffixes.add(typeName.substring(lastmatch, match)); lastmatch= match; } return (String[]) suffixes.toArray(new String[0]); }
public void run() { // Check whether we are in a java code partition and the preference is enabled final IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) { super.run(); return; } final ISourceViewer viewer= getSourceViewer(); final IDocument document= viewer.getDocument(); fIterator.setText((CharacterIterator) new DocumentCharacterIterator(document)); int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset()); if (position == -1) return; int next= findNextPosition(position); if (next != BreakIterator.DONE) { setCaretPosition(next); getTextWidget().showSelection(); fireSelectionChanged(); } }
public void run() { // Check whether we are in a java code partition and the preference is enabled final IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) { super.run(); return; } final ISourceViewer viewer= getSourceViewer(); final IDocument document= viewer.getDocument(); fIterator.setText((CharacterIterator) new DocumentCharacterIterator(document)); int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset()); if (position == -1) return; int previous= findPreviousPosition(position); if (previous != BreakIterator.DONE) { setCaretPosition(previous); getTextWidget().showSelection(); fireSelectionChanged(); } }
@Override public void run() { // Check whether we are in a java code partition and the preference is enabled final IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) { super.run(); return; } final ISourceViewer viewer= getSourceViewer(); final IDocument document= viewer.getDocument(); try { fIterator.setText((CharacterIterator)new DocumentCharacterIterator(document)); int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset()); if (position == -1) return; int next= findNextPosition(position); if (isBlockSelectionModeEnabled() && document.getLineOfOffset(next) != document.getLineOfOffset(position)) { super.run(); // may navigate into virtual white space } else if (next != BreakIterator.DONE) { setCaretPosition(next); getTextWidget().showSelection(); fireSelectionChanged(); } } catch (BadLocationException x) { // ignore } }
@Override public void run() { // Check whether we are in a java code partition and the preference is enabled final IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) { super.run(); return; } final ISourceViewer viewer= getSourceViewer(); final IDocument document= viewer.getDocument(); try { fIterator.setText((CharacterIterator)new DocumentCharacterIterator(document)); int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset()); if (position == -1) return; int previous= findPreviousPosition(position); if (isBlockSelectionModeEnabled() && document.getLineOfOffset(previous) != document.getLineOfOffset(position)) { super.run(); // may navigate into virtual white space } else if (previous != BreakIterator.DONE) { setCaretPosition(previous); getTextWidget().showSelection(); fireSelectionChanged(); } } catch (BadLocationException x) { // ignore - getLineOfOffset failed } }
@Override public void run() { // Check whether we are in a java code partition and the preference is enabled final IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) { super.run(); return; } final ISourceViewer viewer= getSourceViewer(); final IDocument document= viewer.getDocument(); try { fIterator.setText((CharacterIterator)new DocumentCharacterIterator(document)); int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset()); if (position == -1) return; int next= findNextPosition(position); if (isBlockSelectionModeEnabled() && document.getLineOfOffset(next) != document.getLineOfOffset(position)) { super.run(); // may navigate into virtual white space } else if (next != BreakIterator.DONE) { setCaretPosition(next); getTextWidget().showSelection(); fireSelectionChanged(); } } catch (BadLocationException x) { // ignore } }
@Override public void run() { // Check whether we are in a java code partition and the preference is enabled final IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(PreferenceConstants.EDITOR_SUB_WORD_NAVIGATION)) { super.run(); return; } final ISourceViewer viewer= getSourceViewer(); final IDocument document= viewer.getDocument(); try { fIterator.setText((CharacterIterator)new DocumentCharacterIterator(document)); int position= widgetOffset2ModelOffset(viewer, viewer.getTextWidget().getCaretOffset()); if (position == -1) return; int previous= findPreviousPosition(position); if (isBlockSelectionModeEnabled() && document.getLineOfOffset(previous) != document.getLineOfOffset(position)) { super.run(); // may navigate into virtual white space } else if (previous != BreakIterator.DONE) { setCaretPosition(previous); getTextWidget().showSelection(); fireSelectionChanged(); } } catch (BadLocationException x) { // ignore - getLineOfOffset failed } }