JavaPlugin.log(e); } catch (BadPositionCategoryException e) { JavaPlugin.log(e);
		public void verifyKey(VerifyEvent event) {						if (!event.doit || getInsertMode() != SMART_INSERT)				return;							final ISourceViewer sourceViewer= getSourceViewer();			IDocument document= sourceViewer.getDocument();			final Point selection= sourceViewer.getSelectedRange();			final int offset= selection.x;			final int length= selection.y;			switch (event.character) {			case '(':				if (hasCharacterToTheRight(document, offset + length, '('))					return;				// fall through			case '[':					if (!fCloseBrackets)						return;					if (hasIdentifierToTheRight(document, offset + length))						return;							// fall through						case '\'':				if (event.character == '\'') {					if (!fCloseStrings)						return;					if (hasIdentifierToTheLeft(document, offset) || hasIdentifierToTheRight(document, offset + length))						return;				}								// fall through			case '"':				if (event.character == '"') {					if (!fCloseStrings)						return;					if (hasIdentifierToTheLeft(document, offset) || hasIdentifierToTheRight(document, offset + length))						return;				}								try {							ITypedRegion partition= TextUtilities.getPartition(document, IJavaPartitions.JAVA_PARTITIONING, offset);					if (! IDocument.DEFAULT_CONTENT_TYPE.equals(partition.getType()) && partition.getOffset() != offset)						return;											if (!validateEditorInputState())						return;					final char character= event.character;					final char closingCharacter= getPeerCharacter(character);					final StringBuffer buffer= new StringBuffer();					buffer.append(character);					buffer.append(closingCharacter);					document.replace(offset, length, buffer.toString());															BracketLevel level= new BracketLevel();					fBracketLevelStack.push(level);										level.fManager= new LinkedPositionManager(document, true); // bracket managers can always coexist					level.fManager.addPosition(offset + 1, 0);					level.fOffset= offset;					level.fLength= 2;								level.fEditor= new LinkedPositionUI(sourceViewer, level.fManager);					level.fEditor.setCancelListener(this);					level.fEditor.setExitPolicy(new ExitPolicy(closingCharacter, getEscapeCharacter(closingCharacter), fBracketLevelStack));					level.fEditor.setFinalCaretOffset(offset + 2);					level.fEditor.enter();															IRegion newSelection= level.fEditor.getSelectedRegion();					sourceViewer.setSelectedRange(newSelection.getOffset(), newSelection.getLength());						event.doit= false;				} catch (BadLocationException e) {				}				break;				}		}