/** * {@inheritDoc} */ public boolean select( Viewer viewer, Object parentElement, Object element ) { if ( element instanceof ObjectClass ) { ObjectClass ocd = ( ObjectClass ) element; Collection<String> lowerCaseIdentifiers = SchemaUtils.getLowerCaseIdentifiers( ocd ); for ( String s : lowerCaseIdentifiers ) { if ( Strings.toLowerCase( s ).startsWith( Strings.toLowerCase( filterText.getText() ) ) ) { return true; } } } return false; } }
/** * Gets the masked attributes. * * @return the masked attributes */ private Set<String> getMaskedAttributes() { Set<String> maskedAttributes = new HashSet<String>(); String maskedAttributeString = ConnectionCorePlugin.getDefault().getPluginPreferences().getString( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_MASKED_ATTRIBUTES ); String[] splitted = maskedAttributeString.split( "," ); //$NON-NLS-1$ for ( String s : splitted ) { maskedAttributes.add( Strings.toLowerCase( s ) ); } return maskedAttributes; }
/** * Gets a Map containing all the Attribute Value Editors. * * @return * a Map containing all the Attribute Value Editors */ public Map<String, String> getAttributeValueEditorMap() { if ( attributeValueEditorCache == null ) { attributeValueEditorCache = new HashMap<String, String>(); AttributeValueEditorRelation[] relations = getAttributeValueEditorRelations(); for ( int i = 0; i < relations.length; i++ ) { if ( relations[i].getAttributeNumericOidOrType() != null ) { attributeValueEditorCache.put( Strings.toLowerCase( relations[i].getAttributeNumericOidOrType() ), relations[i].getValueEditorClassName() ); } } } return attributeValueEditorCache; }
/** * Gets a Map containing all the Syntax Value Editors. * * @return * a Map containing all the Syntax Value Editors */ public Map<String, String> getSyntaxValueEditorMap() { if ( syntaxValueEditorCache == null ) { syntaxValueEditorCache = new HashMap<String, String>(); SyntaxValueEditorRelation[] relations = getSyntaxValueEditorRelations(); for ( int i = 0; i < relations.length; i++ ) { if ( relations[i].getSyntaxOID() != null ) { syntaxValueEditorCache.put( Strings.toLowerCase( relations[i].getSyntaxOID() ), relations[i] .getValueEditorClassName() ); } } } return syntaxValueEditorCache; }
if ( atd.getOid() != null && attributeValueEditorMap.containsKey( Strings.toLowerCase( atd.getOid() ) ) ) return ( IValueEditor ) class2ValueEditors.get( attributeValueEditorMap.get( Strings.toLowerCase( atd .getOid() ) ) ); for ( String name : names ) if ( attributeValueEditorMap.containsKey( Strings.toLowerCase( name ) ) ) .get( attributeValueEditorMap.get( Strings.toLowerCase( name ) ) ); Map<String, String> syntaxValueEditorMap = BrowserCommonActivator.getDefault().getValueEditorsPreferences() .getSyntaxValueEditorMap(); if ( syntaxNumericOid != null && syntaxValueEditorMap.containsKey( Strings.toLowerCase( syntaxNumericOid ) ) ) .toLowerCase( syntaxNumericOid ) ) );
/** * Sets the User Provided ID as a byte[] * * @param upId The User Provided ID * @param attributeType The asscoiated AttributeType */ public void setUpId( byte[] upId, AttributeType attributeType ) { byte[] trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCase( trimmed ); setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType ); }
/** * Gets the simple normalized form of the LDAP URL: schema, host and port. * * @param url the LDAP URL * * @return the simple normalized form of the LDAP URL */ public static String getSimpleNormalizedUrl( LdapUrl url ) { return url.getScheme() + ( url.getHost() != null ? Strings.toLowerCase( url.getHost() ) : "" ) + ":" + url.getPort(); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Sets the User Provided ID as a byte[] * * @param upId The User Provided ID * @param attributeType The asscoiated AttributeType */ public void setUpId( byte[] upId, AttributeType attributeType ) { byte[] trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCase( trimmed ); setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType ); }
/** * Sets the User Provided ID as a byte[] * * @param upId The User Provided ID * @param attributeType The asscoiated AttributeType */ public void setUpId( byte[] upId, AttributeType attributeType ) { byte[] trimmed = Strings.trim( upId ); if ( Strings.isEmpty( trimmed ) && ( attributeType == null ) ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_13235_NULL_ID_WITH_NULL_AT_NOT_ALLOWED ) ); } String newId = Strings.toLowerCase( trimmed ); setUpIdInternal( Strings.utf8ToString( upId ), newId, attributeType ); }
|| Strings.toLowerCase( attributeName ).startsWith( Strings.toLowerCase( rawAttributeDescription ) ) )
if ( maskedAttributes.contains( Strings.toLowerCase( attributeName ) ) )
if ( maskedAttributes.contains( Strings.toLowerCase( attributeDescription ) ) )