/** * Sets the <code>eList</code>'s contents and order to be exactly that of the <code>prototype</code> list. * This implementation minimizes the number of notifications the operation will produce. * Objects already in the list will be moved, missing objects will be added, and extra objects will be removed. * If <code>eList</code>'s contents and order are already exactly that of the <code>prototype</code> list, * no change will be made. * @param eList the list to set. * @param prototypeList the list representing the desired content and order. * @deprecated replaced by {@link ECollections#setEList(EList, List)} in 2.1.0 */ @Deprecated public static <T> void setEList(EList<T> eList, List<? extends T> prototypeList) { ECollections.setEList(eList, prototypeList); }
/** * Sets the <code>eList</code>'s contents and order to be exactly that of the <code>prototype</code> list. * This implementation minimizes the number of notifications the operation will produce. * Objects already in the list will be moved, missing objects will be added, and extra objects will be removed. * If <code>eList</code>'s contents and order are already exactly that of the <code>prototype</code> list, * no change will be made. * @param eList the list to set. * @param prototypeList the list representing the desired content and order. * @deprecated replaced by {@link ECollections#setEList(EList, List)} in 2.1.0 */ @Deprecated public static <T> void setEList(EList<T> eList, List<? extends T> prototypeList) { ECollections.setEList(eList, prototypeList); }
/** * Sets the <code>eList</code>'s contents and order to be exactly that of the <code>prototype</code> collection. * This implementation minimizes the number of notifications the operation will produce. * Objects already in the list will be moved, missing objects will be added, and extra objects will be removed. * If <code>eList</code>'s contents and order are already exactly that of the <code>prototype</code> collection, * no change will be made. * @param eList the list to set. * @param prototypeCollection the collection representing the desired content and order. * @deprecated replaced by {@link ECollections#setEList(EList, List)} in 2.1.0 */ @Deprecated public static <T> void setEList(EList<T> eList, Collection<? extends T> prototypeCollection) { ECollections.setEList(eList, new ArrayList<T>(prototypeCollection)); }
/** * Sets the <code>eList</code>'s contents and order to be exactly that of the <code>prototype</code> collection. * This implementation minimizes the number of notifications the operation will produce. * Objects already in the list will be moved, missing objects will be added, and extra objects will be removed. * If <code>eList</code>'s contents and order are already exactly that of the <code>prototype</code> collection, * no change will be made. * @param eList the list to set. * @param prototypeCollection the collection representing the desired content and order. * @deprecated replaced by {@link ECollections#setEList(EList, List)} in 2.1.0 */ @Deprecated public static <T> void setEList(EList<T> eList, Collection<? extends T> prototypeCollection) { ECollections.setEList(eList, new ArrayList<T>(prototypeCollection)); }
public static void replaceDanglingReferences ( final GeneratorContext ctx, final MasterServer master, final EList<Item> sourceItems ) { final ArrayList<Item> items = new ArrayList<> (); for ( final Item item : sourceItems ) { items.add ( replaceDanglingReference ( ctx, master, item ) ); } // finally set the new item list ECollections.setEList ( sourceItems, items ); }
public static void replaceDanglingReferences ( final GeneratorContext ctx, final MasterServer master, final EList<Item> sourceItems ) { final ArrayList<Item> items = new ArrayList<> (); for ( final Item item : sourceItems ) { items.add ( replaceDanglingReference ( ctx, master, item ) ); } // finally set the new item list ECollections.setEList ( sourceItems, items ); }
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; }
protected void process(boolean reverse, boolean apply) { Resource resource = getResource(); if (resource != null && listChanges != null) { EList<Object> value = getValue(); if (apply) { @SuppressWarnings({"unchecked", "rawtypes"}) EList<Object> result = (EList)resource.getContents(); ECollections.setEList(result, value); } if (reverse) { ECollections.reverse(getListChanges()); setValue(newValue); } } }
protected void process(boolean reverse, boolean apply) { Resource resource = getResource(); if (resource != null && listChanges != null) { EList<Object> value = getValue(); if (apply) { @SuppressWarnings({"unchecked", "rawtypes"}) EList<Object> result = (EList)resource.getContents(); ECollections.setEList(result, value); } if (reverse) { ECollections.reverse(getListChanges()); setValue(newValue); } } }
ECollections.setEList(entry.getKey().getEAnnotations(), entry.getValue());