if (parent instanceof IPackageFragmentRoot){ IPackageFragmentRoot root= (IPackageFragmentRoot) parent; if (fProjectViewState){ postRefresh(root.getJavaProject()); } else postRefresh(root); } else { postAdd(element, parent); postRemove(iPackageFrament); }  } } else { fMapToCompoundElement.put(key, frag);
	private void addElement(IPackageFragment frag, Object parent) {				if(fMapToCompoundElement==null){			postAdd(frag, parent);			return;			}		String key= getKey(frag);		Object object= fMapToCompoundElement.get(key);		//if fragment must be added to an existing CompoundElement		if (object instanceof LogicalPackage){			LogicalPackage element= (LogicalPackage) object;			if (element.belongs(frag)){				element.add(frag);			}		//if a new CompoundElement must be created		} else if (object instanceof IPackageFragment){			IPackageFragment iPackageFrament= (IPackageFragment) object;			if (!iPackageFrament.equals(frag)){				LogicalPackage element= new LogicalPackage(iPackageFrament);				element.add(frag);				fMapToCompoundElement.put(key, element);												if (parent instanceof IPackageFragmentRoot){					IPackageFragmentRoot root= (IPackageFragmentRoot) parent;					if (fProjectViewState){						postRefresh(root.getJavaProject());						} else postRefresh(root);				} else { 					postAdd(element, parent);					postRemove(iPackageFrament);				}			}		} else {			fMapToCompoundElement.put(key, frag);			if (parent instanceof IPackageFragmentRoot) {				IPackageFragmentRoot root= (IPackageFragmentRoot) parent;				if (fProjectViewState) {					postRefresh(root.getJavaProject());				} else					postRefresh(root);			} else {				postAdd(frag, parent);			}		}	}