public override ViewPane GetDefaultView(UIState uiState, IViewPaneEventListener viewPaneEventListener) { //TODO: delete this method once the default for diff is treemap Database.Table table = null; for (int i = 1; i < uiState.CurrentMode.TableNames.Length; i++) { if (uiState.CurrentMode.TableNames[i].Contains(k_DefaultDiffViewTable)) { table = uiState.CurrentMode.GetTableByIndex(i - 1); } } if (table == null) { table = uiState.CurrentMode.GetTableByIndex(Mathf.Min(0, m_TableNames.Length - 1)); } if (table.Update()) { UpdateTableSelectionNames(); } var pane = new UI.SpreadsheetPane(uiState, viewPaneEventListener); pane.OpenTable(new Database.TableReference(table.GetName()), table); return(pane); }
void ReportFilterChanges() { m_FilterBuffer.Clear(); foreach (var filter in m_Filters.filters) { if (filter is Filter.Sort) { var sortFilter = (filter as Filter.Sort); var level = (sortFilter.SortLevel != null && sortFilter.SortLevel.Count > 0) ? sortFilter.SortLevel[0] : null; if (level == null) { continue; } string columnName = GetColumnName(level); m_FilterBuffer.Add(new MemoryProfilerAnalytics.Filter() { column = columnName, filterName = "Sort", filterInput = level.Order.ToString() }); } else if (filter is Filter.DefaultSort) { var sortFilter = (filter as Filter.DefaultSort); Filter.Sort.Level level = null; if (sortFilter.SortOverride != null && sortFilter.SortOverride.SortLevel != null && sortFilter.SortOverride.SortLevel.Count > 0) { level = sortFilter.SortOverride.SortLevel[0]; } if ((level == null || level.Order == SortOrder.None) && sortFilter.SortDefault != null && sortFilter.SortDefault.SortLevel != null && sortFilter.SortDefault.SortLevel.Count > 0) { level = sortFilter.SortDefault.SortLevel[0]; } if (level == null) { continue; } string columnName = GetColumnName(level); m_FilterBuffer.Add(new MemoryProfilerAnalytics.Filter() { column = columnName, filterName = "Sort", filterInput = level != null ? level.Order.ToString() : null }); } else if (filter is Filter.Group) { m_FilterBuffer.Add(new MemoryProfilerAnalytics.Filter() { column = (filter as Filter.Group).GetColumnName(m_TableDisplay), filterName = "Group" }); } else if (filter is Filter.Match) { var matchFilter = (filter as Filter.Match); m_FilterBuffer.Add(new MemoryProfilerAnalytics.Filter() { column = matchFilter.GetColumnName(m_TableDisplay), filterName = "Match", filterInput = matchFilter.MatchString }); } } MemoryProfilerAnalytics.FiltersChanged(m_TableDisplay.GetName(), m_FilterBuffer); }
public void OpenTable(Database.TableReference tableRef, Database.Table table) { Profiling.StartProfiling("Profile_OpenTable_" + table.GetName()); CloseCurrentTable(); m_CurrentTableLink = tableRef; CurrentTableIndex = m_UIState.CurrentMode.GetTableIndex(table); m_Spreadsheet = new UI.DatabaseSpreadsheet(m_UIState.FormattingOptions, table, this); m_Spreadsheet.onClickLink += OnSpreadsheetClick; m_EventListener.OnRepaint(); }
public GroupedTable(Database.Table table, ArrayRange range, int colToGroupFirst, int colToGroupLast, int[] colGroupOrder, SortOrder[] sortOrder) : base(table.Schema) { m_table = table; if (m_table is ExpandTable) { m_expandTable = (ExpandTable)m_table; } m_Meta = m_table.GetMetaData(); m_GroupedColumnFirst = colToGroupFirst; m_GroupedColumnLast = colToGroupLast; m_ColumnOrder = colGroupOrder; m_SortOrder = sortOrder; int sourceGroupedColumnIndex = m_ColumnOrder[colToGroupFirst]; var col = m_table.GetColumnByIndex(sourceGroupedColumnIndex); var metaCol = m_Meta.GetColumnByIndex(sourceGroupedColumnIndex); if (metaCol.DefaultGroupAlgorithm != null) { m_GroupCollection = metaCol.DefaultGroupAlgorithm.Group(col, range, m_SortOrder[colToGroupFirst]); } else { throw new Exception("Trying to group a column without grouping algorithm. Column '" + metaCol.Name + "' from table '" + m_table.GetName() + "'"); } InitializeFromGroupCollection(col, sourceGroupedColumnIndex); }
// colToGroup is an index from aNewColumnOrder. public GroupedTable(Database.Table table, ArrayRange range, int colToGroup, SortOrder sortOrder, FnCreateGroupTable subTable) : base(table.Schema) { m_table = table; if (m_table is ExpandTable) { m_expandTable = (ExpandTable)m_table; } m_Meta = m_table.GetMetaData(); m_GroupedColumnFirst = 0; m_GroupedColumnLast = 0; m_ColumnOrder = new int[] { colToGroup };// colGroupOrder; m_SortOrder = new SortOrder[1] { sortOrder }; m_createGroupTable = subTable; var col = m_table.GetColumnByIndex(colToGroup); var metaCol = m_Meta.GetColumnByIndex(colToGroup); if (metaCol.DefaultGroupAlgorithm != null) { m_GroupCollection = metaCol.DefaultGroupAlgorithm.Group(col, range, sortOrder); } else { throw new Exception("Trying to group a column without grouping algorithm. Column '" + metaCol.Name + "' from table '" + m_table.GetName() + "'"); } InitializeFromGroupCollection(col, colToGroup); }