1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 22:25:25 +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
* are made available under the terms of the Eclipse Public License v1.0
* 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
* 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) - [357587] Custom sorter is changed to SystemTableViewSorter
*******************************************************************************/
package org.eclipse.rse.internal.ui.view;
@ -217,16 +218,21 @@ public class SystemTableTreeView
TreeColumn tcolumn = (TreeColumn)e.widget;
int column = table.indexOf(tcolumn);
SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
if (oldSorter != null && column == oldSorter.getColumnNumber())
if (oldSorter != null)
{
oldSorter.setReversed(!oldSorter.isReversed());
if (tcolumn.getImage() == _upI)
{
tcolumn.setImage(_downI);
if (column == oldSorter.getColumnNumber()){
oldSorter.setReversed(!oldSorter.isReversed());
if (tcolumn.getImage() == _upI)
{
tcolumn.setImage(_downI);
}
else
{
tcolumn.setImage(_upI);
}
}
else
{
tcolumn.setImage(_upI);
else {
oldSorter.setColumnNumber(column);
}
}
else

View file

@ -14,6 +14,7 @@
* Contributors:
* 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) - [357587] Custom sorter is changed to SystemTableViewSorter
*******************************************************************************/
package org.eclipse.rse.internal.ui.view;
@ -52,6 +53,10 @@ public class SystemTableViewSorter extends ViewerSorter
_view = view;
_columnManager = columnManager;
}
public void setColumnNumber(int columnNumber){
_columnNumber = columnNumber;
}
public boolean isSorterProperty(java.lang.Object element, java.lang.Object property)
{

View file

@ -29,6 +29,7 @@
* 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) - [340912] inconsistencies with columns in RSE table viewers
* David McKnight (IBM) - [357587] Custom sorter is changed to SystemTableViewSorter
********************************************************************************/
package org.eclipse.rse.ui.view;
@ -224,18 +225,23 @@ public class SystemTableView
TableColumn tcolumn = (TableColumn)e.widget;
int column = table.indexOf(tcolumn);
SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
if (oldSorter != null && column == oldSorter.getColumnNumber())
if (oldSorter != null)
{
oldSorter.setReversed(!oldSorter.isReversed());
if (tcolumn.getImage() == _upI)
{
tcolumn.setImage(_downI);
if (column == oldSorter.getColumnNumber()){
oldSorter.setReversed(!oldSorter.isReversed());
if (tcolumn.getImage() == _upI)
{
tcolumn.setImage(_downI);
}
else
{
tcolumn.setImage(_upI);
}
}
else
{
tcolumn.setImage(_upI);
else {
oldSorter.setColumnNumber(column);
}
}
}
else
{
setSorter(new SystemTableViewSorter(column, SystemTableView.this, _columnManager));