@Override public void customize ( final Item item ) { final ValueMapper valueMapper = OsgiFactory.eINSTANCE.createValueMapper (); valueMapper.setDataMapper ( mapper ); valueMapper.setName ( "value.mapper" ); valueMapper.setSourceAttribute ( sourceAttribute ); valueMapper.setTargetAttribute ( targetAttribute ); registerFeature ( item, valueMapper ); } };
@Override public void process ( final MasterHandlerPriorities priorities, final ItemFeatureEntry rawFeature, final OscarContext context ) { final ValueMapper feature = (ValueMapper)rawFeature; final String configurationId = Features.configurationItem ( feature ); final Map<String, String> data = new HashMap<String, String> (); data.put ( "mapper.id", feature.getDataMapper ().getName () ); //$NON-NLS-1$ if ( feature.getSourceAttribute () != null && !feature.getSourceAttribute ().isEmpty () ) { data.put ( "sourceAttributeName", feature.getSourceAttribute () ); //$NON-NLS-1$ } if ( feature.getTargetAttribute () != null && !feature.getTargetAttribute ().isEmpty () ) { data.put ( "targetAttributeName", feature.getTargetAttribute () ); //$NON-NLS-1$ } final int priority = priorities.findPriority ( Factories.FACTORY_MASTER_HANDLER_VALUE_MAPPER, configurationId ); Items.fillForMasterHandler ( data, feature.getItem (), priority, false ); context.addData ( Factories.FACTORY_MASTER_HANDLER_VALUE_MAPPER, configurationId, data ); } }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getStyledText ( Object object ) { String label = ( (ValueMapper)object ).getName (); StyledString styledLabel = new StyledString (); if ( label == null || label.length () == 0 ) { styledLabel.append ( getString ( "_UI_ValueMapper_type" ), StyledString.Style.QUALIFIER_STYLER ); //$NON-NLS-1$ } else { styledLabel.append ( getString ( "_UI_ValueMapper_type" ), StyledString.Style.QUALIFIER_STYLER ).append ( " " + label ); //$NON-NLS-1$ //$NON-NLS-2$ } return styledLabel; }
@Override public void process ( final MasterHandlerPriorities priorities, final ItemFeatureEntry rawFeature, final OscarContext context ) { final ValueMapper feature = (ValueMapper)rawFeature; final String configurationId = Features.configurationItem ( feature ); final Map<String, String> data = new HashMap<String, String> (); data.put ( "mapper.id", feature.getDataMapper ().getName () ); //$NON-NLS-1$ if ( feature.getSourceAttribute () != null && !feature.getSourceAttribute ().isEmpty () ) { data.put ( "sourceAttributeName", feature.getSourceAttribute () ); //$NON-NLS-1$ } if ( feature.getTargetAttribute () != null && !feature.getTargetAttribute ().isEmpty () ) { data.put ( "targetAttributeName", feature.getTargetAttribute () ); //$NON-NLS-1$ } final int priority = priorities.findPriority ( Factories.FACTORY_MASTER_HANDLER_VALUE_MAPPER, configurationId ); Items.fillForMasterHandler ( data, feature.getItem (), priority, false ); context.addData ( Factories.FACTORY_MASTER_HANDLER_VALUE_MAPPER, configurationId, data ); } }
@Override public void customize ( final Item item ) { final ValueMapper valueMapper = OsgiFactory.eINSTANCE.createValueMapper (); valueMapper.setDataMapper ( mapper ); valueMapper.setName ( "value.mapper" ); valueMapper.setSourceAttribute ( sourceAttribute ); valueMapper.setTargetAttribute ( targetAttribute ); registerFeature ( item, valueMapper ); } };