IResource resource= (IResource) adaptable.getAdapter(IResource.class); if (resource != null) matchName= resource.getName();
IJavaElement javaElement= (IJavaElement)adaptable.getAdapter(IJavaElement.class); if (javaElement != null) matchName= javaElement.getElementName(); else { IResource resource= (IResource)adaptable.getAdapter(IResource.class); if (resource != null) matchName= resource.getName(); }
	public boolean select(Viewer viewer, Object parentElement, Object element) {		String matchName= null;		if (element instanceof IJavaElement) {			matchName= ((IJavaElement) element).getElementName();		} else if (element instanceof IAdaptable) {			IAdaptable adaptable= (IAdaptable) element;			IResource resource= (IResource) adaptable.getAdapter(IResource.class);			if (resource != null)				matchName= resource.getName();		}		if (matchName != null) {			StringMatcher[] testMatchers= getMatchers();			for (int i = 0; i < testMatchers.length; i++) {				if (testMatchers[i].match(matchName))					return false;			}			return true;		}		return true;	}