1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 14:35:23 +02:00

[357587] Custom sorter is changed to SystemTableViewSorter

This commit is contained in:
David McKnight 2011-09-30 15:29:41 +00:00
parent 3980021afc
commit a2ddd3a6b8
3 changed files with 35 additions and 18 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2010 IBM Corporation and others. * Copyright (c) 2002, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -18,6 +18,7 @@
* Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread
* David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields * David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields
* David McKnight (IBM) - [296877] Allow user to choose the attributes for remote search result * David McKnight (IBM) - [296877] Allow user to choose the attributes for remote search result
* David McKnight (IBM) - [357587] Custom sorter is changed to SystemTableViewSorter
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
@ -217,8 +218,9 @@ public class SystemTableTreeView
TreeColumn tcolumn = (TreeColumn)e.widget; TreeColumn tcolumn = (TreeColumn)e.widget;
int column = table.indexOf(tcolumn); int column = table.indexOf(tcolumn);
SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter(); SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
if (oldSorter != null && column == oldSorter.getColumnNumber()) if (oldSorter != null)
{ {
if (column == oldSorter.getColumnNumber()){
oldSorter.setReversed(!oldSorter.isReversed()); oldSorter.setReversed(!oldSorter.isReversed());
if (tcolumn.getImage() == _upI) if (tcolumn.getImage() == _upI)
{ {
@ -229,6 +231,10 @@ public class SystemTableTreeView
tcolumn.setImage(_upI); tcolumn.setImage(_upI);
} }
} }
else {
oldSorter.setColumnNumber(column);
}
}
else else
{ {
setSorter(new SystemTableViewSorter(column, SystemTableTreeView.this, _columnManager)); setSorter(new SystemTableViewSorter(column, SystemTableTreeView.this, _columnManager));

View file

@ -14,6 +14,7 @@
* Contributors: * Contributors:
* David McKnight (IBM) - [331986] Sort in Remote System Details view shows wrong results * David McKnight (IBM) - [331986] Sort in Remote System Details view shows wrong results
* David McKnight (IBM) - [355467] The result of sorting resources that contains null blank cells is not correct in Remote System Details view. * David McKnight (IBM) - [355467] The result of sorting resources that contains null blank cells is not correct in Remote System Details view.
* David McKnight (IBM) - [357587] Custom sorter is changed to SystemTableViewSorter
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
@ -53,6 +54,10 @@ public class SystemTableViewSorter extends ViewerSorter
_columnManager = columnManager; _columnManager = columnManager;
} }
public void setColumnNumber(int columnNumber){
_columnNumber = columnNumber;
}
public boolean isSorterProperty(java.lang.Object element, java.lang.Object property) public boolean isSorterProperty(java.lang.Object element, java.lang.Object property)
{ {
return true; return true;

View file

@ -29,6 +29,7 @@
* David McKnight (IBM) - [308783] Value in Properties view remains "Pending..." * David McKnight (IBM) - [308783] Value in Properties view remains "Pending..."
* David McKnight (IBM) - [215814] [performance] Duplicate Queries between Table and Remote Systems View * David McKnight (IBM) - [215814] [performance] Duplicate Queries between Table and Remote Systems View
* David McKnight (IBM) - [340912] inconsistencies with columns in RSE table viewers * David McKnight (IBM) - [340912] inconsistencies with columns in RSE table viewers
* David McKnight (IBM) - [357587] Custom sorter is changed to SystemTableViewSorter
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.view; package org.eclipse.rse.ui.view;
@ -224,8 +225,9 @@ public class SystemTableView
TableColumn tcolumn = (TableColumn)e.widget; TableColumn tcolumn = (TableColumn)e.widget;
int column = table.indexOf(tcolumn); int column = table.indexOf(tcolumn);
SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter(); SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
if (oldSorter != null && column == oldSorter.getColumnNumber()) if (oldSorter != null)
{ {
if (column == oldSorter.getColumnNumber()){
oldSorter.setReversed(!oldSorter.isReversed()); oldSorter.setReversed(!oldSorter.isReversed());
if (tcolumn.getImage() == _upI) if (tcolumn.getImage() == _upI)
{ {
@ -236,6 +238,10 @@ public class SystemTableView
tcolumn.setImage(_upI); tcolumn.setImage(_upI);
} }
} }
else {
oldSorter.setColumnNumber(column);
}
}
else else
{ {
setSorter(new SystemTableViewSorter(column, SystemTableView.this, _columnManager)); setSorter(new SystemTableViewSorter(column, SystemTableView.this, _columnManager));