1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

[430900] RSE table enhancement to populate full column when clicking

column for sorting purposes
This commit is contained in:
Dave McKnight 2014-03-21 14:50:54 -04:00
parent 23e662c98c
commit 2acc687d5b
4 changed files with 2661 additions and 2619 deletions

View file

@ -82,6 +82,7 @@
* Samuel Wu (IBM) - [398988] [ftp] FTP Only support to zVM
* Xuan Chen (IBM) - [399101] RSE edit actions on local files that map to actually workspace resources should not use temp files
* David McKnight (IBM) - [420798] Slow performances in RDz 9.0 with opening 7000 files located on a network driver.
* David McKnight (IBM) - [430900] RSE table enhancement to populate full column when clicking column for sorting purposes
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.view;
@ -309,7 +310,7 @@ public class SystemViewRemoteFileAdapter
synchronized (_files){
files = (IRemoteFile[])_files.toArray(new IRemoteFile[_files.size()]);
}
for (int i = 0; i < files.length; i++){
for (int i = 0; i < files.length && !monitor.isCanceled(); i++){
IRemoteFile rFile = files[i];
try {
@ -322,6 +323,9 @@ public class SystemViewRemoteFileAdapter
}
_permissionsJobMap.remove(_service);
if (monitor.isCanceled()){
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2013 IBM Corporation and others.
* Copyright (c) 2002, 2014 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
@ -16,6 +16,7 @@
* 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
* David McKnight (IBM) - [398306] table sorting of RSE table views inconsistent with Eclipse
* David McKnight (IBM) - [430900] RSE table enhancement to populate full column when clicking column for sorting purposes
*******************************************************************************/
package org.eclipse.rse.internal.ui.view;
@ -95,8 +96,14 @@ public class SystemTableViewSorter extends ViewerSorter
// deal with equal objects
if (name1 == name2){
if (_columnNumber > 0){
name1 = getValueFor(e1, 0);
name2 = getValueFor(e2, 0);
}
else {
return 0;
}
}
try
{

View file

@ -33,6 +33,7 @@
* David McKnight (IBM) - [363392] system table views shows open view actions when they shouldn't
* David McKnight (IBM) - [388947] column sort icon issue with Remote Systems Details view
* David McKnight (IBM) - [398306] table sorting of RSE table views inconsistent with Eclipse
* David McKnight (IBM) - [430900] RSE table enhancement to populate full column when clicking column for sorting purposes
********************************************************************************/
package org.eclipse.rse.ui.view;
@ -202,7 +203,6 @@ public class SystemTableView
private class HeaderSelectionListener extends SelectionAdapter
{
public HeaderSelectionListener()
{
_upI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID);
@ -225,6 +225,9 @@ public class SystemTableView
Table table = getTable();
if (!table.isDisposed())
{
// setting the sorter can trigger a query
_provider.setSortOnly(true); // set sort only to avoid requery - after provider.getChildren(), this get automatically reset
// column selected - need to sort
TableColumn tcolumn = (TableColumn)e.widget;
int column = table.indexOf(tcolumn);
@ -265,6 +268,20 @@ public class SystemTableView
}
}
}
// update all items in column to ensure they're visible
TableItem[] items = table.getItems();
if (items != null && items.length > 0){
for (int i = 0; i < items.length; i++){
TableItem item = items[i];
Object data = item.getData();
if (data == null){
table.showItem(item);
}
}
table.showItem(items[0]);
}
_provider.setSortOnly(true); // set sort only to avoid requery - after provider.getChildren(), this get automatically reset
refresh();
}
}
@ -472,6 +489,18 @@ public class SystemTableView
}
_objectInput = newObject;
// clear sorter
SystemTableViewSorter oldSorter = (SystemTableViewSorter) getSorter();
if (oldSorter != null){
int colNo = oldSorter.getColumnNumber();
TableColumn col = getTable().getColumn(colNo);
if (col != null){ // remove sort icon
col.setImage(null);
}
setSorter(null);
}
computeLayout();
// reset the filter
@ -1006,6 +1035,8 @@ public class SystemTableView
if (w != null)
{
updateItem(w, child);
_provider.setSortOnly(true); // set sort only to avoid requery - after provider.getChildren(), this get automatically reset
refresh();
}
ISelection selection = getSelection();
@ -1018,7 +1049,6 @@ public class SystemTableView
}
catch (Exception e)
{
}
}
return;
@ -1702,7 +1732,6 @@ public class SystemTableView
String[] newNames = null;
Object[] elements = null;
Object[] elementAdapters = null;
Object parentElement = null;
String renameMessage = null;
/**
* RenameJob job.

View file

@ -66,6 +66,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
protected SimpleDateFormat _dateFormat = new SimpleDateFormat();
protected Viewer _viewer = null;
protected int _maxCharsInColumnZero = 0;
private boolean _sortOnly = false;
/**
* The cache of images that have been dispensed by this provider.
@ -77,7 +78,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
/**
* Constructor for table view provider where a column manager is present.
* In this case, the columns are customizable by the user.
* @param columnManager
* @param columnManager the column manager
*/
public SystemTableViewProvider(ISystemTableViewColumnManager columnManager)
{
@ -163,14 +164,13 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
public Object[] getElements(Object object)
{
Object[] results = null;
/*
if (object == _lastObject && (_lastResults != null && _lastResults.length > 0)
if (_sortOnly && (object == _lastObject && (_lastResults != null && _lastResults.length > 0)))
{
// _sortOnly is used to by-pass a remote query when we're just sorting by columns
_sortOnly = false; // after using the cache once, revert back to normal query
return _lastResults;
}
else
if (object instanceof IAdaptable)
*/
{
ISystemViewElementAdapter adapter = getAdapterFor(object);
if (adapter != null)
@ -383,7 +383,9 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
public void dispose()
{
// TODO Auto-generated method stub
}
public void setSortOnly(boolean flag){
_sortOnly = flag;
}
}