Package org.apache.directory.studio.schemaeditor.model.difference

Examples of org.apache.directory.studio.schemaeditor.model.difference.SchemaDifference


     */
    public int compare( Object o1, Object o2 )
    {
        if ( ( o1 instanceof SchemaDifference ) && ( o2 instanceof SchemaDifference ) )
        {
            SchemaDifference sd1 = ( SchemaDifference ) o1;
            SchemaDifference sd2 = ( SchemaDifference ) o2;

            String name1 = ""; //$NON-NLS-1$
            String name2 = ""; //$NON-NLS-1$
            switch ( sd1.getType() )
            {
                case ADDED:
                    name1 = ( ( Schema ) sd1.getDestination() ).getName();
                    break;
                case MODIFIED:
                    name1 = ( ( Schema ) sd1.getDestination() ).getName();
                    break;
                case REMOVED:
                    name1 = ( ( Schema ) sd1.getSource() ).getName();
                    break;
                case IDENTICAL:
                    name1 = ( ( Schema ) sd1.getDestination() ).getName();
                    break;
            }

            switch ( sd2.getType() )
            {
                case ADDED:
                    name2 = ( ( Schema ) sd2.getDestination() ).getName();
                    break;
                case MODIFIED:
                    name2 = ( ( Schema ) sd2.getDestination() ).getName();
                    break;
                case REMOVED:
                    name2 = ( ( Schema ) sd2.getSource() ).getName();
                    break;
                case IDENTICAL:
                    name2 = ( ( Schema ) sd2.getDestination() ).getName();
                    break;
            }

            return name1.compareToIgnoreCase( name2 );
        }
View Full Code Here


        int secondaryLabelAbbreviateMaxLength = store
            .getInt( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );

        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;

            switch ( sd.getType() )
            {
                case ADDED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case MODIFIED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case REMOVED:
                    return ( ( Schema ) sd.getSource() ).getName();
                case IDENTICAL:
                    return ( ( Schema ) sd.getDestination() ).getName();
            }
        }
        else if ( element instanceof AttributeTypeDifference )
        {
            AttributeTypeDifference atd = ( AttributeTypeDifference ) element;
View Full Code Here

     */
    public Image getImage( Object element )
    {
        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;
            switch ( sd.getType() )
            {
                case ADDED:
                    return Activator.getDefault().getImage( PluginConstants.IMG_DIFFERENCE_SCHEMA_ADD );
                case MODIFIED:
                    return Activator.getDefault().getImage( PluginConstants.IMG_DIFFERENCE_SCHEMA_MODIFY );
View Full Code Here

        int secondaryLabelAbbreviateMaxLength = store
            .getInt( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );

        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;

            switch ( sd.getType() )
            {
                case ADDED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case MODIFIED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case REMOVED:
                    return ( ( Schema ) sd.getSource() ).getName();
                case IDENTICAL:
                    return ( ( Schema ) sd.getDestination() ).getName();
            }
        }
        else if ( element instanceof AttributeTypeDifference )
        {
            AttributeTypeDifference atd = ( AttributeTypeDifference ) element;
View Full Code Here

     */
    public Image getImage( Object element )
    {
        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;
            switch ( sd.getType() )
            {
                case ADDED:
                    return Activator.getDefault().getImage( PluginConstants.IMG_DIFFERENCE_SCHEMA_ADD );
                case MODIFIED:
                    return Activator.getDefault().getImage( PluginConstants.IMG_DIFFERENCE_SCHEMA_MODIFY );
View Full Code Here

        int secondaryLabelAbbreviateMaxLength = store
            .getInt( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );

        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;

            switch ( sd.getType() )
            {
                case ADDED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case MODIFIED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case REMOVED:
                    return ( ( Schema ) sd.getSource() ).getName();
                case IDENTICAL:
                    return ( ( Schema ) sd.getDestination() ).getName();
            }
        }
        else if ( element instanceof AttributeTypeDifference )
        {
            AttributeTypeDifference atd = ( AttributeTypeDifference ) element;
View Full Code Here

     */
    public Image getImage( Object element )
    {
        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;
            switch ( sd.getType() )
            {
                case ADDED:
                    return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                        PluginConstants.IMG_DIFFERENCE_SCHEMA_ADD ).createImage();
                case MODIFIED:
View Full Code Here

        int secondaryLabelAbbreviateMaxLength = store
            .getInt( PluginConstants.PREFS_SCHEMA_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );

        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;

            switch ( sd.getType() )
            {
                case ADDED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case MODIFIED:
                    return ( ( Schema ) sd.getDestination() ).getName();
                case REMOVED:
                    return ( ( Schema ) sd.getSource() ).getName();
                case IDENTICAL:
                    return ( ( Schema ) sd.getDestination() ).getName();
            }
        }
        else if ( element instanceof AttributeTypeDifference )
        {
            AttributeTypeDifference atd = ( AttributeTypeDifference ) element;
View Full Code Here

     */
    public Image getImage( Object element )
    {
        if ( element instanceof SchemaDifference )
        {
            SchemaDifference sd = ( SchemaDifference ) element;
            switch ( sd.getType() )
            {
                case ADDED:
                    return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                        PluginConstants.IMG_DIFFERENCE_SCHEMA_ADD ).createImage();
                case MODIFIED:
View Full Code Here

            Collections.sort( children, schemaDifferenceSorter );
        }
        else if ( parentElement instanceof SchemaDifference )
        {
            SchemaDifference difference = ( SchemaDifference ) parentElement;

            if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
            {
                Folder atFolder = new Folder( FolderType.ATTRIBUTE_TYPE );
                atFolder.addAllChildren( difference.getAttributeTypesDifferences() );
                children.add( atFolder );

                Folder ocFolder = new Folder( FolderType.OBJECT_CLASS );
                ocFolder.addAllChildren( difference.getObjectClassesDifferences() );
                children.add( ocFolder );
            }
            else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
            {
                children.addAll( difference.getAttributeTypesDifferences() );
                children.addAll( difference.getObjectClassesDifferences() );

                // Sort by
                if ( sortBy == PluginConstants.PREFS_SCHEMA_VIEW_SORTING_BY_FIRSTNAME )
                {
                    Collections.sort( children, firstNameSorter );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.model.difference.SchemaDifference

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.