@Override public void customizeDocumentCommand(IDocument d, DocumentCommand c) { if (c.length == 0 && c.text != null && TextUtilities.endsWith(d.getLegalLineDelimiters(), c.text) != -1) autoIndentAfterNewLine(d, c); } }
@Override public void customizeDocumentCommand(IDocument d, DocumentCommand c) { if (c.length == 0 && c.text != null && TextUtilities.endsWith(d.getLegalLineDelimiters(), c.text) != -1) autoIndentAfterNewLine(d, c); } }
public void customizeDocumentCommand(IDocument document, DocumentCommand command) { if (!isSmartMode()) return; if (command.text != null) { if (command.length == 0) { String[] lineDelimiters= document.getLegalLineDelimiters(); int index= TextUtilities.endsWith(lineDelimiters, command.text); if (index > -1) { // ends with line delimiter if (lineDelimiters[index].equals(command.text)) // just the line delimiter indentAfterNewLine(document, command); return; } } if (command.text.equals("/")) { //$NON-NLS-1$ indentAfterCommentEnd(document, command); return; } } }
@Override public void customizeDocumentCommand(IDocument document, DocumentCommand command) { if (!isSmartMode()) return; if (command.text != null) { if (command.length == 0) { String[] lineDelimiters= document.getLegalLineDelimiters(); int index= TextUtilities.endsWith(lineDelimiters, command.text); if (index > -1) { // ends with line delimiter if (lineDelimiters[index].equals(command.text)) // just the line delimiter indentAfterNewLine(document, command); return; } } if (command.text.equals("/")) { //$NON-NLS-1$ indentAfterCommentEnd(document, command); return; } } }
@Override public void customizeDocumentCommand(IDocument document, DocumentCommand command) { if (!isSmartMode()) return; if (command.text != null) { if (command.length == 0) { String[] lineDelimiters= document.getLegalLineDelimiters(); int index= TextUtilities.endsWith(lineDelimiters, command.text); if (index > -1) { // ends with line delimiter if (lineDelimiters[index].equals(command.text)) // just the line delimiter indentAfterNewLine(document, command); return; } } if (command.text.equals("/")) { //$NON-NLS-1$ indentAfterCommentEnd(document, command); return; } } }
int index = TextUtilities.endsWith(lineDelimiters, command.text); if (index > -1)
public void customizeDocumentCommand( IDocument d, DocumentCommand c ) { LdifFile model = editor.getLdifModel(); LdifContainer container = LdifFile.getContainer( model, c.offset ); LdifContainer innerContainer = container != null ? LdifFile.getInnerContainer( container, c.offset ) : null; LdifPart part = container != null ? LdifFile.getContainerContent( container, c.offset ) : null; boolean smartInsertAttributeInModSpec = LdifEditorActivator.getDefault().getPreferenceStore().getBoolean( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_SMARTINSERTATTRIBUTEINMODSPEC ); if ( smartInsertAttributeInModSpec ) { if ( c.length == 0 && c.text != null && TextUtilities.endsWith( d.getLegalLineDelimiters(), c.text ) != -1 ) { if ( container instanceof LdifChangeModifyRecord && innerContainer instanceof LdifModSpec && ( part instanceof LdifAttrValLine || part instanceof LdifModSpecTypeLine ) ) { LdifModSpec modSpec = ( LdifModSpec ) innerContainer; String att = modSpec.getModSpecType().getUnfoldedAttributeDescription(); c.text += att + ": "; //$NON-NLS-1$ } } } boolean autoWrap = LdifEditorActivator.getDefault().getPreferenceStore().getBoolean( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FORMATTER_AUTOWRAP ); if ( autoWrap ) { } }