buf.append(fgPkgNamePrefix); if (fgPkgNameChars > 0) buf.append(name.substring(start, Math.min(start+ fgPkgNameChars, dot))); buf.append(fgPkgNamePostfix);
if (dot - start > fgPkgNameLength-1) { buf.append(fgPkgNamePrefix); if (fgPkgNameChars > 0) buf.append(name.substring(start, Math.min(start+ fgPkgNameChars, dot))); buf.append(fgPkgNamePostfix); } else buf.append(name.substring(start, dot + 1));
	public static void getPackageFragmentLabel(IPackageFragment pack, int flags, StringBuffer buf) {		if (getFlag(flags, P_QUALIFIED)) {			getPackageFragmentRootLabel((IPackageFragmentRoot) pack.getParent(), ROOT_QUALIFIED, buf);			buf.append('/');		}		if (pack.isDefaultPackage()) {			buf.append(JavaUIMessages.getString("JavaElementLabels.default_package")); //$NON-NLS-1$		} else if (getFlag(flags, P_COMPRESSED)) {				String name= pack.getElementName();				refreshPackageNamePattern();				int start= 0;				int dot= name.indexOf('.', start);				while (dot > 0) {					buf.append(fgPkgNamePrefix);					if (fgPkgNameChars > 0)						buf.append(name.substring(start, Math.min(start+ fgPkgNameChars, dot)));					buf.append(fgPkgNamePostfix);					start= dot + 1;					dot= name.indexOf('.', start);				}				buf.append(name.substring(start));		} else {			buf.append(pack.getElementName());		}		if (getFlag(flags, P_POST_QUALIFIED)) {			buf.append(CONCAT_STRING);			getPackageFragmentRootLabel((IPackageFragmentRoot) pack.getParent(), ROOT_QUALIFIED, buf);		}	}