Package org.apache.directory.studio.ldapbrowser.core.model

Examples of org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy


     * {@inheritDoc}
     */
    public ISelection getSelection()
    {
        ISearchResult searchResult = getSelectedSearchResult();
        AttributeHierarchy ah = getSelectedAttributeHierarchy();
        String property = getSelectedProperty();

        List<Object> list = new ArrayList<Object>();
        if ( searchResult != null )
        {
View Full Code Here


                IEntry entry = ( IEntry ) newInput;
                dn = Messages.getString( "EntryEditorWidgetContentProvider.DNLabel" ) + entry.getDn().getUpName(); //$NON-NLS-1$
            }
            else if ( newInput != null && newInput instanceof AttributeHierarchy )
            {
                AttributeHierarchy ah = ( AttributeHierarchy ) newInput;
                dn = Messages.getString( "EntryEditorWidgetContentProvider.DNLabel" ) + ah.getAttribute().getEntry().getDn().getUpName(); //$NON-NLS-1$
            }
            else
            {
                dn = Messages.getString( "EntryEditorWidgetContentProvider.NoEntrySelected" ); //$NON-NLS-1$
                enabled = false;
View Full Code Here

                return values;
            }
        }
        else if ( inputElement != null && inputElement instanceof AttributeHierarchy )
        {
            AttributeHierarchy ah = ( AttributeHierarchy ) inputElement;
            IAttribute[] attributes = ah.getAttributes();
            Object[] values = getValues( attributes );
            return values;
        }
        else
        {
View Full Code Here

        // validate non-modifiable attributes
        AttributeHierarchy[] attributeHierarchies = getSelectedAttributeHierarchies();
        if ( attributeHierarchies.length == 1 )
        {
            AttributeHierarchy attributeHierarchy = attributeHierarchies[0];
            StringBuffer message = new StringBuffer();

            if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 0 )
            {
                // validate if value is allowed
                IEntry entry = attributeHierarchy.getAttribute().getEntry();
                Collection<AttributeType> allAtds = SchemaUtils.getAllAttributeTypeDescriptions( entry );
                AttributeType atd = attributeHierarchy.getAttribute().getAttributeTypeDescription();
                if ( !allAtds.contains( atd ) )
                {
                    message.append( NLS.bind( Messages.getString( "OpenBestEditorAction.AttributeNotInSubSchema" ), //$NON-NLS-1$
                        attributeHierarchy.getAttribute().getDescription() ) );
                    message.append( BrowserCoreConstants.LINE_SEPARATOR );
                    message.append( BrowserCoreConstants.LINE_SEPARATOR );
                }
            }

            if ( attributeHierarchy.size() == 1
                && attributeHierarchy.getAttribute().getValueSize() == 1
                && attributeHierarchy.getAttributeDescription().equalsIgnoreCase(
                    attributeHierarchy.getAttribute().getValues()[0].getAttribute().getDescription() )
                && !attributeHierarchy.getAttribute().getValues()[0].isRdnPart() )
            {
                // validate non-modifiable attributes
                IValue value = attributeHierarchy.getAttribute().getValues()[0];
                if ( !value.isEmpty() && !SchemaUtils.isModifiable( value.getAttribute().getAttributeTypeDescription() ) )
                {
                    message
                        .append( NLS
                            .bind(
View Full Code Here

                IEntry entry = ( IEntry ) newInput;
                dn = Messages.getString( "EntryEditorWidgetContentProvider.DNLabel" ) + entry.getDn().getName(); //$NON-NLS-1$
            }
            else if ( newInput != null && newInput instanceof AttributeHierarchy )
            {
                AttributeHierarchy ah = ( AttributeHierarchy ) newInput;
                dn = Messages.getString( "EntryEditorWidgetContentProvider.DNLabel" ) + ah.getAttribute().getEntry().getDn().getName(); //$NON-NLS-1$
            }
            else
            {
                dn = Messages.getString( "EntryEditorWidgetContentProvider.NoEntrySelected" ); //$NON-NLS-1$
                enabled = false;
View Full Code Here

                return values;
            }
        }
        else if ( inputElement != null && inputElement instanceof AttributeHierarchy )
        {
            AttributeHierarchy ah = ( AttributeHierarchy ) inputElement;
            IAttribute[] attributes = ah.getAttributes();
            Object[] values = getValues( attributes );
            return values;
        }
        else
        {
View Full Code Here

        {
            ISearchResult sr = getSelectedSearchResult();
            String property = ( String ) viewer.getColumnProperties()[getColumn()];
            if ( sr != null && !BrowserUIConstants.DN.equals( property ) )
            {
                AttributeHierarchy ah = sr.getAttributeWithSubtypes( property );

                if ( ah == null )
                {
                    ah = new AttributeHierarchy( sr.getEntry(), property, new IAttribute[]
                        { new Attribute( sr.getEntry(), property ) } );
                }

                return ah;
            }
View Full Code Here

     * {@inheritDoc}
     */
    public ISelection getSelection()
    {
        ISearchResult searchResult = getSelectedSearchResult();
        AttributeHierarchy ah = getSelectedAttributeHierarchy();
        String property = getSelectedProperty();

        List<Object> list = new ArrayList<Object>();
        if ( searchResult != null )
        {
View Full Code Here

            return null;
        }
        else
        {
            IAttribute[] attributes = attributeList.toArray( new IAttribute[attributeList.size()] );
            AttributeHierarchy ah = new AttributeHierarchy( this, attributeDescription, attributes );
            return ah;
        }
    }
View Full Code Here

    {
        if ( event instanceof EmptyValueAddedEvent && !editor.getActionGroup().isEditorActive() )
        {
            EmptyValueAddedEvent evae = ( EmptyValueAddedEvent ) event;
            IAttribute att = evae.getAddedValue().getAttribute();
            AttributeHierarchy ah = cursor.getSelectedAttributeHierarchy();
            if ( ah != null && ah.contains( att ) )
            {
                viewer.setSelection( null, true );
                viewer.getTable().setSelection( new TableItem[0] );
                if ( startEditAction.isEnabled() )
                {
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.