mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
bug 157719 - Moving transient message processing to expand time.
Instead of removing transient messages (the empty list is one of these) on collapse, we now remove them just prior to expand. This allows the expand/collapse indicators to be be correct when viewing the tree.
This commit is contained in:
parent
7eee05d6c0
commit
cb9c4eb6cc
2 changed files with 90 additions and 100 deletions
|
@ -71,6 +71,7 @@ import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.model.ISystemContainer;
|
import org.eclipse.rse.core.model.ISystemContainer;
|
||||||
import org.eclipse.rse.core.model.ISystemMessageObject;
|
import org.eclipse.rse.core.model.ISystemMessageObject;
|
||||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||||
|
import org.eclipse.rse.core.model.SystemMessageObject;
|
||||||
import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
|
import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.model.ISystemPromptableObject;
|
import org.eclipse.rse.model.ISystemPromptableObject;
|
||||||
|
@ -82,6 +83,7 @@ import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||||
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
||||||
import org.eclipse.rse.model.SystemRegistry;
|
import org.eclipse.rse.model.SystemRegistry;
|
||||||
import org.eclipse.rse.model.SystemRemoteElementResourceSet;
|
import org.eclipse.rse.model.SystemRemoteElementResourceSet;
|
||||||
|
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||||
import org.eclipse.rse.ui.ISystemDeleteTarget;
|
import org.eclipse.rse.ui.ISystemDeleteTarget;
|
||||||
|
@ -104,6 +106,7 @@ import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
|
||||||
import org.eclipse.rse.ui.actions.SystemShowInMonitorAction;
|
import org.eclipse.rse.ui.actions.SystemShowInMonitorAction;
|
||||||
import org.eclipse.rse.ui.actions.SystemShowInTableAction;
|
import org.eclipse.rse.ui.actions.SystemShowInTableAction;
|
||||||
import org.eclipse.rse.ui.actions.SystemSubMenuManager;
|
import org.eclipse.rse.ui.actions.SystemSubMenuManager;
|
||||||
|
import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
|
||||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
@ -142,7 +145,7 @@ import org.eclipse.ui.views.framelist.GoIntoAction;
|
||||||
* to access remote objects in the remote system.
|
* to access remote objects in the remote system.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Used to implement the following as well: MenuListener, IDoubleClickListener, ArmListener, IWireEventTarget
|
* At one time implemented the following as well: MenuListener, IDoubleClickListener, ArmListener, IWireEventTarget
|
||||||
*/
|
*/
|
||||||
public class SystemView extends TreeViewer implements ISystemTree, ISystemResourceChangeListener, ISystemRemoteChangeListener, IMenuListener,
|
public class SystemView extends TreeViewer implements ISystemTree, ISystemResourceChangeListener, ISystemRemoteChangeListener, IMenuListener,
|
||||||
ISelectionChangedListener, ISelectionProvider, ITreeViewerListener, ISystemResourceChangeEvents, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget
|
ISelectionChangedListener, ISelectionProvider, ITreeViewerListener, ISystemResourceChangeEvents, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget
|
||||||
|
@ -293,6 +296,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the input provider. Sometimes this is delayed, or can change.
|
* Set the input provider. Sometimes this is delayed, or can change.
|
||||||
|
* @param inputProvider the input provider for this view.
|
||||||
*/
|
*/
|
||||||
public void setInputProvider(ISystemViewInputProvider inputProvider) {
|
public void setInputProvider(ISystemViewInputProvider inputProvider) {
|
||||||
this.inputProvider = inputProvider;
|
this.inputProvider = inputProvider;
|
||||||
|
@ -600,7 +604,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the collapse action
|
* @return the collapse action. Lazily creates it.
|
||||||
*/
|
*/
|
||||||
public IAction getCollapseAction() {
|
public IAction getCollapseAction() {
|
||||||
if (collapseAction == null) collapseAction = new SystemCollapseAction(getShell());
|
if (collapseAction == null) collapseAction = new SystemCollapseAction(getShell());
|
||||||
|
@ -608,7 +612,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the expand action
|
* @return the expand action. Lazily creates it.
|
||||||
*/
|
*/
|
||||||
public IAction getExpandAction() {
|
public IAction getExpandAction() {
|
||||||
if (expandAction == null) expandAction = new SystemExpandAction(getShell());
|
if (expandAction == null) expandAction = new SystemExpandAction(getShell());
|
||||||
|
@ -1166,32 +1170,14 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after tree item collapsed
|
* Called after tree item collapsed. Updates the children of the tree item being
|
||||||
|
* collapsed by removing the widgets associated with any transient message objects
|
||||||
|
* that were in the tree.
|
||||||
|
* @param event the event that caused the collapse. The event data will include the
|
||||||
|
* tree element being collapsed.
|
||||||
*/
|
*/
|
||||||
public void treeCollapsed(TreeExpansionEvent event) {
|
public void treeCollapsed(TreeExpansionEvent event) {
|
||||||
//if (true)
|
|
||||||
//return;
|
|
||||||
final Object element = event.getElement(); // get parent node being collapsed
|
final Object element = event.getElement(); // get parent node being collapsed
|
||||||
Widget widget = findItem(element); // find GUI widget for this node
|
|
||||||
if ((widget != null) && (widget instanceof Item)) {
|
|
||||||
Item ti = (Item) widget;
|
|
||||||
Item[] items = getItems(ti);
|
|
||||||
|
|
||||||
//D51021 if ((items!=null) && (items.length==1))
|
|
||||||
if (items != null) {
|
|
||||||
for (int i = 0; i < items.length; i++) {
|
|
||||||
Object data = items[i].getData();
|
|
||||||
if ((data != null) && (data instanceof ISystemMessageObject)) {
|
|
||||||
if (((ISystemMessageObject) data).isTransient()) {
|
|
||||||
disassociate(items[i]);
|
|
||||||
items[i].dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// append a dummy so there is a plus
|
|
||||||
if (getItemCount(ti) == 0) newItem(ti, SWT.NULL, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// we always allow adapters opportunity to show a different icon depending on collapsed state
|
// we always allow adapters opportunity to show a different icon depending on collapsed state
|
||||||
getShell().getDisplay().asyncExec(new Runnable() {
|
getShell().getDisplay().asyncExec(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -1204,10 +1190,10 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
/**
|
/**
|
||||||
* Called after tree item expanded.
|
* Called after tree item expanded.
|
||||||
* We need this hook to potentially undo user expand request.
|
* We need this hook to potentially undo user expand request.
|
||||||
|
* @param event the SWT TreeExpansionEvent that caused the expansion.
|
||||||
*/
|
*/
|
||||||
public void treeExpanded(TreeExpansionEvent event) {
|
public void treeExpanded(TreeExpansionEvent event) {
|
||||||
expandingTreeOnly = true;
|
expandingTreeOnly = true;
|
||||||
//System.out.println("tree expanded");
|
|
||||||
final Object element = event.getElement();
|
final Object element = event.getElement();
|
||||||
// we always allow adapters opportunity to show a different icon depending on expanded state
|
// we always allow adapters opportunity to show a different icon depending on expanded state
|
||||||
getShell().getDisplay().asyncExec(new Runnable() {
|
getShell().getDisplay().asyncExec(new Runnable() {
|
||||||
|
@ -1219,35 +1205,44 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* Handles a tree expand event from the SWT widget.
|
* Here only for observability.
|
||||||
* An interception of parent method to set the cursor to busy if the user is expanding a connection.
|
* @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeCollapse(org.eclipse.swt.events.TreeEvent)
|
||||||
*
|
*/
|
||||||
* @param event the SWT tree event
|
protected void handleTreeCollapse(TreeEvent event) {
|
||||||
|
super.handleTreeCollapse(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeExpand(org.eclipse.swt.events.TreeEvent)
|
||||||
*/
|
*/
|
||||||
protected void handleTreeExpand(TreeEvent event) {
|
protected void handleTreeExpand(TreeEvent event) {
|
||||||
Widget item = event.item;
|
TreeItem item = (TreeItem) event.item;
|
||||||
boolean cursorSet = false;
|
// Remove any transient messages prior to finding children. They will be regenerated if they are needed.
|
||||||
|
Item[] children = getItems(item);
|
||||||
|
if (children != null) {
|
||||||
|
for (int i = 0; i < children.length; i++) {
|
||||||
|
Item child = children[i];
|
||||||
|
Object data = child.getData();
|
||||||
|
if (data instanceof ISystemMessageObject) {
|
||||||
|
ISystemMessageObject message = (ISystemMessageObject) data;
|
||||||
|
if (message.isTransient()) {
|
||||||
|
remove(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Shell shell = getShell();
|
Shell shell = getShell();
|
||||||
if ((item instanceof TreeItem) && (((TreeItem) item).getData() != null)) {
|
Object data = item.getData();
|
||||||
if (doTimings) elapsedTime.setStartTime();
|
boolean isTiming = (data != null) && doTimings;
|
||||||
if (item.getData() instanceof IHost) {
|
boolean showBusy = (data instanceof IHost) && ((IHost)data).isOffline();
|
||||||
//getShell().setCursor(busyCursor);
|
if (isTiming) elapsedTime.setStartTime();
|
||||||
IHost con = (IHost) item.getData();
|
if (showBusy) SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
||||||
if (con.isOffline()) {
|
|
||||||
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
|
||||||
cursorSet = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
super.handleTreeExpand(event);
|
super.handleTreeExpand(event);
|
||||||
if (cursorSet) {
|
if (showBusy) SystemPromptDialog.setDisplayCursor(shell, null);
|
||||||
//getShell().setCursor(null);
|
if (isTiming) {
|
||||||
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, null);
|
|
||||||
}
|
|
||||||
if (doTimings && (item instanceof TreeItem) && (((TreeItem) item).getData() != null)) {
|
|
||||||
elapsedTime.setEndTime();
|
elapsedTime.setEndTime();
|
||||||
System.out.println("Time to expand for " + ((TreeItem) item).getItemCount() + " items: " + elapsedTime);
|
System.out.println("Time to expand for " + item.getItemCount() + " items: " + elapsedTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.model.ISystemContainer;
|
import org.eclipse.rse.core.model.ISystemContainer;
|
||||||
import org.eclipse.rse.core.model.ISystemMessageObject;
|
import org.eclipse.rse.core.model.ISystemMessageObject;
|
||||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||||
|
import org.eclipse.rse.core.model.SystemMessageObject;
|
||||||
import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
|
import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.model.ISystemPromptableObject;
|
import org.eclipse.rse.model.ISystemPromptableObject;
|
||||||
|
@ -82,6 +83,7 @@ import org.eclipse.rse.model.ISystemResourceChangeEvents;
|
||||||
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
import org.eclipse.rse.model.ISystemResourceChangeListener;
|
||||||
import org.eclipse.rse.model.SystemRegistry;
|
import org.eclipse.rse.model.SystemRegistry;
|
||||||
import org.eclipse.rse.model.SystemRemoteElementResourceSet;
|
import org.eclipse.rse.model.SystemRemoteElementResourceSet;
|
||||||
|
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||||
import org.eclipse.rse.ui.ISystemDeleteTarget;
|
import org.eclipse.rse.ui.ISystemDeleteTarget;
|
||||||
|
@ -104,6 +106,7 @@ import org.eclipse.rse.ui.actions.SystemRemotePropertiesAction;
|
||||||
import org.eclipse.rse.ui.actions.SystemShowInMonitorAction;
|
import org.eclipse.rse.ui.actions.SystemShowInMonitorAction;
|
||||||
import org.eclipse.rse.ui.actions.SystemShowInTableAction;
|
import org.eclipse.rse.ui.actions.SystemShowInTableAction;
|
||||||
import org.eclipse.rse.ui.actions.SystemSubMenuManager;
|
import org.eclipse.rse.ui.actions.SystemSubMenuManager;
|
||||||
|
import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
|
||||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
@ -142,7 +145,7 @@ import org.eclipse.ui.views.framelist.GoIntoAction;
|
||||||
* to access remote objects in the remote system.
|
* to access remote objects in the remote system.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Used to implement the following as well: MenuListener, IDoubleClickListener, ArmListener, IWireEventTarget
|
* At one time implemented the following as well: MenuListener, IDoubleClickListener, ArmListener, IWireEventTarget
|
||||||
*/
|
*/
|
||||||
public class SystemView extends TreeViewer implements ISystemTree, ISystemResourceChangeListener, ISystemRemoteChangeListener, IMenuListener,
|
public class SystemView extends TreeViewer implements ISystemTree, ISystemResourceChangeListener, ISystemRemoteChangeListener, IMenuListener,
|
||||||
ISelectionChangedListener, ISelectionProvider, ITreeViewerListener, ISystemResourceChangeEvents, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget
|
ISelectionChangedListener, ISelectionProvider, ITreeViewerListener, ISystemResourceChangeEvents, ISystemDeleteTarget, ISystemRenameTarget, ISystemSelectAllTarget
|
||||||
|
@ -293,6 +296,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the input provider. Sometimes this is delayed, or can change.
|
* Set the input provider. Sometimes this is delayed, or can change.
|
||||||
|
* @param inputProvider the input provider for this view.
|
||||||
*/
|
*/
|
||||||
public void setInputProvider(ISystemViewInputProvider inputProvider) {
|
public void setInputProvider(ISystemViewInputProvider inputProvider) {
|
||||||
this.inputProvider = inputProvider;
|
this.inputProvider = inputProvider;
|
||||||
|
@ -600,7 +604,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the collapse action
|
* @return the collapse action. Lazily creates it.
|
||||||
*/
|
*/
|
||||||
public IAction getCollapseAction() {
|
public IAction getCollapseAction() {
|
||||||
if (collapseAction == null) collapseAction = new SystemCollapseAction(getShell());
|
if (collapseAction == null) collapseAction = new SystemCollapseAction(getShell());
|
||||||
|
@ -608,7 +612,7 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the expand action
|
* @return the expand action. Lazily creates it.
|
||||||
*/
|
*/
|
||||||
public IAction getExpandAction() {
|
public IAction getExpandAction() {
|
||||||
if (expandAction == null) expandAction = new SystemExpandAction(getShell());
|
if (expandAction == null) expandAction = new SystemExpandAction(getShell());
|
||||||
|
@ -1166,32 +1170,14 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after tree item collapsed
|
* Called after tree item collapsed. Updates the children of the tree item being
|
||||||
|
* collapsed by removing the widgets associated with any transient message objects
|
||||||
|
* that were in the tree.
|
||||||
|
* @param event the event that caused the collapse. The event data will include the
|
||||||
|
* tree element being collapsed.
|
||||||
*/
|
*/
|
||||||
public void treeCollapsed(TreeExpansionEvent event) {
|
public void treeCollapsed(TreeExpansionEvent event) {
|
||||||
//if (true)
|
|
||||||
//return;
|
|
||||||
final Object element = event.getElement(); // get parent node being collapsed
|
final Object element = event.getElement(); // get parent node being collapsed
|
||||||
Widget widget = findItem(element); // find GUI widget for this node
|
|
||||||
if ((widget != null) && (widget instanceof Item)) {
|
|
||||||
Item ti = (Item) widget;
|
|
||||||
Item[] items = getItems(ti);
|
|
||||||
|
|
||||||
//D51021 if ((items!=null) && (items.length==1))
|
|
||||||
if (items != null) {
|
|
||||||
for (int i = 0; i < items.length; i++) {
|
|
||||||
Object data = items[i].getData();
|
|
||||||
if ((data != null) && (data instanceof ISystemMessageObject)) {
|
|
||||||
if (((ISystemMessageObject) data).isTransient()) {
|
|
||||||
disassociate(items[i]);
|
|
||||||
items[i].dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// append a dummy so there is a plus
|
|
||||||
if (getItemCount(ti) == 0) newItem(ti, SWT.NULL, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// we always allow adapters opportunity to show a different icon depending on collapsed state
|
// we always allow adapters opportunity to show a different icon depending on collapsed state
|
||||||
getShell().getDisplay().asyncExec(new Runnable() {
|
getShell().getDisplay().asyncExec(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -1204,10 +1190,10 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
/**
|
/**
|
||||||
* Called after tree item expanded.
|
* Called after tree item expanded.
|
||||||
* We need this hook to potentially undo user expand request.
|
* We need this hook to potentially undo user expand request.
|
||||||
|
* @param event the SWT TreeExpansionEvent that caused the expansion.
|
||||||
*/
|
*/
|
||||||
public void treeExpanded(TreeExpansionEvent event) {
|
public void treeExpanded(TreeExpansionEvent event) {
|
||||||
expandingTreeOnly = true;
|
expandingTreeOnly = true;
|
||||||
//System.out.println("tree expanded");
|
|
||||||
final Object element = event.getElement();
|
final Object element = event.getElement();
|
||||||
// we always allow adapters opportunity to show a different icon depending on expanded state
|
// we always allow adapters opportunity to show a different icon depending on expanded state
|
||||||
getShell().getDisplay().asyncExec(new Runnable() {
|
getShell().getDisplay().asyncExec(new Runnable() {
|
||||||
|
@ -1219,35 +1205,44 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* Handles a tree expand event from the SWT widget.
|
* Here only for observability.
|
||||||
* An interception of parent method to set the cursor to busy if the user is expanding a connection.
|
* @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeCollapse(org.eclipse.swt.events.TreeEvent)
|
||||||
*
|
*/
|
||||||
* @param event the SWT tree event
|
protected void handleTreeCollapse(TreeEvent event) {
|
||||||
|
super.handleTreeCollapse(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.AbstractTreeViewer#handleTreeExpand(org.eclipse.swt.events.TreeEvent)
|
||||||
*/
|
*/
|
||||||
protected void handleTreeExpand(TreeEvent event) {
|
protected void handleTreeExpand(TreeEvent event) {
|
||||||
Widget item = event.item;
|
TreeItem item = (TreeItem) event.item;
|
||||||
boolean cursorSet = false;
|
// Remove any transient messages prior to finding children. They will be regenerated if they are needed.
|
||||||
|
Item[] children = getItems(item);
|
||||||
|
if (children != null) {
|
||||||
|
for (int i = 0; i < children.length; i++) {
|
||||||
|
Item child = children[i];
|
||||||
|
Object data = child.getData();
|
||||||
|
if (data instanceof ISystemMessageObject) {
|
||||||
|
ISystemMessageObject message = (ISystemMessageObject) data;
|
||||||
|
if (message.isTransient()) {
|
||||||
|
remove(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Shell shell = getShell();
|
Shell shell = getShell();
|
||||||
if ((item instanceof TreeItem) && (((TreeItem) item).getData() != null)) {
|
Object data = item.getData();
|
||||||
if (doTimings) elapsedTime.setStartTime();
|
boolean isTiming = (data != null) && doTimings;
|
||||||
if (item.getData() instanceof IHost) {
|
boolean showBusy = (data instanceof IHost) && ((IHost)data).isOffline();
|
||||||
//getShell().setCursor(busyCursor);
|
if (isTiming) elapsedTime.setStartTime();
|
||||||
IHost con = (IHost) item.getData();
|
if (showBusy) SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
||||||
if (con.isOffline()) {
|
|
||||||
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
|
||||||
cursorSet = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
super.handleTreeExpand(event);
|
super.handleTreeExpand(event);
|
||||||
if (cursorSet) {
|
if (showBusy) SystemPromptDialog.setDisplayCursor(shell, null);
|
||||||
//getShell().setCursor(null);
|
if (isTiming) {
|
||||||
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, null);
|
|
||||||
}
|
|
||||||
if (doTimings && (item instanceof TreeItem) && (((TreeItem) item).getData() != null)) {
|
|
||||||
elapsedTime.setEndTime();
|
elapsedTime.setEndTime();
|
||||||
System.out.println("Time to expand for " + ((TreeItem) item).getItemCount() + " items: " + elapsedTime);
|
System.out.println("Time to expand for " + item.getItemCount() + " items: " + elapsedTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue