Exemplo n.º 1
0
 public AnalysisView(AnalysisViewDescriptor desc, ProjectAuditorConfig config, IIssuesFilter filter)
 {
     m_Desc   = desc;
     m_Config = config;
     m_Filter = filter;
     m_Table  = null;
 }
Exemplo n.º 2
0
        public virtual void Create(ViewDescriptor descriptor, IssueLayout layout, ProjectAuditorConfig config, Preferences prefs, IProjectIssueFilter filter)
        {
            m_Desc        = descriptor;
            m_Config      = config;
            m_Preferences = prefs;
            m_Filter      = filter;
            m_Layout      = layout;

            if (m_Table != null)
            {
                return;
            }

            var state   = new TreeViewState();
            var columns = new MultiColumnHeaderState.Column[layout.properties.Length];

            for (var i = 0; i < layout.properties.Length; i++)
            {
                var property = layout.properties[i];

                var width = 80;
                switch (property.type)
                {
                case PropertyType.Description:
                    width = 300;
                    break;

                case PropertyType.Path:
                    width = 500;
                    break;

                case PropertyType.Severity:
                    width = 24;
                    break;
                }

                columns[i] = new MultiColumnHeaderState.Column
                {
                    headerContent = new GUIContent(property.name, layout.properties[i].longName),
                    width         = width,
                    minWidth      = 20,
                    autoResize    = true
                };
            }

            m_Table = new IssueTable(state,
                                     new MultiColumnHeader(new MultiColumnHeaderState(columns)),
                                     m_Desc,
                                     layout,
                                     m_Config,
                                     m_Filter);

            if (m_Desc.showDependencyView)
            {
                m_DependencyView = new DependencyView(new TreeViewState(), m_Desc.onDoubleClick);
            }

            SetFlatView(m_FlatView);
        }
Exemplo n.º 3
0
 public AnalysisView(AnalysisViewDescriptor desc, ProjectAuditorConfig config, Preferences prefs, IProjectIssueFilter filter)
 {
     m_Desc        = desc;
     m_Config      = config;
     m_Preferences = prefs;
     m_Filter      = filter;
     m_Table       = null;
 }
Exemplo n.º 4
0
        public void CreateTable(AnalysisViewDescriptor desc, ProjectAuditorConfig config, Preferences prefs, IProjectIssueFilter filter)
        {
            m_Desc        = desc;
            m_Config      = config;
            m_Preferences = prefs;
            m_Filter      = filter;

            if (m_Table != null)
            {
                return;
            }

            var state   = new TreeViewState();
            var columns = new MultiColumnHeaderState.Column[m_Desc.columnTypes.Length];

            for (var i = 0; i < columns.Length; i++)
            {
                var columnType = m_Desc.columnTypes[i];

                ColumnDescriptor style;
                if (columnType == IssueTable.ColumnType.Description && m_Desc.descriptionColumnStyle.Content != null)
                {
                    style = m_Desc.descriptionColumnStyle;
                }
                else if (columnType < IssueTable.ColumnType.Custom)
                {
                    style = Styles.Columns[(int)columnType];
                }
                else
                {
                    style = m_Desc.customColumnStyles[columnType - IssueTable.ColumnType.Custom];
                }

                columns[i] = new MultiColumnHeaderState.Column
                {
                    headerContent = style.Content,
                    width         = style.Width,
                    minWidth      = style.MinWidth,
                    autoResize    = true
                };
            }

            m_Table = new IssueTable(state,
                                     new MultiColumnHeader(new MultiColumnHeaderState(columns)),
                                     m_Desc,
                                     m_Config,
                                     m_Filter);

            if (m_Desc.showDependencyView)
            {
                m_DependencyView = new DependencyView(new TreeViewState(), m_Desc.onDoubleClick);
            }
        }
Exemplo n.º 5
0
        public void CreateTable(Preferences prefs)
        {
            if (m_Table != null)
            {
                return;
            }

            var state   = new TreeViewState();
            var columns = new MultiColumnHeaderState.Column[m_Desc.columnDescriptors.Length];

            for (var i = 0; i < columns.Length; i++)
            {
                var columnEnum = m_Desc.columnDescriptors[i];

                ColumnStyle style;
                if (columnEnum < IssueTable.Column.Custom)
                {
                    style = Styles.Columns[(int)columnEnum];
                }
                else
                {
                    style = m_Desc.costumColumnStyles[columnEnum - IssueTable.Column.Custom];
                }

                columns[i] = new MultiColumnHeaderState.Column
                {
                    headerContent = style.Content,
                    width         = style.Width,
                    minWidth      = style.MinWidth,
                    autoResize    = true
                };
            }

            m_Table = new IssueTable(state,
                                     new MultiColumnHeader(new MultiColumnHeaderState(columns)),
                                     m_Desc,
                                     m_Config,
                                     prefs,
                                     m_Filter);

            if (m_Desc.showDependencyView)
            {
                m_DependencyView = new DependencyView(new TreeViewState(), m_Desc.onDoubleClick);
            }
        }
Exemplo n.º 6
0
        public void CreateTable()
        {
            if (m_Table != null)
            {
                return;
            }

            var state       = new TreeViewState();
            var columnsList = new List <MultiColumnHeaderState.Column>();
            var numColumns  = (int)IssueTable.Column.Count;

            for (var i = 0; i < numColumns; i++)
            {
                var width    = 0;
                var minWidth = 0;
                switch ((IssueTable.Column)i)
                {
                case IssueTable.Column.Description:
                    width    = 300;
                    minWidth = 100;
                    break;

                case IssueTable.Column.Priority:
                    if (m_Desc.showCritical)
                    {
                        width    = 22;
                        minWidth = 22;
                    }
                    break;

                case IssueTable.Column.Area:
                    width    = 60;
                    minWidth = 50;
                    break;

                case IssueTable.Column.Filename:
                    if (m_Desc.showFilenameColumn)
                    {
                        width    = 180;
                        minWidth = 100;
                    }

                    break;

                case IssueTable.Column.Assembly:
                    if (m_Desc.showAssemblyColumn)
                    {
                        width    = 180;
                        minWidth = 100;
                    }

                    break;
                }

                columnsList.Add(new MultiColumnHeaderState.Column
                {
                    headerContent = Styles.ColumnHeaders[i],
                    width         = width,
                    minWidth      = minWidth,
                    autoResize    = true
                });
            }

            m_Table = new IssueTable(state,
                                     new MultiColumnHeader(new MultiColumnHeaderState(columnsList.ToArray())),
                                     m_Desc.groupByDescription,
                                     m_Config,
                                     m_Filter);
        }