protected <T extends Item> T addItem ( final T item, final CustomizationRequest customizationRequest, final Set<MasterListener<T>> masterListeners ) { final List<String> originalLocalTags = new ArrayList<> ( customizationRequest.getLocalTags () ); // we do need a copy customizeItem ( item, customizationRequest ); // set the name after customizing final List<String> hier = new LinkedList<> (); hier.addAll ( customizationRequest.getHierarchy () ); hier.addAll ( customizationRequest.getLocalTags () ); item.setName ( Names.makeHierarchy ( hier ) ); // FIXME: should allow a different naming scheme logger.debug ( "Setting item name: {}", item.getName () ); if ( item.getInformation () == null ) { item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); } // apply the hierarchy afterwards ... overriding! ECollections.setEList ( item.getInformation ().getHierarchy (), customizationRequest.getHierarchy () ); itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); return item; }
protected <T extends Item> T addItem ( final T item, final CustomizationRequest customizationRequest, final Set<MasterListener<T>> masterListeners ) { final List<String> originalLocalTags = new ArrayList<> ( customizationRequest.getLocalTags () ); // we do need a copy customizeItem ( item, customizationRequest ); // set the name after customizing final List<String> hier = new LinkedList<> (); hier.addAll ( customizationRequest.getHierarchy () ); hier.addAll ( customizationRequest.getLocalTags () ); item.setName ( Names.makeHierarchy ( hier ) ); // FIXME: should allow a different naming scheme logger.debug ( "Setting item name: {}", item.getName () ); if ( item.getInformation () == null ) { item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); } // apply the hierarchy afterwards ... overriding! ECollections.setEList ( item.getInformation ().getHierarchy (), customizationRequest.getHierarchy () ); itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); return item; }