Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.properties.editor.model;
 
 import java.util.List;
 
 import static java.util.Collections.*;
 import static org.uberfire.commons.validation.PortablePreconditions.checkNotNull;

A Property Editor CDI Event handled by Property Editor. Id event its a parameter to identify the originator of the event. A Property Editor event contains one or multiples PropertyEditorCategory.
public class PropertyEditorEvent {
    public PropertyEditorEventString idEvent,
                                List<PropertyEditorCategoryproperties ) {
        checkNotNull"idEvent"idEvent );
        checkNotNull"properties"properties );
        for (PropertyEditorCategory propertyproperties  ){
            property.setIdEventidEvent );
        }
        this. = properties;
    }
    public PropertyEditorEventString idEvent,PropertyEditorCategory property ) {
        checkNotNull"idEvent"idEvent );
        checkNotNull"property"property );
        property.setIdEventidEvent );
        this..addproperty );
    }

    
Get Properties from a event ordered by priority.

Returns:
Categories and fields ordered by priority, lower values toward the beginning
        return ;
    }
    private static void sortCategoriesAndFieldsByPriorityList<PropertyEditorCategoryproperties ) {
        sortCategoriesByPriorityproperties );
        sortEditorFieldInfoByPriorityproperties );
    }
    private static void sortCategoriesByPriorityList<PropertyEditorCategoryproperties ) {
        sortpropertiesnew Comparator<PropertyEditorCategory>() {
            @Override
            public int comparefinal PropertyEditorCategory o1,
                                final PropertyEditorCategory o2 ) {
                if ( o1.getPriority() < o2.getPriority() ) {
                    return -1;
                } else if ( o1.getPriority() > o2.getPriority() ) {
                    return 1;
                } else {
                    return 0;
                }
            }
        } );
    }
    private static void sortEditorFieldInfoByPriorityList<PropertyEditorCategoryproperties ) {
        for ( PropertyEditorCategory category : properties ) {
            sortcategory.getFields(), new Comparator<PropertyEditorFieldInfo>() {
                @Override
                public int comparefinal PropertyEditorFieldInfo o1,
                                    final PropertyEditorFieldInfo o2 ) {
                    if ( o1.getPriority() < o2.getPriority() ) {
                        return -1;
                    } else if ( o1.getPriority() > o2.getPriority() ) {
                        return 1;
                    } else {
                        return 0;
                    }
                }
            } );
        }
    }
New to GrepCode? Check out our FAQ X