mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 12:25:35 +02:00
[430900] RSE table enhancement to populate full column when clicking
column for sorting purposes
This commit is contained in:
parent
23e662c98c
commit
2acc687d5b
4 changed files with 2661 additions and 2619 deletions
|
@ -82,6 +82,7 @@
|
||||||
* Samuel Wu (IBM) - [398988] [ftp] FTP Only support to zVM
|
* 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
|
* 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) - [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;
|
package org.eclipse.rse.internal.files.ui.view;
|
||||||
|
@ -309,7 +310,7 @@ public class SystemViewRemoteFileAdapter
|
||||||
synchronized (_files){
|
synchronized (_files){
|
||||||
files = (IRemoteFile[])_files.toArray(new IRemoteFile[_files.size()]);
|
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];
|
IRemoteFile rFile = files[i];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -322,6 +323,9 @@ public class SystemViewRemoteFileAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
_permissionsJobMap.remove(_service);
|
_permissionsJobMap.remove(_service);
|
||||||
|
if (monitor.isCanceled()){
|
||||||
|
return Status.CANCEL_STATUS;
|
||||||
|
}
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
* 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
|
||||||
|
@ -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) - [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) - [357587] Custom sorter is changed to SystemTableViewSorter
|
||||||
* David McKnight (IBM) - [398306] table sorting of RSE table views inconsistent with Eclipse
|
* 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;
|
package org.eclipse.rse.internal.ui.view;
|
||||||
|
@ -95,8 +96,14 @@ public class SystemTableViewSorter extends ViewerSorter
|
||||||
|
|
||||||
// deal with equal objects
|
// deal with equal objects
|
||||||
if (name1 == name2){
|
if (name1 == name2){
|
||||||
|
if (_columnNumber > 0){
|
||||||
|
name1 = getValueFor(e1, 0);
|
||||||
|
name2 = getValueFor(e2, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
* David McKnight (IBM) - [363392] system table views shows open view actions when they shouldn't
|
* 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) - [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) - [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;
|
package org.eclipse.rse.ui.view;
|
||||||
|
@ -202,7 +203,6 @@ public class SystemTableView
|
||||||
|
|
||||||
private class HeaderSelectionListener extends SelectionAdapter
|
private class HeaderSelectionListener extends SelectionAdapter
|
||||||
{
|
{
|
||||||
|
|
||||||
public HeaderSelectionListener()
|
public HeaderSelectionListener()
|
||||||
{
|
{
|
||||||
_upI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID);
|
_upI = RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_MOVEUP_ID);
|
||||||
|
@ -225,6 +225,9 @@ public class SystemTableView
|
||||||
Table table = getTable();
|
Table table = getTable();
|
||||||
if (!table.isDisposed())
|
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
|
// column selected - need to sort
|
||||||
TableColumn tcolumn = (TableColumn)e.widget;
|
TableColumn tcolumn = (TableColumn)e.widget;
|
||||||
int column = table.indexOf(tcolumn);
|
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();
|
refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -472,6 +489,18 @@ public class SystemTableView
|
||||||
}
|
}
|
||||||
|
|
||||||
_objectInput = newObject;
|
_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();
|
computeLayout();
|
||||||
|
|
||||||
// reset the filter
|
// reset the filter
|
||||||
|
@ -1006,6 +1035,8 @@ public class SystemTableView
|
||||||
if (w != null)
|
if (w != null)
|
||||||
{
|
{
|
||||||
updateItem(w, child);
|
updateItem(w, child);
|
||||||
|
_provider.setSortOnly(true); // set sort only to avoid requery - after provider.getChildren(), this get automatically reset
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
ISelection selection = getSelection();
|
ISelection selection = getSelection();
|
||||||
|
@ -1018,7 +1049,6 @@ public class SystemTableView
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -1702,7 +1732,6 @@ public class SystemTableView
|
||||||
String[] newNames = null;
|
String[] newNames = null;
|
||||||
Object[] elements = null;
|
Object[] elements = null;
|
||||||
Object[] elementAdapters = null;
|
Object[] elementAdapters = null;
|
||||||
Object parentElement = null;
|
|
||||||
String renameMessage = null;
|
String renameMessage = null;
|
||||||
/**
|
/**
|
||||||
* RenameJob job.
|
* RenameJob job.
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
|
||||||
protected SimpleDateFormat _dateFormat = new SimpleDateFormat();
|
protected SimpleDateFormat _dateFormat = new SimpleDateFormat();
|
||||||
protected Viewer _viewer = null;
|
protected Viewer _viewer = null;
|
||||||
protected int _maxCharsInColumnZero = 0;
|
protected int _maxCharsInColumnZero = 0;
|
||||||
|
private boolean _sortOnly = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The cache of images that have been dispensed by this provider.
|
* 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.
|
* Constructor for table view provider where a column manager is present.
|
||||||
* In this case, the columns are customizable by the user.
|
* In this case, the columns are customizable by the user.
|
||||||
* @param columnManager
|
* @param columnManager the column manager
|
||||||
*/
|
*/
|
||||||
public SystemTableViewProvider(ISystemTableViewColumnManager columnManager)
|
public SystemTableViewProvider(ISystemTableViewColumnManager columnManager)
|
||||||
{
|
{
|
||||||
|
@ -163,14 +164,13 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
|
||||||
public Object[] getElements(Object object)
|
public Object[] getElements(Object object)
|
||||||
{
|
{
|
||||||
Object[] results = null;
|
Object[] results = null;
|
||||||
/*
|
if (_sortOnly && (object == _lastObject && (_lastResults != null && _lastResults.length > 0)))
|
||||||
if (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;
|
return _lastResults;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (object instanceof IAdaptable)
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
ISystemViewElementAdapter adapter = getAdapterFor(object);
|
ISystemViewElementAdapter adapter = getAdapterFor(object);
|
||||||
if (adapter != null)
|
if (adapter != null)
|
||||||
|
@ -383,7 +383,9 @@ public class SystemTableViewProvider implements ILabelProvider, ITableLabelProvi
|
||||||
|
|
||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
// TODO Auto-generated method stub
|
}
|
||||||
|
|
||||||
|
public void setSortOnly(boolean flag){
|
||||||
|
_sortOnly = flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue