Imports the frames config from node.

@param root The root reference (must not be <code>null</code>).
@return The frames data.
@throws LionEngineException If unable to read node or invalid integer.
767394
public static FramesConfig imports(Xml root)
    {
        Check.notNull(root);

        final Xml node = root.getChild(NODE_FRAMES);
        final int horizontals = node.readInteger(ATT_HORIZONTAL);
        final int verticals = node.readInteger(ATT_VERTICAL);
        final int offsetX = node.readInteger(0, ATT_OFFSET_X);
        final int offsetY = node.readInteger(0, ATT_OFFSET_Y);

        return new FramesConfig(horizontals, verticals, offsetX, offsetY);
    }
974482
public static FeaturableConfig imports(Xml root)
    {
        Check.notNull(root);

        final String clazz;
        if (root.hasChild(ATT_CLASS))
        {
            clazz = root.getChild(ATT_CLASS).getText();
        }
        else
        {
            clazz = DEFAULT_CLASS_NAME;
        }

        final String setup;
        if (root.hasChild(ATT_SETUP))
        {
            setup = root.getChild(ATT_SETUP).getText();
        }
        else
        {
            setup = Constant.EMPTY_STRING;
        }

        return new FeaturableConfig(clazz, setup);
    }
869656
public static Xml exports(FramesConfig config)
    {
        Check.notNull(config);

        final Xml node = new Xml(NODE_FRAMES);
        node.writeInteger(ATT_HORIZONTAL, config.getHorizontal());
        node.writeInteger(ATT_VERTICAL, config.getVertical());
        node.writeInteger(ATT_OFFSET_X, config.getOffsetX());
        node.writeInteger(ATT_OFFSET_Y, config.getOffsetY());

        return node;
    }
348377
@Override
    public Root get(Root root) throws WIMException {
        final String METHODNAME = "get";
        Root outRoot = new Root();

        Map<String, Control> ctrlMap = ControlsHelper.getControlMap(root);
        PropertyControl propertyCtrl = (PropertyControl) ctrlMap.get(SchemaConstants.DO_PROPERTY_CONTROL);
        GroupMembershipControl grpMbrshipCtrl = (GroupMembershipControl) ctrlMap.get(SchemaConstants.DO_GROUP_MEMBERSHIP_CONTROL);
        GroupMemberControl grpMbrCtrl = (GroupMemberControl) ctrlMap.get(SchemaConstants.DO_GROUP_MEMBER_CONTROL);
        AncestorControl ancesCtrl = (AncestorControl) ctrlMap.get(SchemaConstants.DO_ANCESTOR_CONTROL);
        DescendantControl descCtrl = (DescendantControl) ctrlMap.get(SchemaConstants.DO_DESCENDANT_CONTROL);
        CheckGroupMembershipControl chkGrpMbrshipCtrl = (CheckGroupMembershipControl) ctrlMap.get(SchemaConstants.DO_CHECK_GROUP_MEMBERSHIP_CONTROL);
        CacheControl cacheCtrl = (CacheControl) ctrlMap.get(SchemaConstants.DO_CACHE_CONTROL);

        boolean clearCacheForMembership = false;

        // If a cache control is passed, the cache should be cleared
        if (cacheCtrl != null) {
            String cacheMode = cacheCtrl.getMode();
            if (tc.isDebugEnabled())
                Tr.debug(tc, METHODNAME + " Cache Control is passed with mode " + cacheMode);

            // If the mode is 'clearAll', then invalidate the caches
            if (cacheMode != null && SchemaConstants.CACHE_MODE_CLEARALL.equalsIgnoreCase(cacheMode)) {
                // Invalidate the attributes cache
                iLdapConn.invalidateAttributeCache();

                // Invalidate the search cache
                iLdapConn.invalidateSearchCache();

                // Log this clearAll call
                String uniqueName = getCallerUniqueName();
                if (tc.isWarningEnabled())
                    Tr.warning(tc, WIMMessageKey.CLEAR_ALL_CLEAR_CACHE_MODE, WIMMessageHelper.generateMsgParms(reposId, cacheMode, uniqueName));
            }

            // If the mode is 'clearEntity', then invalidate the attribute cache for the DN
            else if (cacheMode != null && SchemaConstants.CACHE_MODE_CLEAR_ENTITY.equalsIgnoreCase(cacheMode)) {
                // Get the entities
                List<Entity> entities = root.getEntities();

                // Iterate over the entities and remove each one from the cache.
                for (Entity inEntity : entities) {
                    // Get the identifier
                    IdentifierType id = inEntity.getIdentifier();
                    String externalName = id.getExternalName();
                    String extId = id.getExternalId();
                    String uniqueName = id.getUniqueName();

                    // Invalidate attibutes
                    iLdapConn.invalidateAttributes(externalName, extId, uniqueName);
                }

                // Set the flag that would be used to determine if the search
                // cache needs to be cleared later, depending on whether
                // the user has passed the Group Member and/or Group Membership controls.
                clearCacheForMembership = true;
            } else if (tc.isWarningEnabled())
                Tr.warning(tc, WIMMessageKey.UNKNOWN_CLEAR_CACHE_MODE, WIMMessageHelper.generateMsgParms(reposId, cacheMode));
        }

        List<String> propNames = null;
        if (propertyCtrl != null) {
            propNames = propertyCtrl.getProperties();
        }
        boolean needMbrAttr = false;

        if (grpMbrCtrl != null
            && (iLdapConfigMgr.getMembershipAttribute() == null || !iLdapConfigMgr.isDefaultMbrAttr())) {
            needMbrAttr = true;
        }

        for (Entity inEntity : root.getEntities()) {
            String inEntityType = inEntity.getTypeName();
            List<String> properties = iLdapConfigMgr.getSupportedProperties(inEntityType, propNames);

            List<String> EntityType = new ArrayList<String>(1);
            EntityType.add(inEntityType);

            IdentifierType inId = inEntity.getIdentifier();

            // Only retrieve member attr when there grpMbrCtrl is not null and no grpMbrship attr.
            LdapEntry ldapEntry = iLdapConn.getEntityByIdentifier(inId, EntityType, properties,
                                                                  (grpMbrshipCtrl != null || chkGrpMbrshipCtrl != null), needMbrAttr);

            // New:: Change to Input/Output property <<START>>
            if (ldapEntry != null && propNames != null) {
                if (propNames.contains(SchemaConstantsInternal.PROP_DISPLAY_BRIDGE_PRINCIPAL_NAME)) {
                    String type = ldapEntry.getType();
                    LdapEntity entity = iLdapConfigMgr.getLdapEntity(type);
                    String attrName = entity.getAttribute(SchemaConstants.PROP_PRINCIPAL_NAME);
                    String[] attrIds = new String[] { attrName };
                    ArrayList<String> entityTypes = new ArrayList<String>(1);
                    entityTypes.add(type);
                    Attributes attrs = iLdapConn.getAttributesByUniqueName(ldapEntry.getUniqueName(), attrIds, entityTypes);
                    if (attrs != null) {
                        NamingEnumeration<? extends Attribute> attEnum = attrs.getAll();
                        while (attEnum.hasMoreElements()) {
                            try {
                                ldapEntry.getAttributes().put(attEnum.next());
                            } catch (NamingException e) {
                                /* Ignore. */
                            }
                        }
                    }

                    if (properties != null)
                        properties.add(SchemaConstants.PROP_PRINCIPAL_NAME);
                    else {
                        properties = new ArrayList<String>();
                        properties.add(SchemaConstants.PROP_PRINCIPAL_NAME);
                    }
                } else if (propNames.contains(SchemaConstantsInternal.PROP_DISPLAY_BRIDGE_CN)) {
                    String type = ldapEntry.getType();
                    LdapEntity entity = iLdapConfigMgr.getLdapEntity(type);
                    String attrName = entity.getAttribute("cn");
                    String[] attrIds = new String[] { attrName };
                    ArrayList<String> entityTypes = new ArrayList<String>(1);
                    entityTypes.add(type);
                    Attributes attrs = iLdapConn.getAttributesByUniqueName(ldapEntry.getUniqueName(), attrIds, entityTypes);
                    if (attrs != null) {
                        NamingEnumeration<? extends Attribute> attEnum = attrs.getAll();
                        while (attEnum.hasMoreElements()) {
                            try {
                                ldapEntry.getAttributes().put(attEnum.next());
                            } catch (NamingException e) {
                                /* Ignore. */
                            }
                        }
                    }

                    if (properties != null)
                        properties.add("cn");
                    else {
                        properties = new ArrayList<String>();
                        properties.add("cn");
                    }
                }
            }
            // New:: Change to Input/Output property <<END>>

            Entity outEntity = createEntityFromLdapEntry(outRoot, SchemaConstants.DO_ENTITIES, ldapEntry, properties);

            // If Cache needs to be cleared
            if (clearCacheForMembership) {
                // If fetched entity is a group
                if (iLdapConfigMgr.isGroup(ldapEntry.getType())) {
                    // If group member control is passed, clear the search cache.
                    // This is done in order to correctly fetch members of dynamic groups.
                    if (grpMbrCtrl != null)
                        iLdapConn.invalidateSearchCache();
                    // If the membership control is passed, clear the search cache as the membership will be determined
                    // by a search
                    if ((grpMbrshipCtrl != null || chkGrpMbrshipCtrl != null))
                        iLdapConn.invalidateSearchCache();
                }
                // If fetched entity is a person or person account
                else if (iLdapConfigMgr.isPerson(ldapEntry.getType()) || iLdapConfigMgr.isPersonAccount(ldapEntry.getType())) {
                    // If the membership control is passed.
                    if ((grpMbrshipCtrl != null || chkGrpMbrshipCtrl != null)) {
                        // If membership attribute is not specified, clear the search cache.
                        if (iLdapConfigMgr.getMembershipAttribute() != null) {
                            String mbrshipAttrName = iLdapConfigMgr.getMembershipAttribute();
                            Attribute mbrshipAttr = ldapEntry.getAttributes().get(mbrshipAttrName);
                            try {
                                // If membership attr is not found
                                if (mbrshipAttr == null || (mbrshipAttr.size() == 1 && mbrshipAttr.get(0) == null)) {
                                    iLdapConn.invalidateSearchCache();
                                }

                                // If membership attr does not include dynamic groups i.e. the membership attribute is defined but its scope is not "All"
                                // or if the membership attribute does not support dynamic groups, then the search results cache need to be cleared.
                                if (iLdapConfigMgr.getMembershipAttributeScope() != LDAP_ALL_GROUP_MEMBERSHIP && iLdapConfigMgr.supportDynamicGroup()) {
                                    iLdapConn.invalidateSearchCache();
                                }
                            } catch (NamingException e) {
                                // If there was any exception in fetching the attributes, clear the search results cache.
                                iLdapConn.invalidateSearchCache();
                            }
                        } else {
                            // If membership attribute is not defined, then clear the search results cache.
                            iLdapConn.invalidateSearchCache();
                        }
                    }
                }
            }

            // Retrieve groups
            getGroups(outEntity, ldapEntry, grpMbrshipCtrl);

            // Retrieve members if this is a group
            if (iLdapConfigMgr.isGroup(ldapEntry.getType())) {
                getMembers(outEntity, ldapEntry, grpMbrCtrl);
            }

            // Retrieve descendants
            getDescendants(outEntity, ldapEntry, descCtrl);

            // Retrieve ancestors
            getAncestors(outEntity, ldapEntry, ancesCtrl);

            if (chkGrpMbrshipCtrl != null) {
                int level = chkGrpMbrshipCtrl.getLevel();
                CheckGroupMembershipControl reChkCtrl = new CheckGroupMembershipControl();
                reChkCtrl.setInGroup(isMemberInGroup(inEntity, ldapEntry, level));
            }
        }

        return outRoot;
    }
1152290
private void installClientDecorations(JRootPane root) {
        installBorder(root);
        if (root.getParent() instanceof JFrame || root.getParent() instanceof JDialog) {
            if (PlatformUtils.isMac()) {
                makeFrameBackgroundTransparent(root);
            } else {
                shapeWindow(root);
            }
        }

        JComponent titlePane = createTitlePane(root);

        setTitlePane(root, titlePane);
        installWindowListeners(root, root.getParent());
        installLayout(root);
        if (window != null) {
            root.revalidate();
            root.repaint();
        }
    }
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
756354
private final void parseGlobalSettings (final Element root) {

        final NodeList globalConfiguration = root.getElementsByTagName(ELEMENT_GLOBAL);

        final ResultFunctionFactory resultFunctionFactory = new ResultFunctionFactory();
        Node parameter;
        NodeList parameters;
        NamedNodeMap attributes;
        SettingEntry key;
        for (int i = 0; i < globalConfiguration.getLength(); i++) {
            parameters = globalConfiguration.item(i).getChildNodes();

            for (int j = 0; j < parameters.getLength(); j++) {
                parameter = parameters.item(j);

                if (parameter.getNodeType() == Node.ELEMENT_NODE) {
                    attributes = parameter.getAttributes();

                    key = new SettingEntry();
                    key.setScope(attributes.getNamedItem(ATTRIBUTE_SCOPE).getNodeValue());
                    key.setResult(resultFunctionFactory.create(attributes.getNamedItem(ATTRIBUTE_RESULT).getNodeValue()));
                    // key.setSender(attributes.getNamedItem(ATTRIBUTE_SENDER).getNodeValue
                    // ());
                    key.setValue(parameter.getTextContent());

                    synchronized (globalConfig) {
                        globalConfig.put(OperationalTextKey.valueOfEx(parameter.getNodeName()), key);
                    }
                }
            }
        }
    }
1264022
public final void transformTables(final Element root) {
        final Collection<Element> tables; // Tables to fix

        checkNotNull(root, "Received a null pointer as root element");

        // Table rows with <th> tags in a <tbody>
        tables = root.select("table");
        for (final Element table : tables) {
            table.addClass("table");
            table.addClass("table-striped");
            table.addClass("table-bordered");
        }
    }
236506
public static LayerableConfig imports(Xml root)
    {
        Check.notNull(root);

        final Xml node = root.getChild(NODE_LAYERABLE);
        final int layerRefresh = node.readInteger(ATT_REFRESH);
        final int layerDisplay = node.readInteger(ATT_DISPLAY);

        return new LayerableConfig(layerRefresh, layerDisplay);
    }
604589
public static Frame getFrame(Component component)
    {
        while (component != null)
        {
            if (component instanceof Frame)
                return (Frame)component;
            component = component.getParent();
        }
        return null;
    }
1143809
public Node getRoot(Node node)
  {

    Node root = null;

    while (node != null)
    {
      root = node;
      node = getParentOfNode(node);
    }

    return root;
  }
192524
public Config getRoot()
  {
    Config root = this;
    while(root.parent != null) {
      root = root.parent;
    }
    return root;
  }
1257111
function( root ) {
		var config, next, i;

		if( this.isInitialised === false ) {
			throw new Error( 'Can\'t create config, layout not yet initialised' );
		}

		if( root && !( root instanceof lm.items.AbstractContentItem ) ) {
			throw new Error( 'Root must be a ContentItem' );
		}

		/*
		 * settings & labels
		 */
		config = {
			settings: lm.utils.copy( {}, this.config.settings ),
			dimensions: lm.utils.copy( {}, this.config.dimensions ),
			labels: lm.utils.copy( {}, this.config.labels )
		};

		/*
		 * Content
		 */
		config.content = [];
		next = function( configNode, item ) {
			var key, i;

			for( key in item.config ) {
				if( key !== 'content' ) {
					configNode[ key ] = item.config[ key ];
				}
			}

			if( item.contentItems.length ) {
				configNode.content = [];

				for( i = 0; i < item.contentItems.length; i++ ) {
					configNode.content[ i ] = {};
					next( configNode.content[ i ], item.contentItems[ i ] );
				}
			}
		};

		if( root ) {
			next( config, { contentItems: [ root ] } );
		} else {
			next( config, this.root );
		}

		/*
		 * Retrieve config for subwindows
		 */
		this._$reconcilePopoutWindows();
		config.openPopouts = [];
		for( i = 0; i < this.openPopouts.length; i++ ) {
			config.openPopouts.push( this.openPopouts[ i ].toConfig() );
		}

		/*
		 * Add maximised item
		 */
		config.maximisedItemId = this._maximisedItem ? '__glMaximised' : null;
		return config;
	}
922293
public ScriptNode transformTree(AstRoot root) {
        currentScriptOrFn = root;
        this.inUseStrictDirective = root.isInStrictMode();
        int sourceStartOffset = decompiler.getCurrentOffset();

        if (Token.printTrees) {
            System.out.println("IRFactory.transformTree");
            System.out.println(root.debugPrint());
        }
        ScriptNode script = (ScriptNode)transform(root);

        int sourceEndOffset = decompiler.getCurrentOffset();
        script.setEncodedSourceBounds(sourceStartOffset,
                                      sourceEndOffset);

        if (compilerEnv.isGeneratingSource()) {
            script.setEncodedSource(decompiler.getEncodedSource());
        }

        decompiler = null;
        return script;
    }
130242
public static ProducibleConfig imports(Xml root)
    {
        Check.notNull(root);

        final Xml node = root.getChild(NODE_PRODUCIBLE);
        final SizeConfig size = SizeConfig.imports(root);
        final int time = node.readInteger(ATT_STEPS);

        return new ProducibleConfig(time, size.getWidth(), size.getHeight());
    }
326222
public static LaunchableConfig imports(Xml node)
    {
        Check.notNull(node);

        final String media = node.readString(ATT_MEDIA);
        final int delay = node.readInteger(ATT_DELAY);
        final int ox = node.readInteger(0, ATT_OFFSET_X);
        final int oy = node.readInteger(0, ATT_OFFSET_Y);

        return new LaunchableConfig(media, delay, ox, oy, ForceConfig.imports(node));
    }
987816
public XMLNode parseXML(String root) {
        if (xmlElementsMap.containsKey(root)) {
            return xmlElementsMap.get(root);
        }
        try {
            currentRoot = root;
            isParsing = false;
            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser saxParser = factory.newSAXParser();
            InputStream in = configuration.getBuilderXML();
            saxParser.parse(in, this);
            return xmlElementsMap.get(root);
        } catch (Throwable t) {
            t.printStackTrace();
            throw new DocletAbortException(t);
        }
    }