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
private SourceViewer fPatternEditor;
	
	private Button fInsertVariableButton;
	private TemplateTranslator fTranslator= new TemplateTranslator();
	
	private boolean fSuppressError= true; 
	
	private Map fGlobalActions= new HashMap(10);
	private List fSelectionActions = new ArrayList(3);	
	private Vector fContextTypes= new Vector();
	
	private final TemplateVariableProcessor fProcessor= new TemplateVariableProcessor();
		
	public EditTemplateDialog(Shell parent, Template template, boolean edit) {
		super(parent);
		
		setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE);
		
		String title= edit
			? TemplateMessages.getString("EditTemplateDialog.title.edit") 
			: TemplateMessages.getString("EditTemplateDialog.title.new"); 
		setTitle(title);
		fTemplate= template;
		
		ContextTypeRegistry registry= ContextTypeRegistry.getInstance();
		for (Iterator iterator= registry.iterator(); iterator.hasNext(); )
			fContextTypes.add(iterator.next());
		if (fContextTypes.size() > 0)
			fProcessor.setContextType(ContextTypeRegistry.getInstance().getContextType((String) fContextTypes.get(0)));
	}