if (replaceString.length() == 0) { int pos= region.getOffset(); int k= pos; int documentLen= document.getLength(); while (k < documentLen && Strings.isIndentChar(document.getChar(k))) { k++; } if (k != pos) { document.replace(pos, k - pos, new String()); } }
		public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {			IDocument document= viewer.getDocument();			try {				String replaceString= fProposal;				ImportsStructure impStructure= null;				if (fTypeProposal != null) {					impStructure= getImportStructure();					replaceString= impStructure.addImport(fTypeProposal);				}				IRegion region= getReplaceRegion(viewer, offset);				document.replace(region.getOffset(), region.getLength(), replaceString);								if (replaceString.length() == 0) {					int pos= region.getOffset(); // new end position after modification					int k= pos;					int documentLen= document.getLength();					while (k < documentLen && Strings.isIndentChar(document.getChar(k))) {						k++;					}					if (k != pos) {						document.replace(pos, k - pos, new String());					}				}				if (impStructure != null) {					impStructure.create(false, null);				}			} catch (BadLocationException e) {				JavaPlugin.log(e);			} catch (CoreException e) {				JavaPlugin.log(e);			}		}