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); }
//class Updater : IUpdater //{ // public GroupedTable m_Table; // public Grouping.GroupCollection m_GroupCollection; // long IUpdater.OldToNewGroupIndex(long a) // { // m_Table.m_GroupCollection.GetGroup(a).; // m_GroupCollection.GetGroup(a); // var f = m_Table.m_Fields.fieldIndices[a]; // var newIndex = System.Array.FindIndex(m_Fields.fieldIndices, x => x == a); // return newIndex; // } //} //public override IUpdater BeginUpdate() //{ // if (m_table.Update()) // { // return true; // } // var u = new Updater(); // u.m_Table = this; // u.m_Fields = BuildFieldList(); // return u; //} //public override void EndUpdate(IUpdater updater) //{ // SetFieldsList((updater as Updater).m_Fields); //} public override bool Update() { bool r = base.Update(); if (m_table.Update()) { return(true); } return(r); }