text:
using System;
using System.Data;
using System.Data.Linq.Mapping;
using System.Diagnostics;
using System.Reflection;
using DbLinq.Data.Linq;
using DbLinq.Vendor;

namespace nwind
{
    partial class Northwind
    {
        public Table<NoStorageCategory> NoStorageCategories { get { return GetTable<NoStorageCategory>(); }}
    }

    /* partial class Employee
    {
        [Column(Storage = "_employeeID", Name = "EmployeeID", DbType = "serial", IsDbGenerated = false)]
        public string Identifier
        {
            get { return this._employeeID.ToString(); }
            set {}
        }
    } */

    [Table(Name = "public.\"Categories\"")]
    public partial class NoStorageCategory
    {
        public bool propertyInvoked_CategoryName = false;
        public bool propertyInvoked_Description = false;

        // Tests the "Storage" without a setter for the property.
        private int _categoryID;
        [Column(Storage = "_categoryID", Name = "\"CategoryID\"", DbType = "integer(32,0)", IsPrimaryKey = true, IsDbGenerated = true, CanBeNull = false, Expression = "nextval('\"Categories_CategoryID_seq\"')")]
        public int CategoryID {
            get { return _categoryID; }
        }

        // No "Storage" attribute, this should go through the property.
        private string _categoryName;
        [Column(Name = "\"CategoryName\"", DbType = "character varying(15)", CanBeNull = false)]
        public string CategoryName {
            get { return _categoryName; }
            set {
                if (value != _categoryName)
                {
                    _categoryName = value;
                }
                propertyInvoked_CategoryName = true;
            }
        }

        // "Storage" and property, should set the field directly.
        private string _description;
        [DebuggerNonUserCode]
        [Column(Storage = "_description", Name = "\"Description\"", DbType = "text")]
        public string Description {
            get { return _description; }
            set
            {
                if (value != _description)
                {
                    _description = value;
                }
                propertyInvoked_Description = true;
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">

    <simple-method method-name="movePortletToPortalPage" short-description="Moves a PortalPortlet from the actual portalPage to a different one">
        <call-simple-method method-name="checkOwnerShip"/>
        <entity-one entity-name="PortalPagePortlet" value-field="oldEntity"/>
        <set field="parameters.portalPageId" from-field="parameters.newPortalPageId"/>
        <call-simple-method method-name="copyIfRequiredSystemPage" xml-resource="component://common/minilang/PortalPageMethods.xml"/>
        <set field="parameters.newPortalPageId" from-field="portalPageId"/>
        <make-value entity-name="PortalPagePortlet" value-field="newEntity"/>
        <set field="newEntity.portalPortletId" from-field="parameters.portalPortletId"/>
        <set field="newEntity.portalPageId" from-field="parameters.newPortalPageId"/>
        <set field="newEntity.columnNum" value="1"/>
        <make-next-seq-id value-field="newEntity" seq-field-name="portletSeqId"/>
        <create-value value-field="newEntity"/>
        <remove-value value-field="oldEntity"/>
    </simple-method>

    <simple-method method-name="addPortalPageColumn" short-description="Add a new Column to a PortalPage">
        <call-simple-method method-name="checkOwnerShip"/>
        <make-value entity-name="PortalPageColumn" value-field="newEntity"/>
        <set-pk-fields map="parameters" value-field="newEntity"/>
        <if-empty field="parameters.columnSeqId">
            <make-next-seq-id value-field="newEntity" seq-field-name="columnSeqId"/>
        </if-empty>
        <field-to-result field="newEntity.columnSeqId" result-name="columnSeqId"/>
        <set-nonpk-fields map="parameters" value-field="newEntity"/>
        <create-value value-field="newEntity"/>
    </simple-method>

    <simple-method method-name="deletePortalPageColumn" short-description="Delete a Column from a PortalPage">
        <call-simple-method method-name="checkOwnerShip"/>
        <entity-one entity-name="PortalPageColumn" value-field="column" auto-field-map="true"/>
        <if-not-empty field="column">
            <entity-and entity-name="PortalPagePortlet" list="portalPortletList">
                <field-map field-name="portalPageId" from-field="column.portalPageId"/>
                <field-map field-name="columnSeqId"  from-field="column.columnSeqId"/>
            </entity-and>
            <iterate list="portalPortletList" entry="portalPortlet">
                <set-service-fields service-name="deletePortalPagePortlet" map="portalPortlet" to-map="deletePortalPagePortletInMap"/>
                <call-service service-name="deletePortalPagePortlet" in-map-name="deletePortalPagePortletInMap"/>
            </iterate>
            <remove-value value-field="column"/>
        </if-not-empty>
        <check-errors/>
    </simple-method>

    <simple-method method-name="createPortalPagePortlet" short-description="Add a registered PortalPortlet to a PortalPage">
        <call-simple-method method-name="checkOwnerShip"/>
        <make-value entity-name="PortalPagePortlet" value-field="newEntity"/>
        <set-pk-fields map="parameters" value-field="newEntity"/>

        <entity-condition entity-name="PortalPagePortlet" list="portlets">
            <condition-expr field-name="portalPageId" operator="equals" from-field="parameters.portalPageId"/>
            <select-field field-name="sequenceNum"/>
            <order-by field-name="-sequenceNum"/>
            <limit-range size="1" start="0"/>
        </entity-condition>
        <first-from-list list="portlets" entry="portalPagePortlet"/>

        <if-empty field="portalPagePortlet.sequenceNum">
            <calculate field="newEntity.sequenceNum" type="Long"><number value="1"/></calculate>
            <else>
                <calculate field="newEntity.sequenceNum" type="Long">
                    <calcop operator="add" field="portalPagePortlet.sequenceNum">
                        <number value="1"/>
                    </calcop>
                </calculate>
            </else>
        </if-empty>

        <make-next-seq-id value-field="newEntity" seq-field-name="portletSeqId"/>
        <field-to-result field="newEntity.portletSeqId" result-name="portletSeqId"/>
        <set-nonpk-fields map="parameters" value-field="newEntity"/>
        <create-value value-field="newEntity"/>
    </simple-method>

    <simple-method method-name="deletePortalPagePortlet" short-description="Delete a PortalPortlet from a PortalPageColumn">
        <call-simple-method method-name="checkOwnerShip"/>
        <entity-one entity-name="PortalPagePortlet" value-field="portlet" auto-field-map="true"/>
        <if-not-empty field="portlet">
            <make-value entity-name="PortletAttribute" value-field="newEntity"/>
            <set field="newEntity.portalPageId" from-field="portlet.portalPageId"/>
            <set field="newEntity.portalPortletId" from-field="portlet.portalPortletId"/>
            <set field="newEntity.portletSeqId" from-field="portlet.portletSeqId"/>
            <remove-by-and entity-name="PortletAttribute" map="newEntity"/>
            <remove-value value-field="portlet"/>
        </if-not-empty>
    </simple-method>

    <simple-method method-name="getPortletAttributes" short-description="Get all attributes of a Portlet either by providing userLogin or portalPageid with portalPortletId" login-required="true">
        <if-empty field="parameters.ownerUserLoginId">
            <if-empty field="parameters.portalPageId">
                <log level="error" message="Service getPortletAttributes did not receive either ownerUserLoginId OR portalPageId"></log>
                <string-to-list string="Service getPortletAttributes did not receive either ownerUserLoginId OR portalPageId" list="error_list"/>
            </if-empty>
        </if-empty>
        <check-errors/>
        <!-- if userLogin provided get the portalPageId with the required portlet -->
        <if-not-empty field="parameters.ownerUserLoginId">
            <entity-and entity-name="PortalPageAndPortlet" list="ppList">
                <field-map field-name="ownerUserLoginId" from-field="parameters.ownerUserLoginId"/>
                <field-map field-name="portalPortletId"  from-field="parameters.portalPortletId"/>
            </entity-and>
            <first-from-list list="ppList" entry="portalPage"/>
            <set field="parameters.portalPageId" from-field="portalPage.portalPageId"/>
        </if-not-empty>
        <entity-condition entity-name="PortletAttribute" list="attributeList">
            <condition-list combine="and">
                <condition-expr field-name="portalPageId" operator="equals" from-field="parameters.portalPageId"/>
                <condition-expr field-name="portalPortletId" operator="equals" from-field="parameters.portalPortletId"/>
                <condition-expr field-name="portletSeqId" operator="equals" from-field="parameters.portletSeqId" ignore-if-empty="true"/>
            </condition-list>
        </entity-condition>
        <if-not-empty field="attributeList">
            <iterate list="attributeList" entry="attributeRecord">
                <set field="attributeMap.${attributeRecord.attrName}" from-field="attributeRecord.attrValue"/>
            </iterate>
            <field-to-result field="attributeMap" result-name="attributeMap"/>
        </if-not-empty>
    </simple-method>

    <simple-method method-name="createPortalPage" short-description="Create a new Portal Page">
        <if-not-empty field="parameters.portalPageName">
            <make-value entity-name="PortalPage" value-field="newPortalPage"/>
            <set-pk-fields map="parameters" value-field="newPortalPage"/>
            <if-empty field="newPortalPage.portalPageId">
                <sequenced-id sequence-name="PortalPage" field="newPortalPage.portalPageId"/>
            </if-empty>
            <set-nonpk-fields map="parameters" value-field="newPortalPage"/>
            <set field="newPortalPage.ownerUserLoginId" from-field="parameters.userLogin.userLoginId"/>
            <if-empty field="parameters.sequenceNum">
                <make-next-seq-id value-field="newPortalPage" seq-field-name="sequenceNum"/>
            </if-empty>
            <create-value value-field="newPortalPage"/>
            <field-to-result field="newPortalPage.portalPageId" result-name="portalPageId"/>
        </if-not-empty>
    </simple-method>

    <simple-method method-name="deletePortalPage" short-description="Delete a Portal Page">
        <entity-one entity-name="PortalPage" value-field="getPortalPage"/>
        <if-not-empty field="getPortalPage.originalPortalPageId">
            <entity-one entity-name="PortalPage" value-field="getOldSequenceNum">
                <field-map field-name="portalPageId" from-field="getPortalPage.originalPortalPageId"/>
            </entity-one>
            <entity-condition entity-name="PortalPage" list="checkSequenceNums">
                <condition-list combine="and">
                    <condition-expr field-name="sequenceNum" operator="equals" from-field="getOldSequenceNum.sequenceNum"/>
                    <condition-expr field-name="ownerUserLoginId" operator="equals" from-field="userLogin.userLoginId"/>
                    <condition-expr field-name="parentPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                </condition-list>
            </entity-condition>
            <first-from-list list="checkSequenceNums" entry="checkSequenceNum"/>
            <if-not-empty field="checkSequenceNum.portalPageId">
                <set field="first.portalPageId" from-field="checkSequenceNum.portalPageId"/>
                <set field="first.sequenceNum" from-field="getPortalPage.sequenceNum" type="Long"/>
                <call-service service-name="updatePortalPage" in-map-name="first"/>
            </if-not-empty>
        </if-not-empty>
        <call-simple-method method-name="checkOwnerShip"/>
        <remove-related value-field="portalPage" relation-name="PortalPageColumn"/>
        <remove-related value-field="portalPage" relation-name="PortalPagePortlet"/>
        <remove-value value-field="portalPage"/>
    </simple-method>

    <simple-method method-name="checkOwnerShip" short-description="Check the ownership of a Portal Page">
        <if-not-empty field="parameters.portalPageId">
            <entity-one entity-name="PortalPage" value-field="portalPage"/>
            <if-empty field="portalPage">
                <add-error>
                    <fail-property resource="CommonUiLabels" property="PortalPageNotFound"/>
                </add-error>
            </if-empty>
            <check-errors/>
            <if> <!-- only page owner or user with MYPORTALBASE_ADMIN can modify the page detail -->
              <condition>
                <and>
                  <if-compare field="portalPage.ownerUserLoginId" operator="not-equals" value="${parameters.userLogin.userLoginId}"/>
                  <not>
                       <if-has-permission permission="MYPORTALBASE" action="_ADMIN"/>
                  </not>
                </and>
              </condition>
              <then>
                <add-error>
                    <fail-property resource="CommonUiLabels" property="PortalPageNotOwned"/>
                </add-error>
              </then>
            </if>
            <check-errors/>
        </if-not-empty>
    </simple-method>
    <simple-method method-name="updatePortalPageSeq" short-description="Update the portal page sequence numbers">
        <call-simple-method method-name="checkOwnerShip"/>
        <entity-one entity-name="PortalPage" value-field="getSequenceNum"/>
        <if-compare field="parameters.mode" value="UP" operator="equals">
            <entity-condition entity-name="PortalPage" list="getDatas">
                <condition-list combine="and">
                    <condition-expr field-name="sequenceNum" operator="less" from-field="getSequenceNum.sequenceNum"/>
                    <condition-expr field-name="ownerUserLoginId" operator="equals" from-field="userLogin.userLoginId"/>
                    <condition-list combine="or">
                        <condition-expr field-name="parentPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                        <condition-expr field-name="originalPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                    </condition-list>
                </condition-list>
                <order-by field-name="-sequenceNum"/>
            </entity-condition>
        </if-compare>
        <if-compare field="parameters.mode" value="DWN" operator="equals">
            <entity-condition entity-name="PortalPage" list="getDatas">
                <condition-list combine="and">
                    <condition-expr field-name="sequenceNum" operator="greater" from-field="getSequenceNum.sequenceNum"/>
                    <condition-expr field-name="ownerUserLoginId" operator="equals" from-field="userLogin.userLoginId"/>
                    <condition-list combine="or">
                        <condition-expr field-name="parentPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                        <condition-expr field-name="originalPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                    </condition-list>
                </condition-list>
                <order-by field-name="sequenceNum"/>
            </entity-condition>
        </if-compare>
        <if-compare field="parameters.mode" value="TOP" operator="equals">
            <entity-condition entity-name="PortalPage" list="getDatas">
                <condition-list combine="and">
                    <condition-expr field-name="sequenceNum" operator="less" from-field="getSequenceNum.sequenceNum"/>
                    <condition-expr field-name="ownerUserLoginId" operator="equals" from-field="userLogin.userLoginId"/>
                    <condition-list combine="or">
                        <condition-expr field-name="parentPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                        <condition-expr field-name="originalPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                    </condition-list>
                </condition-list>
                <order-by field-name="sequenceNum"/>
            </entity-condition>
        </if-compare>
        <if-compare field="parameters.mode" value="BOT" operator="equals">
            <entity-condition entity-name="PortalPage" list="getDatas">
                <condition-list combine="and">
                    <condition-expr field-name="sequenceNum" operator="greater" from-field="getSequenceNum.sequenceNum"/>
                    <condition-expr field-name="ownerUserLoginId" operator="equals" from-field="userLogin.userLoginId"/>
                    <condition-list combine="or">
                        <condition-expr field-name="parentPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                        <condition-expr field-name="originalPortalPageId" operator="equals" from-field="parameters.parentPortalPageId"/>
                    </condition-list>
                </condition-list>
                <order-by field-name="-sequenceNum"/>
            </entity-condition>
        </if-compare>
        <first-from-list list="getDatas" entry="getData"/>
        <set field="portalPage.sequenceNum" from-field="getData.sequenceNum" type="Long"/>
        <store-value value-field="portalPage"/>
        <set field="first.portalPageId" from-field="getData.portalPageId"/>
        <set field="first.sequenceNum" from-field="getSequenceNum.sequenceNum" type="Long"/>
        <call-service service-name="updatePortalPage" in-map-name="first"/>
    </simple-method>

    <!-- update Portlet Seq with Drag & Drop -->
    <simple-method method-name="updatePortletSeqDragDrop" short-description="Updates a portlet Seq No for the Drag and Drop Feature">
        <set field="parameters.portalPageId" from-field="parameters.o_portalPageId"/>
        <call-simple-method method-name="checkOwnerShip"/>

        <!-- origin Portlet -->
        <entity-one entity-name="PortalPagePortlet" value-field="originPp">
            <field-map field-name="portalPageId" from-field="parameters.o_portalPageId"/>
            <field-map field-name="portalPortletId" from-field="parameters.o_portalPortletId"/>
            <field-map field-name="portletSeqId" from-field="parameters.o_portletSeqId"/>
        </entity-one>
        <if-empty field="originPp">
            <return response-code="error"/>
        </if-empty>
        <set field="columnSeqId" from-field="parameters.destinationColumn" default-value="${originPp.columnSeqId}"/>

        <!-- destination Portlet -->
        <if-compare field="parameters.mode" operator="contains" value="DRAGDROPBEFORE">
            <entity-one value-field="destiPp" entity-name="PortalPagePortlet">
                <field-map field-name="portalPageId" from-field="parameters.d_portalPageId"/>
                <field-map field-name="portalPortletId" from-field="parameters.d_portalPortletId"/>
                <field-map field-name="portletSeqId" from-field="parameters.d_portletSeqId"/>
            </entity-one>

            <entity-condition entity-name="PortalPagePortlet" list="modifyPpList">
             <condition-list combine="and">
                <condition-expr field-name="portalPageId" operator="equals" from-field="parameters.portalPageId"/>
                <condition-expr field-name="columnSeqId" operator="equals" from-field="columnSeqId"/>
                <condition-expr field-name="sequenceNum" operator="greater-equals" from-field="destiPp.sequenceNum"/>
                <condition-expr field-name="sequenceNum" operator="less" from-field="originPp.sequenceNum" ignore-if-empty="true"/>
             </condition-list>
             <order-by field-name="sequenceNum"/>
            </entity-condition>
            <set field="increase" value="1" type="Long"/>
            <set field="newSequenceNo" from-field="destiPp.sequenceNum"/>
        </if-compare>

        <if-compare field="parameters.mode" operator="equals" value="DRAGDROPAFTER">
            <entity-one value-field="destiPp" entity-name="PortalPagePortlet">
                <field-map field-name="portalPageId" from-field="parameters.d_portalPageId"/>
                <field-map field-name="portalPortletId" from-field="parameters.d_portalPortletId"/>
                <field-map field-name="portletSeqId" from-field="parameters.d_portletSeqId"/>
            </entity-one>

            <entity-condition entity-name="PortalPagePortlet" list="modifyPpList">
             <condition-list combine="and">
                <condition-expr field-name="portalPageId" operator="equals" from-field="parameters.portalPageId"/>
                <condition-expr field-name="columnSeqId" operator="equals" from-field="columnSeqId"/>
                <condition-expr field-name="sequenceNum" operator="greater" from-field="originPp.sequenceNum"/>
                <condition-expr field-name="sequenceNum" operator="less-equals" from-field="destiPp.sequenceNum" ignore-if-empty="true"/>
             </condition-list>
             <order-by field-name="-sequenceNum"/>
            </entity-condition>
            <set field="increase" value="-1" type="Long"/>
            <set field="newSequenceNo" from-field="destiPp.sequenceNum"/>
        </if-compare>

        <if-compare field="parameters.mode" operator="contains" value="NEW">
            <set field="newSequenceNo" value="0"/>
        </if-compare>

        <!-- Modify the sequence id from the following portlets -->
        <if-not-empty field="modifyPpList">
            <iterate list="modifyPpList" entry="modifyPp">
                <if-empty field="modifyPp.sequenceNum">
                    <set field="modifyPp.sequenceNum" value="newSequenceNo"/>
                    <else>
                        <calculate field="modifyPp.sequenceNum" type="Long">
                            <calcop operator="add" field="newSequenceNo">
                                <calcop operator="get" field="increase"/>
                            </calcop>
                        </calculate>
                        <calculate field="increase" type="Long">
                            <calcop operator="add" field="increase">
                                <calcop operator="get" field="increase"/>
                            </calcop>
                        </calculate>
                    </else>
                </if-empty>
                <store-value value-field="modifyPp"/>
            </iterate>
        </if-not-empty>
        <!-- Create a new db entry for the moved portlet -->
        <set field="originPp.columnSeqId" from-field="columnSeqId"/>
        <set field="originPp.sequenceNum" from-field="newSequenceNo" type="Long"/>
        <store-value value-field="originPp"/>
    </simple-method>
    <!--  -->
</simple-methods>

redpajama_set_name: RedPajamaGithub


text:
extern id<CLJISeq> CLJCreateSeq(id coll);

/// Returns a new sequence where x is the first element and seq is the rest.
extern id<CLJISeq> CLJCons(id x, id<CLJISeq> seq);

/// Returns the first item in the collection.
///
/// Internally, the collection will be converted to a seq.  Returns nil if the collection is empty.
extern id CLJFirst(id coll);

/// Returns the second item in the collection.
///
/// Functionally equivalent to
///
///		CLJFirst(CLJNext(coll))
///
/// Returns nil if the collection contains only one element.
extern id CLJSecond(id coll);

/// Returns the first item of the first item of a nested collection.
///
/// Functionally equivalent to
///
///		CLJFirst(CLJFirst(coll))
///
/// Returns nil if the collection is empty.
extern id CLJFFirst(id coll);

/// Returns the tail of the first item of a nested collection.
///
/// Functionally equivalent to
///
///		CLJNext(CLJFirst(coll))
///
/// Returns nil if the collection is empty.
extern id CLJNFirst(id coll);

/// Returns the tail of the tail of a nested collection.
///
/// Functionally equivalent to
///
///		CLJNext(CLJNext(coll))
///
/// Returns nil if the collection is empty.
extern id CLJNNext(id coll);

/// Returns the second item in the collection.  Alias for CLJSecond().
///
/// Functionally equivalent to
///
///		CLJFirst(CLJNext(coll))
///
/// Returns nil if the collection contains only one element.
id (* const CLJFNext)(id coll);

/// Returns the last item in a collection.
///
/// For Persistent Structure types, this function runs in linear time.
extern id CLJLast(id coll);

/// Returns a sequence of all but the last item in a collection.
///
/// For Persistent Structure types, this function runs in linear time.
extern id<CLJISeq> CLJButLast(id coll);

/// Creates and returns a new vector containing the objects in the provided collection.
extern id<CLJIPersistentVector, CLJIEditableCollection> CLJCreateVector(id coll);

/// Creates and returns a new hash map with the provided mappings.  If any keys are equal, they are
/// handled as if by repeated uses of CLJAssoc().
extern id<CLJIPersistentMap, CLJIEditableCollection> CLJCreateHashMap(id coll);

/// Creates and returns a new hash set with the provided keys.  If any keys are equal, they are
/// handled as if by repeated uses of CLJConj().
extern id<CLJIPersistentSet, CLJIEditableCollection> CLJCreateHashSet(id coll);

extern id<CLJIPersistentCollection> CLJCreateList(id restrict fst, ...);

//extern id<CLJIPersistentSet> CLJCreateSortedMap(id coll);
extern id<CLJISet> CLJCreateSet(id coll);

extern id<CLJITransientCollection> CLJCreateTransient(id<CLJIEditableCollection> coll);

/// Returns the number of items in the collection.
///
/// Also works on strings, arrays, and Objective-C collections.
extern NSUInteger CLJCount(id coll);

/// Returns the value at a given index.
///
/// If the index is out of bounds, then this function throws an exception and returns nil.
extern id CLJOverloadable CLJObjectAtIndex(id coll, NSUInteger index);

/// Returns the value at a given index, returning the provided not found value if no item is found
/// at that index.
extern id CLJOverloadable CLJObjectAtIndex(id coll, NSUInteger index, id notFound);

/// Returns YES if the provided collection implements CLJISeq.
extern BOOL CLJIsSeq(id coll);

/// Returns YES if the provided collection implements CLJIPersistentMap.
extern BOOL CLJIsMap(id coll);

/// Returns YES if the provided collection implements CLJIPersistentVector.
extern BOOL CLJIsVec(id coll);

/// Returns YES if the given key is present in the collection, otherwise NO.
///
/// For Persistent Structure types, this function operates in constant or logarithmic time.
extern BOOL CLJContains(id coll, id key);

/// Returns a seq of the items after the first.
extern id<CLJISeq> CLJNext(id coll);

/// Returns a possibly empty seq of the items after the first.
extern id<CLJISeq> CLJRest(id coll);

/// Conj[oin].  Returns a new collection with the xs 'added'.  Conjoining any item to a nil
/// collection returns a new persistent list containing only that item.
///
/// Additoin of an item may happen at different 'places' depending on the concrete type of the
/// collection.
extern id<CLJIPersistentCollection> CLJOverloadable CLJConj(id<CLJIPersistentCollection> coll, id x);
extern id<CLJIPersistentCollection> CLJOverloadable CLJConj(id<CLJIPersistentCollection> coll, id restrict xs, ...) NS_REQUIRES_NIL_TERMINATION;

/// Assoc[iate].  When applied to a map, returns a new map of the same (hashed/sorted) type that
/// contains the mapping of keys(s)to value(s).  When applied to a vector, returns a new vector that
/// contains the val at the specified index.
///
/// Note that the index must be less than or equal to the count of the vector.
extern id<CLJIPersistentCollection> CLJOverloadable CLJAssoc(id<CLJIPersistentCollection> coll, id key, id val);
extern id<CLJIPersistentCollection> CLJOverloadable CLJAssoc(id<CLJIPersistentCollection> coll, id restrict ks, id restrict vs, ...) NS_REQUIRES_NIL_TERMINATION;

/// Disj[oin]. Returns a new set of the same (hashed/sorted) type, that does not contain the given
/// keys.
extern id<CLJISet> CLJDisj(id<CLJISet> fromSet, id restrict vals, ...) NS_REQUIRES_NIL_TERMINATION;

/// Returns the metadata of the provided object or collection.  If there is no metadata associated
/// with the object, returns nil.
extern id<CLJIPersistentMap> CLJMetadata(id obj);

/// Returns an object of the same type and value as the provided object, but with the provided map
/// as its metadata.
extern id<CLJIObj> CLJWithMetadata(id<CLJIObj> obj, id<CLJIPersistentMap> m);

extern id<CLJISeq> CLJReduce1(CLJIReduceBlock reducer, id coll);
extern id<CLJISeq> CLJReduce(CLJIReduceBlock reducer, id coll, id val);

extern id<CLJISeq> CLJReduce1f(CLJIReduceFunction reducer, id coll);
extern id<CLJISeq> CLJReducef(CLJIReduceFunction reducer, id coll, id val);

#pragma mark - TBD

//extern id<CLJISeq> CLJCreateLazySeq(id restrict fst, ...);


text:
<?php

namespace Apihour\ContractorBundle\Entity;
use Doctrine\ORM\Mapping\Entity;

/**
 * Class Buyer
 * @package Apihour\ContractorBundle\Entity
 *
 * @Entity()
 */
class Buyer extends AbstractContractor {
    /**
     * @return string
     */
    public function getAliasName() {
        return 'buyer';
    }
}


text:
.. _notes-chapter:

===========
Other Notes
===========

Questions
=========

Troubleshooter Add-on
---------------------

When asking a question, users are prompted to install an addon that will return
extra information to SUMO from about:support. This is opt-in, and considered
generally non-sensitive data, but is not revelaed to all sites because of
fingerprinting concerns.

This add-on only provides data to white listed domains. The built in whitelist
is:

- https://support.mozilla.org/
- https://support.allizom.org/
- https://support-dev.allizom.org/
- http://localhost:8000/

Note that the protocol and port are significant. If you try and run the site on
http://localhost:8900/, the add-on will not provide any data.

The source of the addon is `on GitHub`_, and it is hosted `on
AMO`_. The add-on is hosted on AMO instead of SUMO so that AMO will do
the heavy lifting of providing automatic updates.

.. _on Github: https://github.com/0c0w3/troubleshooter
.. _on AMO: https://addons.mozilla.org/en-US/firefox/addon/troubleshooter/


text:
#include "config.h"
#include "core/css/CSSKeyframeRule.h"

#include "bindings/core/v8/ExceptionState.h"
#include "core/css/CSSKeyframesRule.h"
#include "core/css/PropertySetCSSStyleDeclaration.h"
#include "core/css/StylePropertySet.h"
#include "core/css/parser/CSSParser.h"
#include "core/dom/ExceptionCode.h"
#include "core/frame/UseCounter.h"
#include "wtf/text/StringBuilder.h"

namespace blink {

StyleKeyframe::StyleKeyframe()
{
}

StyleKeyframe::~StyleKeyframe()
{
}

String StyleKeyframe::keyText() const
{
    ASSERT(!m_keys.isEmpty());

    StringBuilder keyText;
    for (unsigned i = 0; i < m_keys.size(); ++i) {
        if (i)
            keyText.append(',');
        keyText.appendNumber(m_keys.at(i) * 100);
        keyText.append('%');
    }

    return keyText.toString();
}

bool StyleKeyframe::setKeyText(const String& keyText)
{
    ASSERT(!keyText.isNull());

    OwnPtr<Vector<double> > keys = CSSParser::parseKeyframeKeyList(keyText);
    if (keys->isEmpty())
        return false;

    m_keys = *keys;
    return true;
}

const Vector<double>& StyleKeyframe::keys() const
{
    return m_keys;
}

void StyleKeyframe::setKeys(PassOwnPtr<Vector<double> > keys)
{
    ASSERT(keys && !keys->isEmpty());
    m_keys = *keys;
}

MutableStylePropertySet& StyleKeyframe::mutableProperties()
{
    if (!m_properties->isMutable())
        m_properties = m_properties->mutableCopy();
    return *toMutableStylePropertySet(m_properties.get());
}

void StyleKeyframe::setProperties(PassRefPtrWillBeRawPtr<StylePropertySet> properties)
{
    ASSERT(properties);
    m_properties = properties;
}

String StyleKeyframe::cssText() const
{
    StringBuilder result;
    result.append(keyText());
    result.appendLiteral(" { ");
    String decls = m_properties->asText();
    result.append(decls);
    if (!decls.isEmpty())
        result.append(' ');
    result.append('}');
    return result.toString();
}

PassOwnPtr<Vector<double> > StyleKeyframe::createKeyList(CSSParserValueList* keys)
{
    size_t numKeys = keys ? keys->size() : 0;
    OwnPtr<Vector<double> > keyVector = adoptPtr(new Vector<double>(numKeys));
    for (size_t i = 0; i < numKeys; ++i) {
        ASSERT(keys->valueAt(i)->unit == blink::CSSPrimitiveValue::CSS_NUMBER);
        double key = keys->valueAt(i)->fValue;
        if (key < 0 || key > 100) {
            // As per http://www.w3.org/TR/css3-animations/#keyframes,
            // "If a keyframe selector specifies negative percentage values
            // or values higher than 100%, then the keyframe will be ignored."
            keyVector->clear();
            break;
        }
        keyVector->at(i) = key / 100;
    }
    return keyVector.release();
}

void StyleKeyframe::trace(Visitor* visitor)
{
    visitor->trace(m_properties);
}

CSSKeyframeRule::CSSKeyframeRule(StyleKeyframe* keyframe, CSSKeyframesRule* parent)
    : CSSRule(0)
    , m_keyframe(keyframe)
{
    setParentRule(parent);
}

CSSKeyframeRule::~CSSKeyframeRule()
{
#if !ENABLE(OILPAN)
    if (m_propertiesCSSOMWrapper)
        m_propertiesCSSOMWrapper->clearParentRule();
#endif
}

void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptionState)
{
    if (!m_keyframe->setKeyText(keyText))
        exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "' is invalid and cannot be parsed");
}

CSSStyleDeclaration* CSSKeyframeRule::style() const
{
    if (!m_propertiesCSSOMWrapper)
        m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyframe->mutableProperties(), const_cast<CSSKeyframeRule*>(this));
    return m_propertiesCSSOMWrapper.get();
}

void CSSKeyframeRule::reattach(StyleRuleBase*)
{
    // No need to reattach, the underlying data is shareable on mutation.
    ASSERT_NOT_REACHED();
}

void CSSKeyframeRule::trace(Visitor* visitor)
{
    visitor->trace(m_keyframe);
    visitor->trace(m_propertiesCSSOMWrapper);
    CSSRule::trace(visitor);
}

} // namespace blink


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
    <item android:state_pressed="true" >
        <shape android:shape="rectangle"  >
            <corners android:radius="3dip" />
            <stroke android:width="1dip" android:color="#598e96" />
            <gradient  android:angle="-90"  android:startColor="#27646c" android:endColor="#7fbac6"  />
        </shape>
    </item>
    <item android:state_focused="true">
        <shape android:shape="rectangle"  >
            <corners android:radius="3dip" />
            <stroke android:width="1dip" android:color="#598e96" />
            <solid  android:color="#4ea0ab"/>
        </shape>
    </item>
    <item >
        <shape android:shape="rectangle"  >
            <corners android:radius="3dip" />
            <stroke android:width="1dip" android:color="#598e96" />
            <gradient  android:angle="-90"  android:startColor="#94dcea" android:endColor="#4ea0ab" />
        </shape>
    </item>
</selector>


text:
<?php
/**
 * @license © 2005 - 2016 by Zend Technologies Ltd. All rights reserved.
 */

namespace Admin\Model\Traduction;

use Zend\Db\TableGateway\TableGateway;
use Base\Model\AbstractRepository;

/**
 * SIGA-Smart
 *
 * Esta class foi gerada via Zend\Code\Generator.
 */
class TraductionRepository extends AbstractRepository
{

    /**
     * __construct Factory Model
     *
     * @return __construct
     */
    public function __construct(TableGateway $tableGateway)
    {
        // Configurações iniciais do Factory Repository
        $this->tableGateway=$tableGateway;
    }

}


text:
using System;
using System.Threading;

namespace PowerArgs
{
    /// <summary>
    /// A class that can be used to ensure an action only fires after a burst of triggers ends.
    /// </summary>
    public class ActionDebouncer
    {
        /// <summary>
        /// Gets or sets the burst time window duration used to debounce multiple triggers
        /// </summary>
        public TimeSpan BurstTimeWindow { get; set; }

        private Action callback;

        private Timer endOfBurstTimerDetectionTimer;

        /// <summary>
        /// Creates the debouncer given a bust time window and an action callback.
        /// </summary>
        /// <param name="burstTimeWindow">The time span that determines the time window.  When a trigger fires, the debouncer will wait this amount of time before executing the callback.  If a trigger fires before the time elapses, the timer is reset.</param>
        /// <param name="callback">The action to execute when a trigger fires and the burst time window elapses.</param>
        public ActionDebouncer(TimeSpan burstTimeWindow, Action callback)
        {
            this.BurstTimeWindow = burstTimeWindow;
            this.callback = callback;
            this.endOfBurstTimerDetectionTimer = new Timer((o) => { callback(); }, null, Timeout.Infinite, Timeout.Infinite);
        }

        /// <summary>
        /// Triggers a burst.  If this is the first trigger in a burst of events then a countdown of duration BurstTimeWindow begins.  If this trigger occurs
        /// while the countdown is in the process of counting to zero then the countdown is reset.  If the countdown ever hits zero then the callback fires
        /// and the burst is complete.
        /// </summary>
        public void Trigger()
        {
            if (BurstTimeWindow == TimeSpan.Zero)
            {
                callback();
            }
            else
            {
                endOfBurstTimerDetectionTimer.Change((int)BurstTimeWindow.TotalMilliseconds, Timeout.Infinite);
            }
        }
    }

    public class ActionThrottler
    {
        public TimeSpan BurstTimeWindow { get; set; }
        private Action callback;
        private DateTime lastFireTime;

        public ActionThrottler(TimeSpan burstTimeWindow, Action callback)
        {
            this.BurstTimeWindow = burstTimeWindow;
            lastFireTime = DateTime.MinValue;
            this.callback = callback;
        }

        public void Trigger()
        {
            var now = DateTime.UtcNow;
            if(now - lastFireTime >= BurstTimeWindow)
            {
                callback();
                lastFireTime = now;
            }
        }
    }
}


text:
    #include "LuaIntf/LuaIntf.h"
    using namespace LuaIntf;
#endif

//---------------------------------------------------------------------------

LUA_INLINE int CppBindModuleMetaMethod::index(lua_State* L)
{
    // <SP:1> -> table
    // <SP:2> -> key

    // push metatable of table -> <mt>
    lua_getmetatable(L, 1);

    // push metatable[key] -> <mt> <mt[key]>
    lua_pushvalue(L, 2);
    lua_rawget(L, -2);

    if (lua_isnil(L, -1)) {
        // get metatable.getters -> <mt> <getters>
        lua_pop(L, 1);          // pop nil
        lua_pushliteral(L, "___getters");
        lua_rawget(L, -2);      // get getters table
        assert(lua_istable(L, -1));

        // get metatable.getters[key] -> <mt> <getters> <getters[key]>
        lua_pushvalue(L, 2);    // push key
        lua_rawget(L, -2);      // lookup key in getters

        if (lua_iscfunction(L, -1)) {
            // getter function found
            lua_call(L, 0, 1);
        }
    }

    return 1;
}

LUA_INLINE int CppBindModuleMetaMethod::newIndex(lua_State* L)
{
    // <SP:1> -> table
    // <SP:2> -> key
    // <SP:3> -> value

    // push metatable of table -> <mt>
    lua_getmetatable(L, 1);

    // get setters subtable of metatable -> <mt> <setters>
    lua_pushliteral(L, "___setters");
    lua_rawget(L, -2);          // get __setters table
    assert(lua_istable(L, -1));

    // get setters[key] -> <mt> <setters> <setters[key]>
    lua_pushvalue(L, 2);        // push key arg2
    lua_rawget(L, -2);          // lookup key in setters

    if (lua_iscfunction(L, -1)) {
        // setter function found
        lua_pushvalue(L, 3);    // push new value as arg
        lua_call(L, 1, 0);
    } else {
        // no setter found, just set the table field
        assert(lua_isnil(L, -1));
        lua_pop(L, 3);
        lua_rawset(L, 1);
    }
    return 0;
}

LUA_INLINE int CppBindModuleMetaMethod::forwardCall(lua_State* L)
{
    // <SP:1> -> table (table's metatable is set to itself)
    // <SP:2> ~ <SP:top> -> args
    int top = lua_gettop(L);

    lua_pushvalue(L, lua_upvalueindex(1));
    lua_rawget(L, 1);           // get sub module metatable -> <sub_mt>

    lua_pushliteral(L, "__call");
    lua_rawget(L, -2);          // get call function -> <sub_mt> <call>

    lua_insert(L, 1);           // move <call> to top -> now <mt> is at index 2
    lua_replace(L, 2);          // replace original <mt> with <sub_mt>
    lua_call(L, top, 1);
    return 1;
}

LUA_INLINE int CppBindModuleMetaMethod::errorReadOnly(lua_State* L)
{
    return luaL_error(L, "property '%s' is read-only", lua_tostring(L, lua_upvalueindex(1)));
}

//---------------------------------------------------------------------------

LUA_INLINE std::string CppBindModule::getFullName(const LuaRef& parent, const char* name)
{
    std::string full_name = parent.get<const char*>("___type", "");
    if (!full_name.empty()) {
        size_t pos = full_name.find('<');
        if (pos != std::string::npos) full_name.erase(0, pos + 1);
        pos = full_name.rfind('>');
        if (pos != std::string::npos) full_name.erase(pos);
        full_name += '.';
    }
    full_name += name;
    return full_name;
}

LUA_INLINE std::string CppBindModule::getMemberName(const LuaRef& parent, const char* name)
{
    std::string full_name = parent.rawget<const char*>("___type", "<unknown>");
    full_name += '.';
    full_name += name;
    return full_name;
}

LUA_INLINE void CppBindModule::setGetter(const char* name, const LuaRef& getter)
{
    m_meta.rawget("___getters").rawset(name, getter);
}

LUA_INLINE void CppBindModule::setSetter(const char* name, const LuaRef& setter)
{
    m_meta.rawget("___setters").rawset(name, setter);
}

LUA_INLINE void CppBindModule::setReadOnly(const char* name)
{
    std::string full_name = getMemberName(m_meta, name);
    setSetter(name, LuaRef::createFunctionWith(state(), &CppBindModuleMetaMethod::errorReadOnly, full_name));
}

LUA_INLINE CppBindModule CppBindModule::bind(lua_State* L)
{
    return CppBindModule(LuaRef::globals(L));
}

LUA_INLINE CppBindModule CppBindModule::bind(LuaRef& mod)
{
    return CppBindModule(mod);
}

LUA_INLINE CppBindModule CppBindModule::beginModule(const char* name)
{
    LuaRef ref = m_meta.rawget(name);
    if (ref != nullptr) return CppBindModule(ref);

    lua_State* L = state();
    std::string type_name = "module<" + getFullName(m_meta, name) + ">";
    LuaRef module = LuaRef::createTable(L);
    module.setMetaTable(module);

    module.rawset("__index", &CppBindModuleMetaMethod::index);
    module.rawset("__newindex", &CppBindModuleMetaMethod::newIndex);
    module.rawset("___getters", LuaRef::createTable(L));
    module.rawset("___setters", LuaRef::createTable(L));
    module.rawset("___type", type_name);
    module.rawset("___parent", m_meta);
    m_meta.rawset(name, module);
    return CppBindModule(module);
}

LUA_INLINE CppBindModule CppBindModule::endModule()
{
    return CppBindModule(m_meta.rawget("___parent"));
}


text:
package com.css.cobble.twitchChatBot.api

import com.css.cobble.twitchChatBot.api.events.OnReadyEvent

trait ITwitchChatEventListener {

    def onReady(event: OnReadyEvent): Unit

}


text:
<?php
// autogenerated file 30.09.2013 15:20
// $Id: $
// $Log: $
//
//
require_once 'EbatNs_ComplexType.php';

/**
 *
 *
 * @link http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/types/FeedbackRequirementsType.html
 *
 */
class FeedbackRequirementsType extends EbatNs_ComplexType
{

	/**
	 * @return
	 */
	function __construct()
	{
		parent::__construct('FeedbackRequirementsType', 'http://www.w3.org/2001/XMLSchema');
		if (!isset(self::$_elements[__CLASS__])) {
			self::$_elements[__CLASS__] = array_merge(self::$_elements[get_parent_class()], array());
		}	$this->_attributes = array_merge($this->_attributes,
		array(
			'minimum' =>
			array(
				'name' => 'minimum',
				'type' => 'string',
				'use' => 'required'
			)
		));

	}
}
?>


text:
import java.util.ArrayList;

/**
 * Classe para empresa.
 */
public class Empresa
{
	private ArrayList<Cliente> clientes;

	/**
	 * Construtor do objeto.
	 */
	public Empresa ()
	{
		clientes = new ArrayList<Cliente>();
	}

	/**
	 * Cadastra um novo cliente na lista de clientes
	 *
	 * @param      cliente  O cliente
	 */
	public void cadastrarCliente ( Cliente cliente )
	{
		clientes.add(cliente);
	}

	/**
	 * Imprime os dados do cliente
	 *
	 * @param      cliente  O cliente
	 */
	public void imprimirDadosCliente ()
	{
		for ( Cliente cliente : clientes)
			cliente.imprimirDados();
	}

	/**
	 * Imprime na saída padrão a quantidade de clientes
	 * na empresa, o total, físicos e jurídicos.
	 */
	public void imprimirQuantidadeDeClientes ()
	{
		int pessoasFisicas = 0;
		int pessoasJuridicas = 0;

		for ( Cliente cliente : clientes )
		{
			if (cliente instanceof PessoaFisica )
				pessoasFisicas++;
			else
				pessoasJuridicas++;
		}

		System.out.println("\nQuantidade de Clientes: " + clientes.size());
		System.out.println("Pessoas Juridicas: " + pessoasJuridicas);
		System.out.println("Pessoas Físicas: " + pessoasFisicas);
	}
}


text:
package com.speedment.runtime.compute;

import static com.speedment.runtime.compute.expression.ExpressionType.STRING;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

import com.speedment.runtime.compute.util.Pair;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import java.util.function.Function;

class ToStringTest {

    private static final ToString<String> DEFAULT_TO = string -> string;

    @ParameterizedTest
    @ValueSource(strings = "test")
    void of(String input) {
        final Function<String, String> function = string -> string;
        final ToString<String> fromFunction = ToString.of(function);

        assertNotNull(fromFunction);
        assertEquals(input, fromFunction.apply(input));

        final ToString<String> fromToString = ToString.of(DEFAULT_TO);

        assertNotNull(fromToString);
        assertEquals(input, fromToString.apply(input));
    }

    @Test
    void expressionType() {
        assertEquals(STRING, DEFAULT_TO.expressionType());
    }

    @ParameterizedTest
    @ValueSource(strings = {"test", "TEST", "tEsT"})
    void toUpperCase(String input) {
        assertEquals(input.toUpperCase(), DEFAULT_TO.toUpperCase().apply(input));
    }

    @ParameterizedTest
    @ValueSource(strings = {"test", "TEST", "tEsT"})
    void toLowerCase(String input) {
        assertEquals(input.toLowerCase(), DEFAULT_TO.toLowerCase().apply(input));
    }

    @ParameterizedTest
    @ValueSource(strings = {"foo", "test"})
    void hash(String input) {
        assertEquals(input.hashCode(), DEFAULT_TO.hash(input));
    }

    @Test
    void compare() {
        final Pair<String, String> pair1 = new Pair<>("foo", "foo");
        final Pair<String, String> pair2 = new Pair<>("foo1", "bar");
        final Pair<String, String> pair3 = new Pair<>("foo", "bar1");

        assertEquals(pair1.getFirst().compareTo(pair1.getSecond()),
            DEFAULT_TO.compare(pair1.getFirst(), pair1.getSecond()));
        assertEquals(pair2.getFirst().compareTo(pair2.getSecond()),
            DEFAULT_TO.compare(pair2.getFirst(), pair2.getSecond()));
        assertEquals(pair3.getFirst().compareTo(pair3.getSecond()),
            DEFAULT_TO.compare(pair3.getFirst(), pair3.getSecond()));
    }

    @Test
    void compose() {
        assertThrows(NullPointerException.class, () -> DEFAULT_TO.compose(null));

        final ToStringNullable<Boolean> composed = DEFAULT_TO.compose(Object::toString);

        assertNotNull(composed);
    }
}


text:
package org.apache.sis.referencing.operation.transform;

import java.io.Serializable;
import javax.measure.unit.Unit;
import javax.measure.quantity.Length;
import javax.measure.converter.UnitConverter;
import org.opengis.referencing.datum.Ellipsoid;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.geometry.MismatchedDimensionException;
import org.apache.sis.referencing.datum.DatumShiftGrid;
import org.apache.sis.internal.referencing.provider.Molodensky;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.ComparisonMode;
import org.apache.sis.util.Debug;

// Branch-specific imports
import java.util.Objects;

/**
 * Transforms between two CRS (usually geographic) based on different datum. A datum shift may be needed when two CRS
 * use different {@linkplain org.apache.sis.referencing.datum.DefaultEllipsoid ellipsoids} as approximation of the
 * shape of the Earth. Sometime two CRS use the same ellipsoid but with different anchor point (i.e. their coordinate
 * systems have their origin in different locations).
 *
 *
There is many different datum shift methods, ranging from transformations as simple as adding a constant offset
 * to geographic coordinates, to more complex transformations involving conversions to geocentric coordinates and/or
 * interpolations in a {@linkplain DatumShiftGrid datum shift grid}. The simple cases like adding a constant offset
 * are handled by other {@code MathTransform} implementations like {@link LinearTransform}.
 * More complex methods are subclasses of this {@code DatumShiftTransform} base class, but users should not assume
 * that this is the case of every transforms performing a datum shift.

 *
 *
Datum shift methods overview

 * The two CRS's ellipsoids have slightly different scale and rotation in space, and their center are located in
 * a slightly different position. Consequently geodetic datum shifts are often approximated by a constant scale,
 * rotation and translation applied on geocentric coordinates. Those approximations are handled in SIS
 * by concatenations of {@link EllipsoidToCentricTransform} with {@link LinearTransform} instead than a specific
 * {@code DatumShiftTransform} subclass.
 *
 *
If the geodetic datum shifts is approximated only by a geocentric translation without any scale or rotation,
 * and if an error of a few centimetres it acceptable, then the {@link MolodenskyTransform} subclass can be used
 * as an approximation of the above method. The Molodensky method requires less floating point operations since
 * it applies directly on geographic coordinates, without conversions to geocentric coordinates.

 *
 *
Some countries go one step further and allow the above geocentric translations to be non-constant.
 * Instead, a different geocentric translation is interpolated for each geographic input coordinates.
 * This case is handled by the {@link InterpolatedGeocentricTransform} subclass, or its
 * {@link InterpolatedMolodenskyTransform} variant if a few centimetres accuracy lost can be afforded.

 *
 *
A simpler alternative to the above is to interpolate translations to apply directly on geographic coordinates.
 * This is the approach taken by NADCON and NTv2 grids.
 * SIS handles those datum shifts with the {@link InterpolatedTransform} subclass.

 *
 * @author  Martin Desruisseaux (Geomatys)
 * @since   0.7
 * @version 0.7
 * @module
 *
 * @see DatumShiftGrid
 */
public abstract class DatumShiftTransform extends AbstractMathTransform implements Serializable {
    /**
     * Serial number for inter-operability with different versions.
     */
    private static final long serialVersionUID = -4492222496475405226L;

    /**
     * The parameters used for creating this datum shift. They are used for formatting Well Known Text (WKT)
     * and error messages. Subclasses shall not use the values defined in this object for computation purpose, except at
     * construction time.
     *
     * @see #getContextualParameters()
     */
    final ContextualParameters context;

    /**
     * The grid of datum shifts from source datum to target datum, or {@code null} if none.
     */
    final DatumShiftGrid<?,?> grid;

    /**
     * Creates a datum shift transform for direct interpolations in a grid.
     * It is caller responsibility to initialize the {@link #context} parameters.
     *
     * @param descriptor  The contextual parameter descriptor.
     * @param grid        Interpolation grid.
     */
    DatumShiftTransform(ParameterDescriptorGroup descriptor, final DatumShiftGrid<?,?> grid) {
        final int size = grid.getTranslationDimensions() + 1;
        context = new ContextualParameters(descriptor, size, size);
        this.grid = grid;
    }

    /**
     * Creates a datum shift transform for interpolations in geocentric domain.
     * It is caller responsibility to initialize the {@link #context} parameters.
     *
     * @param descriptor  The contextual parameter descriptor.
     * @param grid        Interpolation grid in geocentric coordinates, or {@code null} if none.
     * @param isSource3D  {@code true} if the source coordinates have a height.
     * @param isTarget3D  {@code true} if the target coordinates have a height.
     */
    DatumShiftTransform(final ParameterDescriptorGroup descriptor,
            final boolean isSource3D, final boolean isTarget3D, final DatumShiftGrid<?,?> grid)
    {
        context = new ContextualParameters(descriptor, isSource3D ? 4 : 3, isTarget3D ? 4 : 3);
        this.grid = grid;
    }

    /**
     * Ensures that the {@link #grid} performs geocentric translations in the given units.
     * This method is invoked by constructor for validation of given arguments.
     *
     *
This method is defined here in order to ensure a consistent behavior of
     * {@link InterpolatedGeocentricTransform} with {@link InterpolatedMolodenskyTransform}.

     *
     * @param  grid  The grid to validate.
     * @param  unit  The unit of semi-axis length of the source ellipsoid.
     * @throws IllegalArgumentException if the given grid is not valid.
     */
    static void ensureGeocentricTranslation(final DatumShiftGrid<?,?> grid, final Unit<Length> unit)
            throws IllegalArgumentException
    {
        final int dim = grid.getTranslationDimensions();
        if (dim != 3) {
            throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, "grid", 3, dim));
        }
        Object unitLabel = "ratio";
        if (grid.isCellValueRatio() || (unitLabel = grid.getTranslationUnit()) != unit) {
            throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalUnitFor_2, "translation", unitLabel));
        }
    }

    /**
     * Sets the semi-axis length in the {@link #context} parameters.
     * This is a helper method for constructors in some (not all) subclasses.
     *
     * @param semiMajor The semi-major axis length of the source ellipsoid.
     * @param semiMinor The semi-minor axis length of the source ellipsoid.
     * @param unit      The unit of measurement of source ellipsoid axes.
     * @param target    The target ellipsoid.
     */
    final void setContextParameters(final double semiMajor, final double semiMinor, final Unit<Length> unit, final Ellipsoid target) {
        final UnitConverter c = target.getAxisUnit().getConverterTo(unit);
        context.getOrCreate(Molodensky.SRC_SEMI_MAJOR).setValue(semiMajor, unit);
        context.getOrCreate(Molodensky.SRC_SEMI_MINOR).setValue(semiMinor, unit);
        context.getOrCreate(Molodensky.TGT_SEMI_MAJOR).setValue(c.convert(target.getSemiMajorAxis()), unit);
        context.getOrCreate(Molodensky.TGT_SEMI_MINOR).setValue(c.convert(target.getSemiMinorAxis()), unit);
    }

    /**
     * Returns the internal parameter values of this {@code DatumShiftTransform} instance (ignoring context).
     * The parameters returned by this method do not necessarily describe the whole datum shift process,
     * because {@code DatumShiftTransform} instances are often preceeded and followed by linear conversions.
     * It may be conversions between degrees and radians units, or conversions from geodetic coordinates to grid indices.
     *
     *
Example:
     * The chain of transforms of an {@link InterpolatedGeocentricTransform} is:
     *
     *

     *

     *       Degrees to radians
     *       {@code DatumShiftTransform} work
     *       Radians to degrees
     *

     *       {@include formulas.html#NormalizeGeographic}
     *       →
     *

     *
Geographic to geocentric conversion

     *
Geocentric interpolation

     *
Geocentric to geographic conversion

     *

     *       →
     *       {@include formulas.html#DenormalizeGeographic}
     *

     *

     *

     *
     * This method returns the parameters for the part in the middle of above example.
     * The content of this part is highly implementation-dependent and used mostly for
     * {@linkplain org.apache.sis.io.wkt.Convention#INTERNAL debugging purposes}.
     * The parameters that describe the process as a whole are rather given by {@link #getContextualParameters()}.
     *
     * @return The internal parameter values for this transform.
     */
    @Debug
    @Override
    public ParameterValueGroup getParameterValues() {
        return context;     // Overridden by some subclasses.
    }

    /**
     * Returns the parameters used for creating the complete transformation. Those parameters describe a sequence
     * of normalize → {@code this} → denormalize transforms, not
     * including {@linkplain org.apache.sis.referencing.cs.CoordinateSystems#swapAndScaleAxes axis swapping}.
     * Those parameters are used for formatting Well Known Text (WKT) and error messages.
     *
     * @return The parameters values for the sequence of
     *         normalize → {@code this} → denormalize transforms.
     */
    @Override
    protected ContextualParameters getContextualParameters() {
        return context;
    }

    /**
     * {@inheritDoc}
     *
     * @return {@inheritDoc}
     */
    @Override
    protected int computeHashCode() {
        return super.computeHashCode() + Objects.hashCode(grid);
    }

    /**
     * Compares the specified object with this math transform for equality.
     *
     * @return {@inheritDoc}
     */
    @Override
    public boolean equals(final Object object, final ComparisonMode mode) {
        return super.equals(object, mode) && Objects.equals(grid, ((DatumShiftTransform) object).grid);
    }
}


text:
"""
    MailMojo API

    v1 of the MailMojo API  # noqa: E501

    OpenAPI spec version: 1.1.0
    Contact: hjelp@mailmojo.no
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import unittest

import mailmojo_sdk
from mailmojo_sdk.models.base_contact import BaseContact  # noqa: E501
from mailmojo_sdk.rest import ApiException

class TestBaseContact(unittest.TestCase):
    """BaseContact unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testBaseContact(self):
        """Test BaseContact"""
        # FIXME: construct object with mandatory attributes with example values
        # model = mailmojo_sdk.models.base_contact.BaseContact()  # noqa: E501
        pass

if __name__ == '__main__':
    unittest.main()


text:
ECHO Create a single dll to add in the NuGet package

IF EXIST "Merged.Tessler" rmdir /s /q "Merged.Tessler"
mkdir "Merged.Tessler"

ILRepack.exe /target:library /internalize /out:"Merged.Tessler\InfoSupport.Tessler.dll" ^
 InfoSupport.Tessler.dll ^
 log4net.dll ^
 Microsoft.Practices.ServiceLocation.dll ^
 Microsoft.Practices.Unity.Configuration.dll ^
 Microsoft.Practices.Unity.dll ^
 Microsoft.Practices.Unity.Interception.Configuration.dll ^
 Microsoft.Practices.Unity.Interception.dll ^
 Moq.dll ^
 WebDriver.dll ^
 WebDriver.Support.dll


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#include "UMGEditorPrivatePCH.h"
#include "SHierarchyViewItem.h"

#include "UMGEditorActions.h"
#include "WidgetTemplateDragDropOp.h"

#include "PreviewScene.h"
#include "SceneViewport.h"

#include "BlueprintEditor.h"
#include "SKismetInspector.h"
#include "BlueprintEditorUtils.h"

#include "Kismet2NameValidators.h"

#include "WidgetBlueprintEditor.h"
#include "SInlineEditableTextBlock.h"
#include "Components/Widget.h"

#include "WidgetBlueprintEditorUtils.h"
#include "Components/PanelSlot.h"
#include "ScopedTransaction.h"
#include "WidgetBlueprint.h"
#include "Blueprint/WidgetTree.h"
#include "Components/PanelWidget.h"

#define LOCTEXT_NAMESPACE "UMG"

/**
*
*/
class FHierarchyWidgetDragDropOp : public FDecoratedDragDropOp
{
public:
	DRAG_DROP_OPERATOR_TYPE(FHierarchyWidgetDragDropOp, FDecoratedDragDropOp)

	virtual ~FHierarchyWidgetDragDropOp();

	virtual void OnDrop(bool bDropWasHandled, const FPointerEvent& MouseEvent) override;

	struct FItem
	{
		/** The slot properties for the old slot the widget was in, is used to attempt to reapply the same layout information */
		TMap<FName, FString> ExportedSlotProperties;

		/** The widget being dragged and dropped */
		FWidgetReference Widget;

		/** The original parent of the widget. */
		UWidget* WidgetParent;
	};

	TArray<FItem> DraggedWidgets;

	/** The widget being dragged and dropped */
	FScopedTransaction* Transaction;

	/** Constructs a new drag/drop operation */
	static TSharedRef<FHierarchyWidgetDragDropOp> New(UWidgetBlueprint* Blueprint, const TArray<FWidgetReference>& InWidgets);
};

TSharedRef<FHierarchyWidgetDragDropOp> FHierarchyWidgetDragDropOp::New(UWidgetBlueprint* Blueprint, const TArray<FWidgetReference>& InWidgets)
{
	check(InWidgets.Num() > 0);

	TSharedRef<FHierarchyWidgetDragDropOp> Operation = MakeShareable(new FHierarchyWidgetDragDropOp());

	// Set the display text and the transaction name based on whether we're dragging a single or multiple widgets
	if (InWidgets.Num() == 1)
	{
		Operation->CurrentHoverText = Operation->DefaultHoverText = InWidgets[0].GetTemplate()->GetLabelText();
		Operation->Transaction = new FScopedTransaction(LOCTEXT("Designer_MoveWidget", "Move Widget"));
	}
	else
	{
		Operation->CurrentHoverText = Operation->DefaultHoverText = LOCTEXT("Designer_DragMultipleWidgets", "Multiple Widgets");
		Operation->Transaction = new FScopedTransaction(LOCTEXT("Designer_MoveWidgets", "Move Widgets"));
	}

	// Add an FItem for each widget in the drag operation
	for (const auto& Widget : InWidgets)
	{
		FItem DraggedWidget;

		DraggedWidget.Widget = Widget;

		FWidgetBlueprintEditorUtils::ExportPropertiesToText(Widget.GetTemplate()->Slot, DraggedWidget.ExportedSlotProperties);

		UWidget* WidgetTemplate = Widget.GetTemplate();
		WidgetTemplate->Modify();

		DraggedWidget.WidgetParent = WidgetTemplate->GetParent();
		if (DraggedWidget.WidgetParent)
		{
			DraggedWidget.WidgetParent->Modify();
		}

		Operation->DraggedWidgets.Add(DraggedWidget);
	}

	Operation->Construct();

	Blueprint->WidgetTree->SetFlags(RF_Transactional);
	Blueprint->WidgetTree->Modify();

	return Operation;
}

FHierarchyWidgetDragDropOp::~FHierarchyWidgetDragDropOp()
{
	delete Transaction;
}

void FHierarchyWidgetDragDropOp::OnDrop(bool bDropWasHandled, const FPointerEvent& MouseEvent)
{
	if ( !bDropWasHandled )
	{
		Transaction->Cancel();
	}
}

//////////////////////////////////////////////////////////////////////////

TOptional<EItemDropZone> ProcessHierarchyDragDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone, bool bIsDrop, TSharedPtr<FWidgetBlueprintEditor> BlueprintEditor, FWidgetReference TargetItem, TOptional<int32> Index = TOptional<int32>())
{
	UWidget* TargetTemplate = TargetItem.GetTemplate();

	if ( TargetTemplate && ( DropZone == EItemDropZone::AboveItem || DropZone == EItemDropZone::BelowItem ) )
	{
		if ( UPanelWidget* TargetParentTemplate = Cast<UPanelWidget>(TargetTemplate->GetParent()) )
		{
			int32 InsertIndex = TargetParentTemplate->GetChildIndex(TargetTemplate);
			InsertIndex += ( DropZone == EItemDropZone::AboveItem ) ? 0 : 1;
			InsertIndex = FMath::Clamp(InsertIndex, 0, TargetParentTemplate->GetChildrenCount());

			FWidgetReference TargetParentTemplateRef = BlueprintEditor->GetReferenceFromTemplate(TargetParentTemplate);
			TOptional<EItemDropZone> ParentZone = ProcessHierarchyDragDrop(DragDropEvent, EItemDropZone::OntoItem, bIsDrop, BlueprintEditor, TargetParentTemplateRef, InsertIndex);
			if ( ParentZone.IsSet() )
			{
				return DropZone;
			}
			else
			{
				DropZone = EItemDropZone::OntoItem;
			}
		}
	}
	else
	{
		DropZone = EItemDropZone::OntoItem;
	}

	UWidgetBlueprint* Blueprint = BlueprintEditor->GetWidgetBlueprintObj();

	// Is this a drag/drop op to create a new widget in the tree?
	TSharedPtr<FWidgetTemplateDragDropOp> TemplateDragDropOp = DragDropEvent.GetOperationAs<FWidgetTemplateDragDropOp>();
	if ( TemplateDragDropOp.IsValid() )
	{
		TemplateDragDropOp->ResetToDefaultToolTip();

		// Are we adding to the root?
		if ( !TargetItem.IsValid() && Blueprint->WidgetTree->RootWidget == nullptr )
		{
			// TODO UMG Allow showing a preview of this.
			if ( bIsDrop )
			{
				FScopedTransaction Transaction(LOCTEXT("AddWidgetFromTemplate", "Add Widget"));

				Blueprint->WidgetTree->SetFlags(RF_Transactional);
				Blueprint->WidgetTree->Modify();

				Blueprint->WidgetTree->RootWidget = TemplateDragDropOp->Template->Create(Blueprint->WidgetTree);
				FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(Blueprint);
			}

			TemplateDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.OK"));
			return EItemDropZone::OntoItem;
		}
		// Are we adding to a panel?
		else if ( UPanelWidget* Parent = Cast<UPanelWidget>(TargetItem.GetTemplate()) )
		{
			if (!Parent->CanAddMoreChildren())
			{
				TemplateDragDropOp->CurrentHoverText = LOCTEXT("NoAdditionalChildren", "Widget can't accept additional children.");
			}
			else
			{
				// TODO UMG Allow showing a preview of this.
				if (bIsDrop)
				{
					FScopedTransaction Transaction(LOCTEXT("AddWidgetFromTemplate", "Add Widget"));

					Blueprint->WidgetTree->SetFlags(RF_Transactional);
					Blueprint->WidgetTree->Modify();
					Parent->Modify();

					UWidget* Widget = TemplateDragDropOp->Template->Create(Blueprint->WidgetTree);

					UPanelSlot* NewSlot = nullptr;
					if (Index.IsSet())
					{
						NewSlot = Parent->InsertChildAt(Index.GetValue(), Widget);
					}
					else
					{
						NewSlot = Parent->AddChild(Widget);
					}
					check(NewSlot);

					FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(Blueprint);
				}

				TemplateDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.OK"));
				return EItemDropZone::OntoItem;
			}
		}
		else
		{
			TemplateDragDropOp->CurrentHoverText = LOCTEXT("CantHaveChildren", "Widget can't have children.");
		}

		TemplateDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
		return TOptional<EItemDropZone>();
	}

	TSharedPtr<FHierarchyWidgetDragDropOp> HierarchyDragDropOp = DragDropEvent.GetOperationAs<FHierarchyWidgetDragDropOp>();
	if ( HierarchyDragDropOp.IsValid() )
	{
		HierarchyDragDropOp->ResetToDefaultToolTip();

		// If the target item is valid we're dealing with a normal widget in the hierarchy, otherwise we should assume it's
		// the null case and we should be adding it as the root widget.
		if ( TargetItem.IsValid() )
		{
			const bool bIsDraggedObject = HierarchyDragDropOp->DraggedWidgets.ContainsByPredicate([TargetItem](const FHierarchyWidgetDragDropOp::FItem& DraggedItem)
			{
				return DraggedItem.Widget == TargetItem;
			});

			if ( bIsDraggedObject )
			{
				HierarchyDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
				return TOptional<EItemDropZone>();
			}

			UPanelWidget* NewParent = Cast<UPanelWidget>(TargetItem.GetTemplate());
			if ( !NewParent )
			{
				HierarchyDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
				HierarchyDragDropOp->CurrentHoverText = LOCTEXT("CantHaveChildren", "Widget can't have children.");
				return TOptional<EItemDropZone>();
			}

			if ( !NewParent->CanAddMoreChildren() )
			{
				HierarchyDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
				HierarchyDragDropOp->CurrentHoverText = LOCTEXT("NoAdditionalChildren", "Widget can't accept additional children.");
				return TOptional<EItemDropZone>();
			}

			bool bFoundNewParentInChildSet = false;
			for (const auto& DraggedWidget : HierarchyDragDropOp->DraggedWidgets)
			{
				UWidget* TemplateWidget = DraggedWidget.Widget.GetTemplate();

				// Verify that the new location we're placing the widget is not inside of its existing children.
				Blueprint->WidgetTree->ForWidgetAndChildren(TemplateWidget, [&](UWidget* Widget) {
					if (NewParent == Widget)
					{
						bFoundNewParentInChildSet = true;
					}
				});
			}

			if ( bFoundNewParentInChildSet )
			{
				HierarchyDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
				HierarchyDragDropOp->CurrentHoverText = LOCTEXT("CantMakeWidgetChildOfChildren", "Can't make widget a child of its children.");
				return TOptional<EItemDropZone>();
			}

			if ( bIsDrop )
			{
				NewParent->SetFlags(RF_Transactional);
				NewParent->Modify();

				TSet<FWidgetReference> SelectedTemplates;

				for (const auto& DraggedWidget : HierarchyDragDropOp->DraggedWidgets)
				{
					UWidget* TemplateWidget = DraggedWidget.Widget.GetTemplate();

					if (Index.IsSet())
					{
						// If we're inserting at an index, and the widget we're moving is already
						// in the hierarchy before the point we're moving it to, we need to reduce the index
						// count by one, because the whole set is about to be shifted when it's removed.
						const bool bInsertInSameParent = TemplateWidget->GetParent() == NewParent;
						const bool bNeedToDropIndex = NewParent->GetChildIndex(TemplateWidget) < Index.GetValue();

						if (bInsertInSameParent && bNeedToDropIndex)
						{
							Index = Index.GetValue() - 1;
						}
					}

					TemplateWidget->RemoveFromParent();

					UPanelSlot* NewSlot = nullptr;
					if (Index.IsSet())
					{
						NewSlot = NewParent->InsertChildAt(Index.GetValue(), TemplateWidget);
						Index = Index.GetValue() + 1;
					}
					else
					{
						NewSlot = NewParent->AddChild(TemplateWidget);
					}
					check(NewSlot);

					// Import the old slot properties
					FWidgetBlueprintEditorUtils::ImportPropertiesFromText(NewSlot, DraggedWidget.ExportedSlotProperties);

					SelectedTemplates.Add(BlueprintEditor->GetReferenceFromTemplate(TemplateWidget));
				}

				FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(Blueprint);
				BlueprintEditor->SelectWidgets(SelectedTemplates, false);
			}

			HierarchyDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.OK"));
			return EItemDropZone::OntoItem;
		}
		else
		{
			HierarchyDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));
			HierarchyDragDropOp->CurrentHoverText = LOCTEXT("CantHaveChildren", "Widget can't have children.");
		}

		return TOptional<EItemDropZone>();
	}

	return TOptional<EItemDropZone>();
}

//////////////////////////////////////////////////////////////////////////

FHierarchyModel::FHierarchyModel(TSharedPtr<FWidgetBlueprintEditor> InBlueprintEditor)
	: bInitialized(false)
	, bIsSelected(false)
	, BlueprintEditor(InBlueprintEditor)
{

}

TOptional<EItemDropZone> FHierarchyModel::HandleCanAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone)
{
	return TOptional<EItemDropZone>();
}

FReply FHierarchyModel::HandleDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
	if (!IsRoot())
	{
		TArray<FWidgetReference> DraggedItems;

		// Dragging multiple items?
		if (bIsSelected)
		{
			const TSet<FWidgetReference>& SelectedWidgets = BlueprintEditor.Pin()->GetSelectedWidgets();
			if (SelectedWidgets.Num() > 1)
			{
				for (const auto& SelectedWidget : SelectedWidgets)
				{
					DraggedItems.Add(SelectedWidget);
				}
			}
		}

		if (DraggedItems.Num() == 0)
		{
			FWidgetReference ThisItem = AsDraggedWidgetReference();
			if (ThisItem.IsValid())
			{
				DraggedItems.Add(ThisItem);
			}
		}

		if (DraggedItems.Num() > 0)
		{
			return FReply::Handled().BeginDragDrop(FHierarchyWidgetDragDropOp::New(BlueprintEditor.Pin()->GetWidgetBlueprintObj(), DraggedItems));
		}
	}

	return FReply::Unhandled();
}

void FHierarchyModel::HandleDragEnter(const FDragDropEvent& DragDropEvent)
{

}

void FHierarchyModel::HandleDragLeave(const FDragDropEvent& DragDropEvent)
{
	TSharedPtr<FDecoratedDragDropOp> DecoratedDragDropOp = DragDropEvent.GetOperationAs<FDecoratedDragDropOp>();
	if ( DecoratedDragDropOp.IsValid() )
	{
		DecoratedDragDropOp->ResetToDefaultToolTip();
	}
}

FReply FHierarchyModel::HandleAcceptDrop(FDragDropEvent const& DragDropEvent, EItemDropZone DropZone)
{
	return FReply::Unhandled();
}

bool FHierarchyModel::OnVerifyNameTextChanged(const FText& InText, FText& OutErrorMessage)
{
	return false;
}

void FHierarchyModel::OnNameTextCommited(const FText& InText, ETextCommit::Type CommitInfo)
{

}

void FHierarchyModel::InitializeChildren()
{
	if ( !bInitialized )
	{
		bInitialized = true;
		GetChildren(Models);
	}
}

void FHierarchyModel::GatherChildren(TArray< TSharedPtr<FHierarchyModel> >& Children)
{
	InitializeChildren();

	Children.Append(Models);
}

bool FHierarchyModel::ContainsSelection()
{
	InitializeChildren();

	for ( TSharedPtr<FHierarchyModel>& Model : Models )
	{
		if ( Model->IsSelected() || Model->ContainsSelection() )
		{
			return true;
		}
	}

	return false;
}

void FHierarchyModel::RefreshSelection()
{
	InitializeChildren();

	UpdateSelection();

	for ( TSharedPtr<FHierarchyModel>& Model : Models )
	{
		Model->RefreshSelection();
	}
}

bool FHierarchyModel::IsSelected() const
{
	return bIsSelected;
}

//////////////////////////////////////////////////////////////////////////

FHierarchyRoot::FHierarchyRoot(TSharedPtr<FWidgetBlueprintEditor> InBlueprintEditor)
	: FHierarchyModel(InBlueprintEditor)
{
	RootText = FText::Format(LOCTEXT("RootWidgetFormat", "[{0}]"), FText::FromString(BlueprintEditor.Pin()->GetBlueprintObj()->GetName()));
}

FName FHierarchyRoot::GetUniqueName() const
{
	static const FName DesignerRootName(TEXT("WidgetDesignerRoot"));
	return DesignerRootName;
}

FText FHierarchyRoot::GetText() const
{
	return RootText;
}

const FSlateBrush* FHierarchyRoot::GetImage() const
{
	return nullptr;
}

FSlateFontInfo FHierarchyRoot::GetFont() const
{
	return FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Bold.ttf"), 10);
}

void FHierarchyRoot::GetChildren(TArray< TSharedPtr<FHierarchyModel> >& Children)
{
	TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();
	UWidgetBlueprint* Blueprint = BPEd->GetWidgetBlueprintObj();

	if ( Blueprint->WidgetTree->RootWidget )
	{
		TSharedPtr<FHierarchyWidget> RootChild = MakeShareable(new FHierarchyWidget(BPEd->GetReferenceFromTemplate(Blueprint->WidgetTree->RootWidget), BPEd));
		Children.Add(RootChild);
	}
}

void FHierarchyRoot::OnSelection()
{
	TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();
	if ( UWidget* Default = BPEd->GetWidgetBlueprintObj()->GeneratedClass->GetDefaultObject<UWidget>() )
	{
		TSet<UObject*> SelectedObjects;
		SelectedObjects.Add(Default);
		BPEd->SelectObjects(SelectedObjects);
	}
}

void FHierarchyRoot::UpdateSelection()
{
	TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();
	if ( UWidget* Default = BPEd->GetWidgetBlueprintObj()->GeneratedClass->GetDefaultObject<UWidget>() )
	{
		const TSet< TWeakObjectPtr<UObject> >& SelectedObjects = BlueprintEditor.Pin()->GetSelectedObjects();
		bIsSelected = SelectedObjects.Contains(Default);
	}
	else
	{
		bIsSelected = false;
	}
}

TOptional<EItemDropZone> FHierarchyRoot::HandleCanAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone)
{
	bool bIsDrop = false;
	return ProcessHierarchyDragDrop(DragDropEvent, DropZone, bIsDrop, BlueprintEditor.Pin(), FWidgetReference());
}

FReply FHierarchyRoot::HandleAcceptDrop(FDragDropEvent const& DragDropEvent, EItemDropZone DropZone)
{
	bool bIsDrop = true;
	TOptional<EItemDropZone> Zone = ProcessHierarchyDragDrop(DragDropEvent, DropZone, bIsDrop, BlueprintEditor.Pin(), FWidgetReference());
	return Zone.IsSet() ? FReply::Handled() : FReply::Unhandled();
}

//////////////////////////////////////////////////////////////////////////

FNamedSlotModel::FNamedSlotModel(FWidgetReference InItem, FName InSlotName, TSharedPtr<FWidgetBlueprintEditor> InBlueprintEditor)
	: FHierarchyModel(InBlueprintEditor)
	, Item(InItem)
	, SlotName(InSlotName)
{
}

FName FNamedSlotModel::GetUniqueName() const
{
	UWidget* WidgetTemplate = Item.GetTemplate();
	if ( WidgetTemplate )
	{
		FString UniqueSlot = WidgetTemplate->GetName() + TEXT(".") + SlotName.ToString();
		return FName(*UniqueSlot);
	}

	return NAME_None;
}

FText FNamedSlotModel::GetText() const
{
	if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
	{
		TSet<FWidgetReference> SelectedWidgets;
		if ( UWidget* SlotContent = NamedSlotHost->GetContentForSlot(SlotName) )
		{
			return FText::Format(LOCTEXT("NamedSlotTextFormat", "{0} ({1})"), FText::FromName(SlotName), FText::FromName(SlotContent->GetFName()));
		}
	}

	return FText::FromName(SlotName);
}

const FSlateBrush* FNamedSlotModel::GetImage() const
{
	return NULL;
}

FSlateFontInfo FNamedSlotModel::GetFont() const
{
	return FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Bold.ttf"), 10);
}

void FNamedSlotModel::GetChildren(TArray< TSharedPtr<FHierarchyModel> >& Children)
{
	TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();
	if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
	{
		TSet<FWidgetReference> SelectedWidgets;
		if ( UWidget* TemplateSlotContent = NamedSlotHost->GetContentForSlot(SlotName) )
		{
			TSharedPtr<FHierarchyWidget> RootChild = MakeShareable(new FHierarchyWidget(BPEd->GetReferenceFromTemplate(TemplateSlotContent), BPEd));
			Children.Add(RootChild);
		}
	}
}

void FNamedSlotModel::OnSelection()
{
	TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();
	if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
	{
		TSet<FWidgetReference> SelectedWidgets;
		if ( UWidget* TemplateSlotContent = NamedSlotHost->GetContentForSlot(SlotName) )
		{
			SelectedWidgets.Add(BPEd->GetReferenceFromTemplate(TemplateSlotContent));
		}

		BPEd->SelectWidgets(SelectedWidgets, true);
	}
}

void FNamedSlotModel::UpdateSelection()
{
	//bIsSelected = false;

	//const TSet<FWidgetReference>& SelectedWidgets = BlueprintEditor.Pin()->GetSelectedWidgets();

	//TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();
	//if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
	//{
	//	if ( UWidget* TemplateSlotContent = NamedSlotHost->GetContentForSlot(SlotName) )
	//	{
	//		bIsSelected = SelectedWidgets.Contains(BPEd->GetReferenceFromTemplate(TemplateSlotContent));
	//	}
	//}
}

FWidgetReference FNamedSlotModel::AsDraggedWidgetReference() const
{
	if (INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()))
	{
		// Only assign content to the named slot if it is null.
		if (UWidget* Content = NamedSlotHost->GetContentForSlot(SlotName))
		{
			return BlueprintEditor.Pin()->GetReferenceFromTemplate(Content);
		}
	}

	return FWidgetReference();
}

TOptional<EItemDropZone> FNamedSlotModel::HandleCanAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone)
{
	TSharedPtr<FWidgetTemplateDragDropOp> TemplateDragDropOp = DragDropEvent.GetOperationAs<FWidgetTemplateDragDropOp>();
	if ( TemplateDragDropOp.IsValid() )
	{
		if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
		{
			// Only assign content to the named slot if it is null.
			if ( NamedSlotHost->GetContentForSlot(SlotName) != nullptr )
			{
				TSharedPtr<FDecoratedDragDropOp> DecoratedDragDropOp = DragDropEvent.GetOperationAs<FDecoratedDragDropOp>();
				TemplateDragDropOp->CurrentIconBrush = FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error"));

				return TOptional<EItemDropZone>();
			}

			return EItemDropZone::OntoItem;
		}
	}

	return TOptional<EItemDropZone>();
}

FReply FNamedSlotModel::HandleAcceptDrop(FDragDropEvent const& DragDropEvent, EItemDropZone DropZone)
{
	UWidgetBlueprint* Blueprint = BlueprintEditor.Pin()->GetWidgetBlueprintObj();

	// Is this a drag/drop op to create a new widget in the tree?
	TSharedPtr<FWidgetTemplateDragDropOp> TemplateDragDropOp = DragDropEvent.GetOperationAs<FWidgetTemplateDragDropOp>();
	if ( TemplateDragDropOp.IsValid() )
	{
		if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
		{
			// Only assign content to the named slot if it is null.
			if ( NamedSlotHost->GetContentForSlot(SlotName) == nullptr )
			{
				UWidget* Widget = TemplateDragDropOp->Template->Create(Blueprint->WidgetTree);
				NamedSlotHost->SetContentForSlot(SlotName, Widget);
				FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(Blueprint);

				TSet<FWidgetReference> SelectedTemplates;
				SelectedTemplates.Add(BlueprintEditor.Pin()->GetReferenceFromTemplate(Widget));

				BlueprintEditor.Pin()->SelectWidgets(SelectedTemplates, false);
			}

			return FReply::Handled();
		}
	}

	return FReply::Unhandled();
}

//////////////////////////////////////////////////////////////////////////

FHierarchyWidget::FHierarchyWidget(FWidgetReference InItem, TSharedPtr<FWidgetBlueprintEditor> InBlueprintEditor)
	: FHierarchyModel(InBlueprintEditor)
	, Item(InItem)
{
}

FName FHierarchyWidget::GetUniqueName() const
{
	UWidget* WidgetTemplate = Item.GetTemplate();
	if ( WidgetTemplate )
	{
		return WidgetTemplate->GetFName();
	}

	return NAME_None;
}

FText FHierarchyWidget::GetText() const
{
	UWidget* WidgetTemplate = Item.GetTemplate();
	if ( WidgetTemplate )
	{
		return WidgetTemplate->GetLabelText();
	}

	return FText::GetEmpty();
}

FText FHierarchyWidget::GetImageToolTipText() const
{
	UWidget* WidgetTemplate = Item.GetTemplate();
	if ( WidgetTemplate )
	{
		UClass* WidgetClass = WidgetTemplate->GetClass();
		if ( WidgetClass->IsChildOf( UUserWidget::StaticClass() ) )
		{
			auto& Description = Cast<UWidgetBlueprint>( WidgetClass->ClassGeneratedBy )->BlueprintDescription;
			if ( Description.Len() > 0 )
			{
				return FText::FromString( Description );
			}
		}

		return WidgetClass->GetToolTipText();
	}

	return FText::GetEmpty();
}

FText FHierarchyWidget::GetLabelToolTipText() const
{
	// If the user has provided a name, give a tooltip with the widget type for easy reference
	UWidget* WidgetTemplate = Item.GetTemplate();
	if ( WidgetTemplate && !WidgetTemplate->IsGeneratedName() )
	{
		return FText::FromString(TEXT( "[" ) + WidgetTemplate->GetClass()->GetDisplayNameText().ToString() + TEXT( "]" ) );
	}

	return FText::GetEmpty();
}

const FSlateBrush* FHierarchyWidget::GetImage() const
{
	return Item.GetTemplate()->GetEditorIcon();
}

FSlateFontInfo FHierarchyWidget::GetFont() const
{
	UWidget* WidgetTemplate = Item.GetTemplate();
	if ( WidgetTemplate )
	{
		if ( !WidgetTemplate->IsGeneratedName() && WidgetTemplate->bIsVariable )
		{
			// TODO UMG Hacky move into style area
			return FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Bold.ttf"), 10);
		}
	}

	static FName NormalFont("NormalFont");
	return FCoreStyle::Get().GetFontStyle(NormalFont);
}

TOptional<EItemDropZone> FHierarchyWidget::HandleCanAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone)
{
	bool bIsDrop = false;
	return ProcessHierarchyDragDrop(DragDropEvent, DropZone, bIsDrop, BlueprintEditor.Pin(), Item);
}

void FHierarchyWidget::HandleDragLeave(const FDragDropEvent& DragDropEvent)
{
	TSharedPtr<FDecoratedDragDropOp> DecoratedDragDropOp = DragDropEvent.GetOperationAs<FDecoratedDragDropOp>();
	if ( DecoratedDragDropOp.IsValid() )
	{
		DecoratedDragDropOp->ResetToDefaultToolTip();
	}
}

FReply FHierarchyWidget::HandleAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone)
{
	bool bIsDrop = true;
	TOptional<EItemDropZone> Zone = ProcessHierarchyDragDrop(DragDropEvent, DropZone, bIsDrop, BlueprintEditor.Pin(), Item);
	return Zone.IsSet() ? FReply::Handled() : FReply::Unhandled();
}

bool FHierarchyWidget::OnVerifyNameTextChanged(const FText& InText, FText& OutErrorMessage)
{
	return FWidgetBlueprintEditorUtils::VerifyWidgetRename(BlueprintEditor.Pin().ToSharedRef(), Item, InText, OutErrorMessage);
}

void FHierarchyWidget::OnNameTextCommited(const FText& InText, ETextCommit::Type CommitInfo)
{
	FWidgetBlueprintEditorUtils::RenameWidget(BlueprintEditor.Pin().ToSharedRef(), Item.GetTemplate()->GetFName(), FName(*InText.ToString()));
}

void FHierarchyWidget::GetChildren(TArray< TSharedPtr<FHierarchyModel> >& Children)
{
	TSharedPtr<FWidgetBlueprintEditor> BPEd = BlueprintEditor.Pin();

	// Check for named slots
	if ( INamedSlotInterface* NamedSlotHost = Cast<INamedSlotInterface>(Item.GetTemplate()) )
	{
		TArray<FName> SlotNames;
		NamedSlotHost->GetSlotNames(SlotNames);

		for ( FName& SlotName : SlotNames )
		{
			TSharedPtr<FNamedSlotModel> ChildItem = MakeShareable(new FNamedSlotModel(Item, SlotName, BPEd));
			Children.Add(ChildItem);
		}
	}

	// Check if it's a panel widget that can support children
	if ( UPanelWidget* PanelWidget = Cast<UPanelWidget>(Item.GetTemplate()) )
	{
		for ( int32 i = 0; i < PanelWidget->GetChildrenCount(); i++ )
		{
			UWidget* Child = PanelWidget->GetChildAt(i);
			if ( Child )
			{
				TSharedPtr<FHierarchyWidget> ChildItem = MakeShareable(new FHierarchyWidget(BPEd->GetReferenceFromTemplate(Child), BPEd));
				Children.Add(ChildItem);
			}
		}
	}
}

void FHierarchyWidget::OnSelection()
{
	TSet<FWidgetReference> SelectedWidgets;
	SelectedWidgets.Add(Item);

	BlueprintEditor.Pin()->SelectWidgets(SelectedWidgets, true);
}

void FHierarchyWidget::OnMouseEnter()
{
	BlueprintEditor.Pin()->SetHoveredWidget(Item);
}

void FHierarchyWidget::OnMouseLeave()
{
	BlueprintEditor.Pin()->ClearHoveredWidget();
}

bool FHierarchyWidget::IsHovered() const
{
	return BlueprintEditor.Pin()->GetHoveredWidget() == Item;
}

void FHierarchyWidget::UpdateSelection()
{
	const TSet<FWidgetReference>& SelectedWidgets = BlueprintEditor.Pin()->GetSelectedWidgets();
	bIsSelected = SelectedWidgets.Contains(Item);
}

bool FHierarchyWidget::CanRename() const
{
	return true;
}

void FHierarchyWidget::BeginRename()
{
	RenameEvent.ExecuteIfBound();
}

//////////////////////////////////////////////////////////////////////////

void SHierarchyViewItem::Construct(const FArguments& InArgs, const TSharedRef< STableViewBase >& InOwnerTableView, TSharedPtr<FHierarchyModel> InModel)
{
	Model = InModel;
	Model->RenameEvent.BindSP(this, &SHierarchyViewItem::BeginRename);

	STableRow< TSharedPtr<FHierarchyModel> >::Construct(
		STableRow< TSharedPtr<FHierarchyModel> >::FArguments()
		.OnCanAcceptDrop(this, &SHierarchyViewItem::HandleCanAcceptDrop)
		.OnAcceptDrop(this, &SHierarchyViewItem::HandleAcceptDrop)
		.OnDragDetected(this, &SHierarchyViewItem::HandleDragDetected)
		.OnDragEnter(this, &SHierarchyViewItem::HandleDragEnter)
		.OnDragLeave(this, &SHierarchyViewItem::HandleDragLeave)
		.Padding(0.0f)
		.Content()
		[
			SNew(SHorizontalBox)

			// Widget icon
			+ SHorizontalBox::Slot()
			.AutoWidth()
			[
				SNew(SImage)
				.ColorAndOpacity(FLinearColor(1,1,1,0.5))
				.Image(Model->GetImage())
				.ToolTipText(Model->GetImageToolTipText())
			]

			// Name of the widget
			+ SHorizontalBox::Slot()
			.FillWidth(1.0f)
			.Padding(2, 0, 0, 0)
			.VAlign(VAlign_Center)
			[
				SAssignNew(EditBox, SInlineEditableTextBlock)
				.Font(this, &SHierarchyViewItem::GetItemFont)
				.Text(this, &SHierarchyViewItem::GetItemText)
				.ToolTipText(Model->GetLabelToolTipText())
				.HighlightText(InArgs._HighlightText)
				.OnVerifyTextChanged(this, &SHierarchyViewItem::OnVerifyNameTextChanged)
				.OnTextCommitted(this, &SHierarchyViewItem::OnNameTextCommited)
				.IsSelected(this, &SHierarchyViewItem::IsSelectedExclusively)
			]

			// Visibility icon
			+ SHorizontalBox::Slot()
			.AutoWidth()
			.VAlign(VAlign_Center)
			[
				SNew(SButton)
				.ContentPadding(FMargin(3, 1))
				.ButtonStyle(FEditorStyle::Get(), "HoverHintOnly")
				.ForegroundColor(FCoreStyle::Get().GetSlateColor("Foreground"))
				.OnClicked(this, &SHierarchyViewItem::OnToggleVisibility)
				.Visibility(Model->CanControlVisibility() ? EVisibility::Visible : EVisibility::Hidden)
				.ToolTipText(LOCTEXT("WidgetVisibilityButtonToolTip", "Toggle Widget's Editor Visibility"))
				.HAlign(HAlign_Center)
				.VAlign(VAlign_Center)
				[
					SNew(STextBlock)
					.Font(FEditorStyle::Get().GetFontStyle("FontAwesome.10"))
					.Text(this, &SHierarchyViewItem::GetVisibilityBrushForWidget)
				]
			]
		],
		InOwnerTableView);
}

SHierarchyViewItem::~SHierarchyViewItem()
{
	Model->RenameEvent.Unbind();
}

void SHierarchyViewItem::OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
	STableRow< TSharedPtr<FHierarchyModel> >::OnMouseEnter(MyGeometry, MouseEvent);

	Model->OnMouseEnter();
}

void SHierarchyViewItem::OnMouseLeave(const FPointerEvent& MouseEvent)
{
	STableRow< TSharedPtr<FHierarchyModel> >::OnMouseLeave(MouseEvent);

	Model->OnMouseLeave();
}

bool SHierarchyViewItem::OnVerifyNameTextChanged(const FText& InText, FText& OutErrorMessage)
{
	return Model->OnVerifyNameTextChanged(InText, OutErrorMessage);
}

void SHierarchyViewItem::OnNameTextCommited(const FText& InText, ETextCommit::Type CommitInfo)
{
	// The model can return nice names "Border_53" becomes [Border] in some cases
	// This check makes sure we don't rename the object internally to that nice name.
	// Most common case would be the user enters edit mode by accident then just moves focus away.
	if (Model->GetText().EqualToCaseIgnored(InText))
	{
		return;
	}
	Model->OnNameTextCommited(InText, CommitInfo);
}

bool SHierarchyViewItem::CanRename() const
{
	return Model->CanRename();
}

void SHierarchyViewItem::BeginRename()
{
	TSharedPtr<SInlineEditableTextBlock> SafeEditBox = EditBox.Pin();
	if ( SafeEditBox.IsValid() )
	{
		SafeEditBox->EnterEditingMode();
	}
}

FSlateFontInfo SHierarchyViewItem::GetItemFont() const
{
	return Model->GetFont();
}

FText SHierarchyViewItem::GetItemText() const
{
	return Model->GetText();
}

bool SHierarchyViewItem::IsHovered() const
{
	return bIsHovered || Model->IsHovered();
}

void SHierarchyViewItem::HandleDragEnter(FDragDropEvent const& DragDropEvent)
{
	Model->HandleDragEnter(DragDropEvent);
}

void SHierarchyViewItem::HandleDragLeave(const FDragDropEvent& DragDropEvent)
{
	Model->HandleDragLeave(DragDropEvent);
}

TOptional<EItemDropZone> SHierarchyViewItem::HandleCanAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone, TSharedPtr<FHierarchyModel> TargetItem)
{
	return Model->HandleCanAcceptDrop(DragDropEvent, DropZone);
}

FReply SHierarchyViewItem::HandleDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
	return Model->HandleDragDetected(MyGeometry, MouseEvent);
}

FReply SHierarchyViewItem::HandleAcceptDrop(const FDragDropEvent& DragDropEvent, EItemDropZone DropZone, TSharedPtr<FHierarchyModel> TargetItem)
{
	return Model->HandleAcceptDrop(DragDropEvent, DropZone);
}

FReply SHierarchyViewItem::OnToggleVisibility()
{
	Model->SetIsVisible(!Model->IsVisible());

	return FReply::Handled();
}

FText SHierarchyViewItem::GetVisibilityBrushForWidget() const
{
	return Model->IsVisible() ?
		FText::FromString(FString(TEXT("\xf06e")) /*fa-eye*/) :
		FText::FromString(FString(TEXT("\xf070")) /*fa-eye-slash*/);
}

#undef LOCTEXT_NAMESPACE


text:
package com.krishagni.catissueplus.core.auth.repository.impl;

import java.util.Date;
import java.util.List;

import com.krishagni.catissueplus.core.auth.domain.AuthDomain;
import com.krishagni.catissueplus.core.auth.domain.AuthProvider;
import com.krishagni.catissueplus.core.auth.domain.AuthToken;
import com.krishagni.catissueplus.core.auth.domain.LoginAuditLog;
import com.krishagni.catissueplus.core.auth.repository.AuthDao;
import com.krishagni.catissueplus.core.common.repository.AbstractDao;

public class AuthDaoImpl extends AbstractDao<AuthDomain> implements AuthDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<AuthDomain> getAuthDomains(int maxResults) {
		return sessionFactory.getCurrentSession()
				.getNamedQuery(GET_AUTH_DOMAINS)
				.setMaxResults(maxResults)
				.list();
	}

	@SuppressWarnings(value = {"unchecked"})
	@Override
	public AuthDomain getAuthDomainByName(String domainName) {
		List<AuthDomain> result = sessionFactory.getCurrentSession()
				.getNamedQuery(GET_DOMAIN_BY_NAME)
				.setString("domainName", domainName)
				.list();

		return result.isEmpty() ? null : result.get(0);
	}

	@SuppressWarnings(value = {"unchecked"})
	@Override
	public Boolean isUniqueAuthDomainName(String domainName) {
		List<AuthDomain> result = sessionFactory.getCurrentSession()
				.getNamedQuery(GET_DOMAIN_BY_NAME)
				.setString("domainName", domainName)
				.list();

		return result.isEmpty();
	}

	@SuppressWarnings(value = {"unchecked"})
	@Override
	public AuthProvider getAuthProviderByType(String authType) {
		List<AuthProvider> result = sessionFactory.getCurrentSession()
				.getNamedQuery(GET_PROVIDER_BY_TYPE)
				.setString("authType", authType)
				.list();

		return result.isEmpty() ? null : result.get(0);
	}

	@SuppressWarnings("unchecked")
	@Override
	public AuthToken getAuthTokenByKey(String key) {
		List<AuthToken> tokens = sessionFactory.getCurrentSession()
				.getNamedQuery(GET_AUTH_TOKEN_BY_KEY)
				.setString("token", key)
				.list();

		return tokens.isEmpty() ? null : tokens.get(0);
	}

	@Override
	public void saveAuthToken(AuthToken token) {
		 sessionFactory.getCurrentSession().saveOrUpdate(token);
	}

	@Override
	public void deleteAuthToken(AuthToken token) {
		sessionFactory.getCurrentSession().delete(token);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<LoginAuditLog> getLoginAuditLogsByUser(Long userId, int maxResults) {
		return sessionFactory.getCurrentSession()
				.getNamedQuery(GET_LOGIN_AUDIT_LOGS_BY_USER_ID)
				.setLong("userId", userId)
				.setMaxResults(maxResults)
				.list();
	}

	@Override
	public void deleteExpiredAuthToken(Date expiresOn) {
		String deleteHql = "delete from " + AuthToken.class.getName() + " t where t.expiresOn < :expiresOn";
		sessionFactory.getCurrentSession()
			.createQuery(deleteHql)
			.setDate("expiresOn", expiresOn)
			.executeUpdate();
	}

	@Override
	public void saveLoginAuditLog(LoginAuditLog log) {
		sessionFactory.getCurrentSession().saveOrUpdate(log);
	}

	private static final String FQN = AuthDomain.class.getName();

	private static final String GET_AUTH_DOMAINS = FQN + ".getAuthDomains";

	private static final String GET_DOMAIN_BY_NAME = FQN + ".getDomainByName";

	private static final String GET_PROVIDER_BY_TYPE = AuthProvider.class.getName() + ".getProviderByType";

	private static final String GET_AUTH_TOKEN_BY_KEY = AuthToken.class.getName() + ".getByKey";

	private static final String GET_LOGIN_AUDIT_LOGS_BY_USER_ID = LoginAuditLog.class.getName() + ".getLogsByUserId";

}