static SubProfile findTargetSubProfile ( final String name, final Profile target ) { for ( final SubProfile sub : target.getProfile () ) { if ( sub.getName ().equals ( name ) ) { return sub; } } // did not find, create a new one final SubProfile sub = ProfileFactory.eINSTANCE.createSubProfile (); sub.setName ( name ); target.getProfile ().add ( sub ); return sub; } }
static SubProfile findTargetSubProfile ( final String name, final Profile target ) { for ( final SubProfile sub : target.getProfile () ) { if ( sub.getName ().equals ( name ) ) { return sub; } } // did not find, create a new one final SubProfile sub = ProfileFactory.eINSTANCE.createSubProfile (); sub.setName ( name ); target.getProfile ().add ( sub ); return sub; } }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors ( Collection<Object> newChildDescriptors, Object object ) { super.collectNewChildDescriptors ( newChildDescriptors, object ); newChildDescriptors.add ( createChildParameter ( ProfilePackage.Literals.PROFILE__START, ProfileFactory.eINSTANCE.createStartBundle () ) ); newChildDescriptors.add ( createChildParameter ( ProfilePackage.Literals.PROFILE__SETBSL, ProfileFactory.eINSTANCE.createBundleStartLevel () ) ); newChildDescriptors.add ( createChildParameter ( ProfilePackage.Literals.PROFILE__PROPERTY, ProfileFactory.eINSTANCE.createSystemProperty () ) ); newChildDescriptors.add ( createChildParameter ( ProfilePackage.Literals.PROFILE__PROFILE, ProfileFactory.eINSTANCE.createSubProfile () ) ); }