Bug 64932 filter dialog: initial focus is on cancel, should be on top control or list [dialogs]
RC1 - Open the filter dialog for members view, package explorer etc. Expected: top control has focus Actual: Cancel button has focus This is annoying, because I first have to tab through. The default behaviour for dialogs should be to give focus to the first element that expects interaction. If the user just wants to cancel the dialog, he can always hit 'Esc'.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/filters/CustomFiltersDialog.java
public static String convertToString(String[] patterns, String separator) {
		int length= patterns.length;
		StringBuffer strBuf= new StringBuffer();
		if (length > 0)
			strBuf.append(escapeSeparator(patterns[0], separator));
		else
			return ""; 
		int i= 1;
		while (i < length) {
			strBuf.append(separator);
			strBuf.append(" "); 
			strBuf.append(escapeSeparator(patterns[i++], separator));
		}
		return strBuf.toString();
	}
	
	private static String escapeSeparator(String pattern, String separator) {
		int length= pattern.length();
		StringBuffer buf= new StringBuffer(length);
		for (int i= 0; i < length; i++) {
			char ch= pattern.charAt(i); 
			if (separator.equals(String.valueOf(ch)))
				buf.append(ch);
			buf.append(ch);
		}
		return buf.toString();
		
	}
}