Bug 118479 [api] Need a way to get a shared instance of JavaTextTools
JavaTextTools contains tools required to cofigure a java text viewer, and those tools can be shared via JavaTextTools. Currently, when clients want to use those tools, they need to first create a new instance of JavaTextTools and then share their instance of JavaTextTools in order to share the tools in JavaTextTools. This seems like it goes against the purpose of JavaTextTools. You should only really have 1 instance of JavaTextTools (at least per preferenceStore) Plus, you also need to make sure you dispose JavaTextTools, so by having only 1 instance, it'll be easier to keep track of to dispose. JDT is already kind of doing this by only creating one instance of JavaTextTools in JavaPlugin. I think this one instance should be shared amongst other clients instead of just the jdt plugin. A new method should be added to JavaUI, getJavaTextTools, which gets JavaTextTools from JavaPlugin.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaUI.java
*   packages from binary package fragment roots should be included in addition
	 *   to those from source package fragment roots;
	 *   <code>IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS</code>, indicating that
	 *   packages from required projects should be included as well.
	 * @param filter the initial pattern to filter the set of packages. For example "com" shows 
	 * all packages starting with "com". The meta character '?' representing any character and 
	 * '*' representing any string are supported. Clients can pass an empty string if no filtering 
	 * is required.
	 * @return a new selection dialog
	 * @exception JavaModelException if the selection dialog could not be opened
	 * 
	 * @since 2.0
	 */
	public static SelectionDialog createPackageDialog(Shell parent, IJavaProject project, int style, String filter) throws JavaModelException {
		Assert.isTrue((style | IJavaElementSearchConstants.CONSIDER_BINARIES | IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS) ==
			(IJavaElementSearchConstants.CONSIDER_BINARIES | IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS));
		IPackageFragmentRoot[] roots= null;
		if ((style & IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS) != 0) {
		    roots= project.getAllPackageFragmentRoots();
		} else {	
			roots= project.getPackageFragmentRoots();	
		}
		
		List consideredRoots= null;
		if ((style & IJavaElementSearchConstants.CONSIDER_BINARIES) != 0) {
			consideredRoots= Arrays.asList(roots);
		} else {
			consideredRoots= new ArrayList(roots.length);
			for (int i= 0; i < roots.length; i++) {
				IPackageFragmentRoot root= roots[i];