Bug 6532 Templates - Insert variable -- popup doesn't disappear
Window/Preferences/Java/Templates: Once one clicked on the "Insert variable" button one cannot make the popup window disappear without clicking on the "pattern" TA. Even when I switch to another application the window stays open! The window should disappear once the user clicks outside the popup window and/or changes (-> loss of focus) to another application. @@@@ Sebastian Davids
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
viewer.setEditable(true);
		viewer.setDocument(new Document(fTemplate.getPattern()));
		
		Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
		viewer.getTextWidget().setFont(font);
		
		Control control= viewer.getControl();
		GridData data= new GridData(GridData.FILL_BOTH);
		data.widthHint= convertWidthInCharsToPixels(60);
		data.heightHint= convertHeightInCharsToPixels(5);
		control.setLayoutData(data);
		
		viewer.addTextListener(new ITextListener() {
			public void textChanged(TextEvent event) {
			    try {
					fTranslator.translate(event.getDocumentEvent().getDocument().get());
			    } catch (CoreException e) {
			     	JavaPlugin.log(e);
			     	   
			    }
				
				updateUndoAction();
				updateButtons();
			}
		});
		viewer.addSelectionChangedListener(new ISelectionChangedListener() {			
			public void selectionChanged(SelectionChangedEvent event) {
				updateSelectionDependentActions();
			}
		});