@Override public final Point getSelection(final IDocument document) { return new Point(fContext.getOffset(), fContext.getLength()); } }
@Override public final Point getSelection(final IDocument document) { return new Point(fContext.getOffset(), fContext.getLength()); } }
@Override public final Point getSelection(final IDocument document) { return new Point(fContext.getOffset(), fContext.getLength()); } }
@Override public final Point getSelection(final IDocument document) { return new Point(fContext.getOffset(), fContext.getLength()); } }
@Override public final Point getSelection(final IDocument document) { return new Point(fContext.getOffset(), fContext.getLength()); } }
@Override public final Point getSelection(final IDocument document) { return new Point(fContext.getOffset(), fContext.getLength()); } }
@Override public final Point getSelection(final IDocument document) { int offset= fContext.getOffset(); int length= fContext.getLength(); final int delta= fWord.length() - fLength; if (offset <= fOffset && offset + length >= fOffset) length += delta; else if (offset > fOffset && offset + length > fOffset + fLength) { offset += delta; length -= delta; } else length += delta; return new Point(offset, length); } }
@Override public final Point getSelection(final IDocument document) { int offset= fContext.getOffset(); int length= fContext.getLength(); final int delta= fWord.length() - fLength; if (offset <= fOffset && offset + length >= fOffset) length += delta; else if (offset > fOffset && offset + length > fOffset + fLength) { offset += delta; length -= delta; } else length += delta; return new Point(offset, length); } }
proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_0, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.MissingEndTag : break; case ProblemIDsXML.AttrsInEndTag : proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_5, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.MissingAttrValue : String defaultAttrValue = (String) ((Object[]) fAdditionalFixInfo)[0]; int insertOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[1]).intValue(); proposals.add(new CompletionProposal("\"" + defaultAttrValue + "\"", invocationContext.getOffset() + invocationContext.getLength() + insertOffset, 0, defaultAttrValue.length() + 2, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.NoAttrValue : defaultAttrValue = (String) fAdditionalFixInfo; proposals.add(new CompletionProposal("=\"" + defaultAttrValue + "\"", invocationContext.getOffset() + invocationContext.getLength(), 0, defaultAttrValue.length() + 3, getImage(), XMLUIMessages.QuickFixProcessorXML_6, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_7, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.SpacesBeforeTagName : proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_8, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.SpacesBeforePI : proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_9, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.NamespaceInPI : proposals.add(new CompletionProposal("", invocationContext.getOffset(), invocationContext.getLength(), 0, getImage(), XMLUIMessages.QuickFixProcessorXML_10, null, "")); //$NON-NLS-1$ //$NON-NLS-2$ break; case ProblemIDsXML.UnknownElement :
private PropertiesAssistContext createAssistContext(IQuickAssistInvocationContext invocationContext) { IEditorPart editorPart= fAssistant.getEditor(); IFile file= editorPart.getEditorInput().getAdapter(IFile.class); ISourceViewer sourceViewer= invocationContext.getSourceViewer(); IType accessorType= ((PropertiesFileEditor) editorPart).getAccessorType(); return new PropertiesAssistContext(sourceViewer, invocationContext.getOffset(), invocationContext.getLength(), file, sourceViewer.getDocument(), accessorType); } }
private PropertiesAssistContext createAssistContext(IQuickAssistInvocationContext invocationContext) { IEditorPart editorPart= fAssistant.getEditor(); IFile file= editorPart.getEditorInput().getAdapter(IFile.class); ISourceViewer sourceViewer= invocationContext.getSourceViewer(); IType accessorType= ((PropertiesFileEditor) editorPart).getAccessorType(); return new PropertiesAssistContext(sourceViewer, invocationContext.getOffset(), invocationContext.getLength(), file, sourceViewer.getDocument(), accessorType); } }