mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 13:35:22 +02:00
[239390] [update policy] Update Scopes -- update only visible, update all elements
This commit is contained in:
parent
412113eec5
commit
a91b6292df
1 changed files with 81 additions and 4 deletions
|
@ -920,19 +920,24 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
|
|
||||||
private void updateExpanded(final IVMModelProxyExtension proxyStrategy, final Object viewerInput, final TreePath path, final RequestMonitor rm)
|
private void updateExpanded(final IVMModelProxyExtension proxyStrategy, final Object viewerInput, final TreePath path, final RequestMonitor rm)
|
||||||
{
|
{
|
||||||
|
final IPresentationContext presentationContext = getPresentationContext();
|
||||||
|
final String[] columns = presentationContext.getColumns();
|
||||||
|
|
||||||
this.update(new IChildrenUpdate[] { new VMChildrenUpdate(
|
this.update(new IChildrenUpdate[] { new VMChildrenUpdate(
|
||||||
path, viewerInput,
|
path, viewerInput,
|
||||||
getPresentationContext(), -1, -1, new DataRequestMonitor<List<Object>>(getExecutor(), null) {
|
presentationContext, -1, -1, new DataRequestMonitor<List<Object>>(getExecutor(), null) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleCompleted() {
|
protected void handleCompleted() {
|
||||||
if (getData() != null) {
|
if (getData() != null) {
|
||||||
TreeViewer viewer = (TreeViewer) proxyStrategy.getViewer();
|
TreeViewer viewer = (TreeViewer) proxyStrategy.getViewer();
|
||||||
|
|
||||||
int expandedCount = 0;
|
int expandedCount = 0;
|
||||||
|
int elementCount = 0;
|
||||||
|
|
||||||
final CountingRequestMonitor multiRm = new CountingRequestMonitor(getExecutor(), rm);
|
final CountingRequestMonitor multiRm = new CountingRequestMonitor(getExecutor(), rm);
|
||||||
|
|
||||||
for(Object data : getData())
|
|
||||||
|
for(final Object data : getData())
|
||||||
{
|
{
|
||||||
if(viewer.getExpandedState(data))
|
if(viewer.getExpandedState(data))
|
||||||
{
|
{
|
||||||
|
@ -945,9 +950,81 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
updateExpanded(proxyStrategy, viewerInput, new TreePath(childPathSegments), multiRm);
|
updateExpanded(proxyStrategy, viewerInput, new TreePath(childPathSegments), multiRm);
|
||||||
expandedCount++;
|
expandedCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data instanceof IAdaptable)
|
||||||
|
{
|
||||||
|
elementCount++;
|
||||||
|
IElementLabelProvider labelProvider = (IElementLabelProvider) ((IAdaptable) data).getAdapter(IElementLabelProvider.class);
|
||||||
|
|
||||||
|
labelProvider.update(new ILabelUpdate[] {
|
||||||
|
new ILabelUpdate()
|
||||||
|
{
|
||||||
|
public Object getElement() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreePath getElementPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPresentationContext getPresentationContext() {
|
||||||
|
return presentationContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getViewerInput() {
|
||||||
|
return viewerInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cancel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public IStatus getStatus() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCanceled() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(IStatus status) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getColumnIds() {
|
||||||
|
return columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackground(RGB arg0, int arg1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFontData(FontData arg0, int arg1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForeground(RGB arg0, int arg1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageDescriptor(ImageDescriptor arg0, int arg1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String arg0, int arg1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void done() {
|
||||||
|
|
||||||
|
multiRm.done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
multiRm.setDoneCount(expandedCount);
|
multiRm.setDoneCount(expandedCount + elementCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})});
|
})});
|
||||||
|
|
Loading…
Add table
Reference in a new issue