Package org.apache.directory.studio.schemaeditor.view.wrappers

Examples of org.apache.directory.studio.schemaeditor.view.wrappers.Folder


        List<TreeNode> children = schemaWrapper.getChildren();
        if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
        {
            for ( TreeNode child : children )
            {
                Folder folder = ( Folder ) child;
                if ( folder.getType() == FolderType.OBJECT_CLASS )
                {
                    for ( TreeNode folderChild : folder.getChildren() )
                    {
                        ObjectClassWrapper ocw = ( ObjectClassWrapper ) folderChild;
                        if ( ocw.getObjectClass().equals( oc ) )
                        {
                            return ocw;
View Full Code Here


                }
            }
        }
        else if ( element instanceof Folder )
        {
            Folder folder = ( Folder ) element;
            Schema schema = ( ( SchemaWrapper ) folder.getParent() ).getSchema();

            if ( folder.getType().equals( FolderType.ATTRIBUTE_TYPE ) )
            {
                for ( AttributeTypeImpl at : schema.getAttributeTypes() )
                {
                    if ( schemaChecker.hasErrors( at ) )
                    {
                        decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                            PluginConstants.IMG_OVERLAY_ERROR ), IDecoration.BOTTOM_LEFT );
                        return;
                    }

                    if ( schemaChecker.hasWarnings( at ) )
                    {
                        decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                            PluginConstants.IMG_OVERLAY_WARNING ), IDecoration.BOTTOM_LEFT );
                    }
                }
            }
            else if ( folder.getType().equals( FolderType.OBJECT_CLASS ) )
            {
                for ( ObjectClassImpl oc : schema.getObjectClasses() )
                {
                    if ( schemaChecker.hasErrors( oc ) )
                    {
View Full Code Here

                }
            }
        }
        else if ( element instanceof Folder )
        {
            Folder folder = ( Folder ) element;
            if ( columnIndex == 0 )
            {
                return folder.getName() + " (" + folder.getChildren().size() + ")";
            }
            else
            {
                return "";
            }
View Full Code Here

        List<TreeNode> children = schemaWrapper.getChildren();
        if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
        {
            for ( TreeNode child : children )
            {
                Folder folder = ( Folder ) child;
                if ( folder.getType() == FolderType.ATTRIBUTE_TYPE )
                {
                    for ( TreeNode folderChild : folder.getChildren() )
                    {
                        AttributeTypeWrapper atw = ( AttributeTypeWrapper ) folderChild;
                        if ( atw.getAttributeType().equals( at ) )
                        {
                            return atw;
View Full Code Here

        List<TreeNode> children = schemaWrapper.getChildren();
        if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
        {
            for ( TreeNode child : children )
            {
                Folder folder = ( Folder ) child;
                if ( folder.getType() == FolderType.OBJECT_CLASS )
                {
                    for ( TreeNode folderChild : folder.getChildren() )
                    {
                        ObjectClassWrapper ocw = ( ObjectClassWrapper ) folderChild;
                        if ( ocw.getObjectClass().equals( oc ) )
                        {
                            return ocw;
View Full Code Here

            .getSchemaChecker();

        if (schemaChecker != null) {
          List<SchemaError> errors = schemaChecker.getErrors();
          if (!errors.isEmpty()) {
            Folder errorsFolder = new Folder(FolderType.ERROR, root);
            root.addChild(errorsFolder);
            for (SchemaError error : errors) {
              errorsFolder.addChild(new SchemaErrorWrapper(error,
                  errorsFolder));
            }
          }

          List<SchemaWarning> warnings = schemaChecker.getWarnings();
          if (!warnings.isEmpty()) {
            Folder warningsFolder = new Folder(FolderType.WARNING,
                root);
            root.addChild(warningsFolder);
            for (SchemaWarning warning : warnings) {
              warningsFolder.addChild(new SchemaWarningWrapper(
                  warning, warningsFolder));
            }
          }
        }
      }

      children = root.getChildren();
    } else if (parentElement instanceof Folder) {
      Folder folder = (Folder) parentElement;

      children = folder.getChildren();
    } else if (parentElement instanceof SchemaErrorWrapper) {
      children = new ArrayList<TreeNode>();
    } else if (parentElement instanceof SchemaWarningWrapper) {
      children = new ArrayList<TreeNode>();
    }
View Full Code Here

                        SchemaWrapper schemaWrapper = new SchemaWrapper( schema, root );
                        root.addChild( schemaWrapper );

                        if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
                        {
                            Folder atFolder = new Folder( FolderType.ATTRIBUTE_TYPE, schemaWrapper );
                            schemaWrapper.addChild( atFolder );

                            for ( AttributeTypeImpl attributeType : schema.getAttributeTypes() )
                            {
                                atFolder.addChild( new AttributeTypeWrapper( attributeType, atFolder ) );
                            }

                            Folder ocFolder = new Folder( FolderType.OBJECT_CLASS, schemaWrapper );
                            schemaWrapper.addChild( ocFolder );

                            for ( ObjectClassImpl objectClass : schema.getObjectClasses() )
                            {
                                ocFolder.addChild( new ObjectClassWrapper( objectClass, ocFolder ) );
                            }
                        }
                        else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
                        {
                            for ( AttributeTypeImpl attributeType : schema.getAttributeTypes() )
View Full Code Here

                label = label.substring( 0, abbreviateMaxLength ) + "..."; //$NON-NLS-1$
            }
        }
        else if ( element instanceof Folder )
        {
            Folder folder = ( Folder ) element;

            return folder.getName() + " (" + folder.getChildren().size() + ")";
        }

        // Secondary Label
        if ( secondaryLabelDisplay )
        {
View Full Code Here

            return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, PluginConstants.IMG_OBJECT_CLASS )
                .createImage();
        }
        else if ( element instanceof Folder )
        {
            Folder folder = ( Folder ) element;

            switch ( folder.getType() )
            {
                case ATTRIBUTE_TYPE:
                    return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                        PluginConstants.IMG_FOLDER_AT ).createImage();
                case OBJECT_CLASS:
View Full Code Here

                }
            }
        }
        else if ( element instanceof Folder )
        {
            Folder folder = ( Folder ) element;
            if ( columnIndex == 0 )
            {
                return folder.getName() + " (" + folder.getChildren().size() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
            }
            else
            {
                return ""; //$NON-NLS-1$
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.view.wrappers.Folder

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.