public static void removeSystemProperty ( final Profile profile, final String key ) { for ( final Iterator<SystemProperty> i = profile.getProperty ().iterator (); i.hasNext (); ) { final SystemProperty p = i.next (); if ( p.getKey ().equals ( key ) ) { i.remove (); } } }
public static void addSystemProperty ( final Profile profile, final String key, final Object value ) { removeSystemProperty ( profile, key ); // now add final SystemProperty prop = ProfileFactory.eINSTANCE.createSystemProperty (); prop.setKey ( key ); if ( value != null ) { prop.setValue ( "" + value ); } else { // we do set null here since we want to cancel out higher level values prop.setValue ( null ); } profile.getProperty ().add ( prop ); }
protected static void clearNulls ( final Profile profile ) { for ( final Iterator<SystemProperty> i = profile.getProperty ().iterator (); i.hasNext (); ) { final SystemProperty prop = i.next (); if ( prop.getValue () == null ) { i.remove (); } } }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public Object getStyledText ( final Object object ) { final StyledString styledLabel = new StyledString (); styledLabel.append ( getString ( "_UI_SystemProperty_type" ), StyledString.Style.QUALIFIER_STYLER ); //$NON-NLS-1$ if ( ( (SystemProperty)object ).getKey () != null ) { styledLabel.append ( " " ); styledLabel.append ( ( (SystemProperty)object ).getKey () ); } styledLabel.append ( " = ", StyledString.Style.QUALIFIER_STYLER ); //$NON-NLS-1$ if ( ( (SystemProperty)object ).getValue () != null ) { styledLabel.append ( ( (SystemProperty)object ).getValue () ); } return styledLabel; }
public static void addSystemProperty ( final Profile profile, final String key, final Object value ) { removeSystemProperty ( profile, key ); // now add final SystemProperty prop = ProfileFactory.eINSTANCE.createSystemProperty (); prop.setKey ( key ); if ( value != null ) { prop.setValue ( "" + value ); } else { // we do set null here since we want to cancel out higher level values prop.setValue ( null ); } profile.getProperty ().add ( prop ); }
public static void removeSystemProperty ( final Profile profile, final String key ) { for ( final Iterator<SystemProperty> i = profile.getProperty ().iterator (); i.hasNext (); ) { final SystemProperty p = i.next (); if ( p.getKey ().equals ( key ) ) { i.remove (); } } }
protected static void clearNulls ( final Profile profile ) { for ( final Iterator<SystemProperty> i = profile.getProperty ().iterator (); i.hasNext (); ) { final SystemProperty prop = i.next (); if ( prop.getValue () == null ) { i.remove (); } } }
public void process ( final EquinoxApplication app ) { // get profile final Profile profile = Profiles.createOrGetCustomizationProfile ( app ); // add system property final SystemProperty prop = ProfileFactory.eINSTANCE.createSystemProperty (); prop.setKey ( PropertyAuthenticationService.PROP ); prop.setValue ( makeValue ( this.userService.getUsers () ) ); profile.getProperty ().add ( prop ); // add service Profiles.addStartBundle ( profile, "org.eclipse.scada.sec.provider.plain.property" ); }