command.owner= null;
	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {		// 0: early pruning		// also customize if <code>doit</code> is false (so it works in code completion situations)		//		if (!command.doit)		//			return;		if (command.text == null)			return;		if (command.text.equals(SEMICOLON))			fCharacter= SEMICHAR;		else if (command.text.equals(BRACE))			fCharacter= BRACECHAR;		else			return;		IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();		if (fCharacter == SEMICHAR && !store.getBoolean(PreferenceConstants.EDITOR_SMART_SEMICOLON))			return;		if (fCharacter == BRACECHAR && !store.getBoolean(PreferenceConstants.EDITOR_SMART_OPENING_BRACE))			return;		IWorkbenchPage page= JavaPlugin.getActivePage();		if (page == null)			return;		IEditorPart part= page.getActiveEditor();		if (!(part instanceof CompilationUnitEditor))			return;		CompilationUnitEditor editor= (CompilationUnitEditor)part;		if (editor.getInsertMode() != ITextEditorExtension3.SMART_INSERT || !editor.isEditable())			return;		ITextEditorExtension2 extension= (ITextEditorExtension2)editor.getAdapter(ITextEditorExtension2.class);		if (extension != null && !extension.validateEditorInputState())			return;		// 1: find concerned line / position in java code, location in statement		int pos= command.offset;		ITextSelection line;		try {			IRegion l= document.getLineInformationOfOffset(pos);			line= new TextSelection(document, l.getOffset(), l.getLength());		} catch (BadLocationException e) {			return;		}		// 2: choose action based on findings (is for-Statement?)		// for now: compute the best position to insert the new character		int positionInLine= computeCharacterPosition(document, line, pos - line.getOffset(), fCharacter, fPartitioning);		int position= positionInLine + line.getOffset();		// never position before the current position!		if (position < pos)			return;		// never double already existing content 		if (alreadyPresent(document, fCharacter, position))			return;		// 3: modify command		command.offset= position;		command.length= 0;		command.caretOffset= position;		command.text= adjustSpacing(document, position, fCharacter);		command.doit= true;	}