Exemplo n.º 1
0
        public override IEnumerable <Node> GenerateTreeViewData(Variables.Root variables, File file)
        {
            JavaFileInfo info = variables.GetStateObject <JavaState>(this).GetFile(file);

            foreach (Type type in info.Types)
            {
                yield return(GenerateTreeViewDataForType(info, type));
            }
        }
Exemplo n.º 2
0
        public override void Process(File file, Variables.Root variables)
        {
            base.Process(file, variables);

            JavaState    state = variables.GetStateObject <JavaState>(this);
            JavaFileInfo info  = state.Process(file);

            variables.Increment("javaImportsTotal", info.Imports.Count);
            variables.Maximum("javaImportsMax", info.Imports.Count);

            foreach (Type type in info.Types)
            {
                ProcessType(info.Package, type, variables, false);
            }
        }
Exemplo n.º 3
0
        private static Node GenerateTreeViewDataForType(JavaFileInfo fileInfo, Type type)
        {
            Type.TypeData data     = type.GetData();
            Type.DataEnum dataEnum = data as Type.DataEnum;

            Node node = new Node(type.ToString());

            if (fileInfo != null)
            {
                Node packageNode = new Node("[Package]");
                packageNode.Add(fileInfo.Package);
                node.Add(packageNode);

                Node importNode = new Node("[Imports]");
                importNode.AddRangeAsStrings(fileInfo.Imports);
                node.Add(importNode);
            }

            if (data.Fields.Count > 0)
            {
                Node fieldNode = new Node("[Fields]");
                fieldNode.AddRangeAsStrings(data.Fields);
                node.Add(fieldNode);
            }

            if (data.Methods.Count > 0)
            {
                Node methodNode = new Node("[Methods]");
                methodNode.AddRangeAsStrings(data.Methods);
                node.Add(methodNode);
            }

            if (type.NestedTypes.Count > 0)
            {
                Node nestedNode = new Node("[Nested Types]");
                nestedNode.AddRange(type.NestedTypes.Select(nestedType => GenerateTreeViewDataForType(null, nestedType)));
                node.Add(nestedNode);
            }

            if (dataEnum != null)
            {
                Node enumNode = new Node("[Enum Values]");
                enumNode.AddRange(dataEnum.EnumValues);
                node.Add(enumNode);
            }

            return(node);
        }