mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-08 01:25:23 +02:00
Applied Michael Berger patch from here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=149080 Along with suggested changed from Martin.
This commit is contained in:
parent
25a6c26d74
commit
c048159b94
2 changed files with 1326 additions and 1246 deletions
|
@ -22,6 +22,9 @@ import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.eclipse.jface.action.ActionContributionItem;
|
import org.eclipse.jface.action.ActionContributionItem;
|
||||||
import org.eclipse.jface.action.GroupMarker;
|
import org.eclipse.jface.action.GroupMarker;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
@ -52,6 +55,7 @@ import org.eclipse.rse.core.SystemElapsedTimer;
|
||||||
import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
|
import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
|
||||||
import org.eclipse.rse.core.SystemPreferencesManager;
|
import org.eclipse.rse.core.SystemPreferencesManager;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
|
import org.eclipse.rse.core.subsystems.SubSystem.ConnectJobNoShell;
|
||||||
import org.eclipse.rse.filters.ISystemFilter;
|
import org.eclipse.rse.filters.ISystemFilter;
|
||||||
import org.eclipse.rse.filters.ISystemFilterContainer;
|
import org.eclipse.rse.filters.ISystemFilterContainer;
|
||||||
import org.eclipse.rse.filters.ISystemFilterContainerReference;
|
import org.eclipse.rse.filters.ISystemFilterContainerReference;
|
||||||
|
@ -112,6 +116,7 @@ import org.eclipse.swt.events.TreeEvent;
|
||||||
import org.eclipse.swt.graphics.Cursor;
|
import org.eclipse.swt.graphics.Cursor;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Item;
|
import org.eclipse.swt.widgets.Item;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
@ -125,6 +130,7 @@ import org.eclipse.ui.PlatformUI;
|
||||||
import org.eclipse.ui.dialogs.PropertyDialogAction;
|
import org.eclipse.ui.dialogs.PropertyDialogAction;
|
||||||
import org.eclipse.ui.part.EditorInputTransfer;
|
import org.eclipse.ui.part.EditorInputTransfer;
|
||||||
import org.eclipse.ui.part.PluginTransfer;
|
import org.eclipse.ui.part.PluginTransfer;
|
||||||
|
import org.eclipse.ui.progress.UIJob;
|
||||||
import org.eclipse.ui.views.framelist.GoIntoAction;
|
import org.eclipse.ui.views.framelist.GoIntoAction;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1726,9 +1732,40 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
*/
|
*/
|
||||||
public void systemResourceChanged(ISystemResourceChangeEvent event)
|
public void systemResourceChanged(ISystemResourceChangeEvent event)
|
||||||
{
|
{
|
||||||
int type = event.getType();
|
ResourceChangedJob job = new ResourceChangedJob(event, this);
|
||||||
Object src = event.getSource();
|
job.setPriority(Job.INTERACTIVE);
|
||||||
Object parent = event.getParent();
|
//job.setUser(true);
|
||||||
|
job.schedule();
|
||||||
|
Display display = Display.getCurrent();
|
||||||
|
try {
|
||||||
|
while (job.getResult() == null) {
|
||||||
|
while (display!=null && display.readAndDispatch()) {}
|
||||||
|
if (job.getResult() == null) Thread.sleep(200);
|
||||||
|
}
|
||||||
|
} catch(InterruptedException e) {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inner class which extends UIJob to connect this connection
|
||||||
|
* on the UI Thread when no Shell is available from
|
||||||
|
* the caller
|
||||||
|
*/
|
||||||
|
public class ResourceChangedJob extends UIJob {
|
||||||
|
|
||||||
|
protected ISystemResourceChangeEvent _event;
|
||||||
|
protected SystemView _originatingViewer;
|
||||||
|
public ResourceChangedJob(ISystemResourceChangeEvent event, SystemView originatingViewer)
|
||||||
|
{
|
||||||
|
super("Resource Changed...");
|
||||||
|
_event = event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IStatus runInUIThread(IProgressMonitor monitor)
|
||||||
|
{
|
||||||
|
int type = _event.getType();
|
||||||
|
Object src = _event.getSource();
|
||||||
|
Object parent = _event.getParent();
|
||||||
String[] properties = new String[1];
|
String[] properties = new String[1];
|
||||||
if (parent == RSEUIPlugin.getTheSystemRegistry())
|
if (parent == RSEUIPlugin.getTheSystemRegistry())
|
||||||
parent = inputProvider;
|
parent = inputProvider;
|
||||||
|
@ -1737,12 +1774,12 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
Widget parentItem = null;
|
Widget parentItem = null;
|
||||||
Object[] multiSource = null;
|
Object[] multiSource = null;
|
||||||
Object previous = null;
|
Object previous = null;
|
||||||
if (event.getViewerItem() instanceof TreeItem)
|
if (_event.getViewerItem() instanceof TreeItem)
|
||||||
inputTreeItem = (TreeItem)event.getViewerItem();
|
inputTreeItem = (TreeItem)_event.getViewerItem();
|
||||||
else
|
else
|
||||||
inputTreeItem = null;
|
inputTreeItem = null;
|
||||||
boolean wasSelected = false;
|
boolean wasSelected = false;
|
||||||
boolean originatedHere = (event.getOriginatingViewer() == null) || (event.getOriginatingViewer() == this);
|
boolean originatedHere = (_event.getOriginatingViewer() == null) || (_event.getOriginatingViewer() == _originatingViewer);
|
||||||
|
|
||||||
//logDebugMsg("INSIDE SYSRESCHGD: " + type + ", " + src + ", " + parent);
|
//logDebugMsg("INSIDE SYSRESCHGD: " + type + ", " + src + ", " + parent);
|
||||||
switch(type)
|
switch(type)
|
||||||
|
@ -1750,10 +1787,10 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
// SPECIAL CASES: ANYTHING TO DO WITH FILTERS!!
|
// SPECIAL CASES: ANYTHING TO DO WITH FILTERS!!
|
||||||
case EVENT_RENAME_FILTER_REFERENCE:
|
case EVENT_RENAME_FILTER_REFERENCE:
|
||||||
case EVENT_CHANGE_FILTER_REFERENCE:
|
case EVENT_CHANGE_FILTER_REFERENCE:
|
||||||
findAndUpdateFilter(event, type);
|
findAndUpdateFilter(_event, type);
|
||||||
break;
|
break;
|
||||||
case EVENT_CHANGE_FILTERSTRING_REFERENCE:
|
case EVENT_CHANGE_FILTERSTRING_REFERENCE:
|
||||||
findAndUpdateFilterString(event, type);
|
findAndUpdateFilterString(_event, type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_ADD_FILTERSTRING_REFERENCE:
|
case EVENT_ADD_FILTERSTRING_REFERENCE:
|
||||||
|
@ -1770,10 +1807,10 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
affectsInput(src))
|
affectsInput(src))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
findAndUpdateFilterParent(event, type);
|
findAndUpdateFilterParent(_event, type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_ADD:
|
case EVENT_ADD:
|
||||||
|
@ -1786,7 +1823,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
//refresh(parent);
|
//refresh(parent);
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
{
|
{
|
||||||
refresh(parent); // flush cached stuff so next call will show new item
|
refresh(parent); // flush cached stuff so next call will show new item
|
||||||
|
@ -1799,20 +1836,20 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
//System.out.println("event.getParent() instanceof SystemRegistry: " + (event.getParent() instanceof SystemRegistry));
|
//System.out.println("event.getParent() instanceof SystemRegistry: " + (event.getParent() instanceof SystemRegistry));
|
||||||
//System.out.println("inputProvider.showingConnections().........: " + (inputProvider.showingConnections()));
|
//System.out.println("inputProvider.showingConnections().........: " + (inputProvider.showingConnections()));
|
||||||
if ((parent == inputProvider) && addingConnection &&
|
if ((parent == inputProvider) && addingConnection &&
|
||||||
(event.getParent() instanceof ISystemRegistry) &&
|
(_event.getParent() instanceof ISystemRegistry) &&
|
||||||
!inputProvider.showingConnections())
|
!inputProvider.showingConnections())
|
||||||
return; // only reflect new connections in main perspective. pc42742
|
return Status.OK_STATUS; // only reflect new connections in main perspective. pc42742
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
if (type == EVENT_ADD_RELATIVE)
|
if (type == EVENT_ADD_RELATIVE)
|
||||||
{
|
{
|
||||||
previous = event.getRelativePrevious();
|
previous = _event.getRelativePrevious();
|
||||||
if (previous != null)
|
if (previous != null)
|
||||||
pos = getItemIndex(parentItem, previous);
|
pos = getItemIndex(parentItem, previous);
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
pos++; // want to add after previous
|
pos++; // want to add after previous
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pos = event.getPosition();
|
pos = _event.getPosition();
|
||||||
//logDebugMsg("ADDING CONN? "+ addingConnection + ", position="+pos);
|
//logDebugMsg("ADDING CONN? "+ addingConnection + ", position="+pos);
|
||||||
createTreeItem(parentItem, src, pos);
|
createTreeItem(parentItem, src, pos);
|
||||||
setSelection(new StructuredSelection(src),true);
|
setSelection(new StructuredSelection(src),true);
|
||||||
|
@ -1823,11 +1860,11 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
logDebugMsg("SV event: EVENT_ADD_MANY");
|
logDebugMsg("SV event: EVENT_ADD_MANY");
|
||||||
}
|
}
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
clearSelection();
|
clearSelection();
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
{
|
{
|
||||||
refresh(parent); // flush cached stuff so next call will show new items
|
refresh(parent); // flush cached stuff so next call will show new items
|
||||||
|
@ -1837,7 +1874,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
boolean addingConnections = (multiSource[0] instanceof IHost);
|
boolean addingConnections = (multiSource[0] instanceof IHost);
|
||||||
// are we restoring connections previously removed due to making a profile inactive,
|
// are we restoring connections previously removed due to making a profile inactive,
|
||||||
// and is one of these connections the one we were opened with?
|
// and is one of these connections the one we were opened with?
|
||||||
if (addingConnections && (event.getParent() instanceof ISystemRegistry) &&
|
if (addingConnections && (_event.getParent() instanceof ISystemRegistry) &&
|
||||||
(inputProvider instanceof SystemEmptyListAPIProviderImpl))
|
(inputProvider instanceof SystemEmptyListAPIProviderImpl))
|
||||||
{
|
{
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
@ -1852,13 +1889,13 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (done)
|
if (done)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
// are we adding connections and yet we are not a secondary perspective?
|
// are we adding connections and yet we are not a secondary perspective?
|
||||||
// If so, this event does not apply to us.
|
// If so, this event does not apply to us.
|
||||||
else if (addingConnections && (event.getParent() instanceof ISystemRegistry) &&
|
else if (addingConnections && (_event.getParent() instanceof ISystemRegistry) &&
|
||||||
!inputProvider.showingConnections())
|
!inputProvider.showingConnections())
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
|
|
||||||
for (int idx=0; idx<multiSource.length; idx++)
|
for (int idx=0; idx<multiSource.length; idx++)
|
||||||
{
|
{
|
||||||
|
@ -1874,12 +1911,12 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
logDebugMsg("SV event: EVENT_REPLACE_CHILDREN");
|
logDebugMsg("SV event: EVENT_REPLACE_CHILDREN");
|
||||||
}
|
}
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
//logDebugMsg("MULTI-SRC LENGTH : " + multiSource.length);
|
//logDebugMsg("MULTI-SRC LENGTH : " + multiSource.length);
|
||||||
clearSelection();
|
clearSelection();
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if (multiSource.length > 0 && parentItem != null && parentItem instanceof Item )
|
if (multiSource.length > 0 && parentItem != null && parentItem instanceof Item )
|
||||||
{
|
{
|
||||||
getControl().setRedraw(false);
|
getControl().setRedraw(false);
|
||||||
|
@ -1953,11 +1990,11 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
if (affectsInput(src))
|
if (affectsInput(src))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
refresh(parent); // flush memory
|
refresh(parent); // flush memory
|
||||||
else
|
else
|
||||||
|
@ -1965,7 +2002,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
wasSelected = isSelectedOrChildSelected(src);
|
wasSelected = isSelectedOrChildSelected(src);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
clearSelection();
|
clearSelection();
|
||||||
remove(src);
|
_originatingViewer.remove(src);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
setSelection(new StructuredSelection(parent),true);
|
setSelection(new StructuredSelection(parent),true);
|
||||||
}
|
}
|
||||||
|
@ -1974,16 +2011,16 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
case EVENT_DELETE_MANY:
|
case EVENT_DELETE_MANY:
|
||||||
if (debug)
|
if (debug)
|
||||||
logDebugMsg("SV event: EVENT_DELETE_MANY ");
|
logDebugMsg("SV event: EVENT_DELETE_MANY ");
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
// are we a secondary perspective, and our input or parent of our input was deleted?
|
// are we a secondary perspective, and our input or parent of our input was deleted?
|
||||||
if (affectsInput(multiSource))
|
if (affectsInput(multiSource))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
refresh(parent); // flush memory
|
refresh(parent); // flush memory
|
||||||
else
|
else
|
||||||
|
@ -1991,7 +2028,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
wasSelected = isSelectedOrChildSelected(multiSource);
|
wasSelected = isSelectedOrChildSelected(multiSource);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
clearSelection();
|
clearSelection();
|
||||||
remove(multiSource);
|
_originatingViewer.remove(multiSource);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
setSelection(new StructuredSelection(parent),true);
|
setSelection(new StructuredSelection(parent),true);
|
||||||
}
|
}
|
||||||
|
@ -2124,7 +2161,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
|
|
||||||
Object element = i.next();
|
Object element = i.next();
|
||||||
ISystemViewElementAdapter adapter = getAdapter(element);
|
ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
|
||||||
if ((parentElementItem==null) && (adapter != null) && (!adapter.hasChildren(element)))
|
if ((parentElementItem==null) && (adapter != null) && (!adapter.hasChildren(element)))
|
||||||
{
|
{
|
||||||
//parentItem = getParentItem((Item)findItem(element));
|
//parentItem = getParentItem((Item)findItem(element));
|
||||||
|
@ -2192,7 +2229,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
if (j.hasNext())
|
if (j.hasNext())
|
||||||
{
|
{
|
||||||
Object element = j.next();
|
Object element = j.next();
|
||||||
ISystemViewElementAdapter adapter = getAdapter(element);
|
ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
|
||||||
if ((parentElemItem==null) && (adapter != null))
|
if ((parentElemItem==null) && (adapter != null))
|
||||||
{
|
{
|
||||||
Item parItem = getParentItem((Item)findItem(element));
|
Item parItem = getParentItem((Item)findItem(element));
|
||||||
|
@ -2230,8 +2267,8 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
// if we cannot find a parent element that has a system filter reference then we refresh
|
// if we cannot find a parent element that has a system filter reference then we refresh
|
||||||
// everything since the explorer must be within a filter
|
// everything since the explorer must be within a filter
|
||||||
event.setType(ISystemResourceChangeEvents.EVENT_REFRESH);
|
_event.setType(ISystemResourceChangeEvents.EVENT_REFRESH);
|
||||||
systemResourceChanged(event);
|
systemResourceChanged(_event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_REFRESH_REMOTE:
|
case EVENT_REFRESH_REMOTE:
|
||||||
|
@ -2249,18 +2286,18 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
case EVENT_MOVE_MANY:
|
case EVENT_MOVE_MANY:
|
||||||
if (debug)
|
if (debug)
|
||||||
logDebugMsg("SV event: EVENT_MOVE_MANY ");
|
logDebugMsg("SV event: EVENT_MOVE_MANY ");
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
if ((multiSource == null) || (multiSource.length == 0))
|
if ((multiSource == null) || (multiSource.length == 0))
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
refresh(parent); // flush memory
|
refresh(parent); // flush memory
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clearSelection();
|
clearSelection();
|
||||||
moveTreeItems(parentItem, multiSource, event.getPosition());
|
moveTreeItems(parentItem, multiSource, _event.getPosition());
|
||||||
setSelection(new StructuredSelection(multiSource),true);
|
setSelection(new StructuredSelection(multiSource),true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2313,7 +2350,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT ");
|
logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT ");
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
{
|
{
|
||||||
setExpandedState(parent, true);
|
setExpandedState(parent, true);
|
||||||
|
@ -2347,7 +2384,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
logDebugMsg("SV event: EVENT_SELECT ");
|
logDebugMsg("SV event: EVENT_SELECT ");
|
||||||
item = findItem(src);
|
item = findItem(src);
|
||||||
if (item == null) // if not showing item, this is a no-op
|
if (item == null) // if not showing item, this is a no-op
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
setSelection(new StructuredSelection(src), true);
|
setSelection(new StructuredSelection(src), true);
|
||||||
break;
|
break;
|
||||||
case EVENT_SELECT_EXPAND:
|
case EVENT_SELECT_EXPAND:
|
||||||
|
@ -2355,14 +2392,17 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
logDebugMsg("SV event: EVENT_SELECT_EXPAND ");
|
logDebugMsg("SV event: EVENT_SELECT_EXPAND ");
|
||||||
item = findItem(src);
|
item = findItem(src);
|
||||||
if (item == null) // if not showing item, this is a no-op
|
if (item == null) // if not showing item, this is a no-op
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if (!getExpanded((Item)item))
|
if (!getExpanded((Item)item))
|
||||||
setExpandedState(src, true);
|
setExpandedState(src, true);
|
||||||
setSelection(new StructuredSelection(src), true);
|
setSelection(new StructuredSelection(src), true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// ISYSTEMREMOTEChangeListener METHOD
|
// ISYSTEMREMOTEChangeListener METHOD
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
|
|
|
@ -22,6 +22,9 @@ import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.eclipse.jface.action.ActionContributionItem;
|
import org.eclipse.jface.action.ActionContributionItem;
|
||||||
import org.eclipse.jface.action.GroupMarker;
|
import org.eclipse.jface.action.GroupMarker;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
@ -52,6 +55,7 @@ import org.eclipse.rse.core.SystemElapsedTimer;
|
||||||
import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
|
import org.eclipse.rse.core.SystemPopupMenuActionContributorManager;
|
||||||
import org.eclipse.rse.core.SystemPreferencesManager;
|
import org.eclipse.rse.core.SystemPreferencesManager;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
|
import org.eclipse.rse.core.subsystems.SubSystem.ConnectJobNoShell;
|
||||||
import org.eclipse.rse.filters.ISystemFilter;
|
import org.eclipse.rse.filters.ISystemFilter;
|
||||||
import org.eclipse.rse.filters.ISystemFilterContainer;
|
import org.eclipse.rse.filters.ISystemFilterContainer;
|
||||||
import org.eclipse.rse.filters.ISystemFilterContainerReference;
|
import org.eclipse.rse.filters.ISystemFilterContainerReference;
|
||||||
|
@ -112,6 +116,7 @@ import org.eclipse.swt.events.TreeEvent;
|
||||||
import org.eclipse.swt.graphics.Cursor;
|
import org.eclipse.swt.graphics.Cursor;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Item;
|
import org.eclipse.swt.widgets.Item;
|
||||||
import org.eclipse.swt.widgets.Menu;
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
@ -125,6 +130,7 @@ import org.eclipse.ui.PlatformUI;
|
||||||
import org.eclipse.ui.dialogs.PropertyDialogAction;
|
import org.eclipse.ui.dialogs.PropertyDialogAction;
|
||||||
import org.eclipse.ui.part.EditorInputTransfer;
|
import org.eclipse.ui.part.EditorInputTransfer;
|
||||||
import org.eclipse.ui.part.PluginTransfer;
|
import org.eclipse.ui.part.PluginTransfer;
|
||||||
|
import org.eclipse.ui.progress.UIJob;
|
||||||
import org.eclipse.ui.views.framelist.GoIntoAction;
|
import org.eclipse.ui.views.framelist.GoIntoAction;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1726,9 +1732,40 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
*/
|
*/
|
||||||
public void systemResourceChanged(ISystemResourceChangeEvent event)
|
public void systemResourceChanged(ISystemResourceChangeEvent event)
|
||||||
{
|
{
|
||||||
int type = event.getType();
|
ResourceChangedJob job = new ResourceChangedJob(event, this);
|
||||||
Object src = event.getSource();
|
job.setPriority(Job.INTERACTIVE);
|
||||||
Object parent = event.getParent();
|
//job.setUser(true);
|
||||||
|
job.schedule();
|
||||||
|
Display display = Display.getCurrent();
|
||||||
|
try {
|
||||||
|
while (job.getResult() == null) {
|
||||||
|
while (display!=null && display.readAndDispatch()) {}
|
||||||
|
if (job.getResult() == null) Thread.sleep(200);
|
||||||
|
}
|
||||||
|
} catch(InterruptedException e) {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inner class which extends UIJob to connect this connection
|
||||||
|
* on the UI Thread when no Shell is available from
|
||||||
|
* the caller
|
||||||
|
*/
|
||||||
|
public class ResourceChangedJob extends UIJob {
|
||||||
|
|
||||||
|
protected ISystemResourceChangeEvent _event;
|
||||||
|
protected SystemView _originatingViewer;
|
||||||
|
public ResourceChangedJob(ISystemResourceChangeEvent event, SystemView originatingViewer)
|
||||||
|
{
|
||||||
|
super("Resource Changed...");
|
||||||
|
_event = event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IStatus runInUIThread(IProgressMonitor monitor)
|
||||||
|
{
|
||||||
|
int type = _event.getType();
|
||||||
|
Object src = _event.getSource();
|
||||||
|
Object parent = _event.getParent();
|
||||||
String[] properties = new String[1];
|
String[] properties = new String[1];
|
||||||
if (parent == RSEUIPlugin.getTheSystemRegistry())
|
if (parent == RSEUIPlugin.getTheSystemRegistry())
|
||||||
parent = inputProvider;
|
parent = inputProvider;
|
||||||
|
@ -1737,12 +1774,12 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
Widget parentItem = null;
|
Widget parentItem = null;
|
||||||
Object[] multiSource = null;
|
Object[] multiSource = null;
|
||||||
Object previous = null;
|
Object previous = null;
|
||||||
if (event.getViewerItem() instanceof TreeItem)
|
if (_event.getViewerItem() instanceof TreeItem)
|
||||||
inputTreeItem = (TreeItem)event.getViewerItem();
|
inputTreeItem = (TreeItem)_event.getViewerItem();
|
||||||
else
|
else
|
||||||
inputTreeItem = null;
|
inputTreeItem = null;
|
||||||
boolean wasSelected = false;
|
boolean wasSelected = false;
|
||||||
boolean originatedHere = (event.getOriginatingViewer() == null) || (event.getOriginatingViewer() == this);
|
boolean originatedHere = (_event.getOriginatingViewer() == null) || (_event.getOriginatingViewer() == _originatingViewer);
|
||||||
|
|
||||||
//logDebugMsg("INSIDE SYSRESCHGD: " + type + ", " + src + ", " + parent);
|
//logDebugMsg("INSIDE SYSRESCHGD: " + type + ", " + src + ", " + parent);
|
||||||
switch(type)
|
switch(type)
|
||||||
|
@ -1750,10 +1787,10 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
// SPECIAL CASES: ANYTHING TO DO WITH FILTERS!!
|
// SPECIAL CASES: ANYTHING TO DO WITH FILTERS!!
|
||||||
case EVENT_RENAME_FILTER_REFERENCE:
|
case EVENT_RENAME_FILTER_REFERENCE:
|
||||||
case EVENT_CHANGE_FILTER_REFERENCE:
|
case EVENT_CHANGE_FILTER_REFERENCE:
|
||||||
findAndUpdateFilter(event, type);
|
findAndUpdateFilter(_event, type);
|
||||||
break;
|
break;
|
||||||
case EVENT_CHANGE_FILTERSTRING_REFERENCE:
|
case EVENT_CHANGE_FILTERSTRING_REFERENCE:
|
||||||
findAndUpdateFilterString(event, type);
|
findAndUpdateFilterString(_event, type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_ADD_FILTERSTRING_REFERENCE:
|
case EVENT_ADD_FILTERSTRING_REFERENCE:
|
||||||
|
@ -1770,10 +1807,10 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
affectsInput(src))
|
affectsInput(src))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
findAndUpdateFilterParent(event, type);
|
findAndUpdateFilterParent(_event, type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_ADD:
|
case EVENT_ADD:
|
||||||
|
@ -1786,7 +1823,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
//refresh(parent);
|
//refresh(parent);
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
{
|
{
|
||||||
refresh(parent); // flush cached stuff so next call will show new item
|
refresh(parent); // flush cached stuff so next call will show new item
|
||||||
|
@ -1799,20 +1836,20 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
//System.out.println("event.getParent() instanceof SystemRegistry: " + (event.getParent() instanceof SystemRegistry));
|
//System.out.println("event.getParent() instanceof SystemRegistry: " + (event.getParent() instanceof SystemRegistry));
|
||||||
//System.out.println("inputProvider.showingConnections().........: " + (inputProvider.showingConnections()));
|
//System.out.println("inputProvider.showingConnections().........: " + (inputProvider.showingConnections()));
|
||||||
if ((parent == inputProvider) && addingConnection &&
|
if ((parent == inputProvider) && addingConnection &&
|
||||||
(event.getParent() instanceof ISystemRegistry) &&
|
(_event.getParent() instanceof ISystemRegistry) &&
|
||||||
!inputProvider.showingConnections())
|
!inputProvider.showingConnections())
|
||||||
return; // only reflect new connections in main perspective. pc42742
|
return Status.OK_STATUS; // only reflect new connections in main perspective. pc42742
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
if (type == EVENT_ADD_RELATIVE)
|
if (type == EVENT_ADD_RELATIVE)
|
||||||
{
|
{
|
||||||
previous = event.getRelativePrevious();
|
previous = _event.getRelativePrevious();
|
||||||
if (previous != null)
|
if (previous != null)
|
||||||
pos = getItemIndex(parentItem, previous);
|
pos = getItemIndex(parentItem, previous);
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
pos++; // want to add after previous
|
pos++; // want to add after previous
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pos = event.getPosition();
|
pos = _event.getPosition();
|
||||||
//logDebugMsg("ADDING CONN? "+ addingConnection + ", position="+pos);
|
//logDebugMsg("ADDING CONN? "+ addingConnection + ", position="+pos);
|
||||||
createTreeItem(parentItem, src, pos);
|
createTreeItem(parentItem, src, pos);
|
||||||
setSelection(new StructuredSelection(src),true);
|
setSelection(new StructuredSelection(src),true);
|
||||||
|
@ -1823,11 +1860,11 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
logDebugMsg("SV event: EVENT_ADD_MANY");
|
logDebugMsg("SV event: EVENT_ADD_MANY");
|
||||||
}
|
}
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
clearSelection();
|
clearSelection();
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
{
|
{
|
||||||
refresh(parent); // flush cached stuff so next call will show new items
|
refresh(parent); // flush cached stuff so next call will show new items
|
||||||
|
@ -1837,7 +1874,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
boolean addingConnections = (multiSource[0] instanceof IHost);
|
boolean addingConnections = (multiSource[0] instanceof IHost);
|
||||||
// are we restoring connections previously removed due to making a profile inactive,
|
// are we restoring connections previously removed due to making a profile inactive,
|
||||||
// and is one of these connections the one we were opened with?
|
// and is one of these connections the one we were opened with?
|
||||||
if (addingConnections && (event.getParent() instanceof ISystemRegistry) &&
|
if (addingConnections && (_event.getParent() instanceof ISystemRegistry) &&
|
||||||
(inputProvider instanceof SystemEmptyListAPIProviderImpl))
|
(inputProvider instanceof SystemEmptyListAPIProviderImpl))
|
||||||
{
|
{
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
@ -1852,13 +1889,13 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (done)
|
if (done)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
// are we adding connections and yet we are not a secondary perspective?
|
// are we adding connections and yet we are not a secondary perspective?
|
||||||
// If so, this event does not apply to us.
|
// If so, this event does not apply to us.
|
||||||
else if (addingConnections && (event.getParent() instanceof ISystemRegistry) &&
|
else if (addingConnections && (_event.getParent() instanceof ISystemRegistry) &&
|
||||||
!inputProvider.showingConnections())
|
!inputProvider.showingConnections())
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
|
|
||||||
for (int idx=0; idx<multiSource.length; idx++)
|
for (int idx=0; idx<multiSource.length; idx++)
|
||||||
{
|
{
|
||||||
|
@ -1874,12 +1911,12 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
logDebugMsg("SV event: EVENT_REPLACE_CHILDREN");
|
logDebugMsg("SV event: EVENT_REPLACE_CHILDREN");
|
||||||
}
|
}
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
//logDebugMsg("MULTI-SRC LENGTH : " + multiSource.length);
|
//logDebugMsg("MULTI-SRC LENGTH : " + multiSource.length);
|
||||||
clearSelection();
|
clearSelection();
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if (multiSource.length > 0 && parentItem != null && parentItem instanceof Item )
|
if (multiSource.length > 0 && parentItem != null && parentItem instanceof Item )
|
||||||
{
|
{
|
||||||
getControl().setRedraw(false);
|
getControl().setRedraw(false);
|
||||||
|
@ -1953,11 +1990,11 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
if (affectsInput(src))
|
if (affectsInput(src))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
refresh(parent); // flush memory
|
refresh(parent); // flush memory
|
||||||
else
|
else
|
||||||
|
@ -1965,7 +2002,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
wasSelected = isSelectedOrChildSelected(src);
|
wasSelected = isSelectedOrChildSelected(src);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
clearSelection();
|
clearSelection();
|
||||||
remove(src);
|
_originatingViewer.remove(src);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
setSelection(new StructuredSelection(parent),true);
|
setSelection(new StructuredSelection(parent),true);
|
||||||
}
|
}
|
||||||
|
@ -1974,16 +2011,16 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
case EVENT_DELETE_MANY:
|
case EVENT_DELETE_MANY:
|
||||||
if (debug)
|
if (debug)
|
||||||
logDebugMsg("SV event: EVENT_DELETE_MANY ");
|
logDebugMsg("SV event: EVENT_DELETE_MANY ");
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
// are we a secondary perspective, and our input or parent of our input was deleted?
|
// are we a secondary perspective, and our input or parent of our input was deleted?
|
||||||
if (affectsInput(multiSource))
|
if (affectsInput(multiSource))
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
refresh(parent); // flush memory
|
refresh(parent); // flush memory
|
||||||
else
|
else
|
||||||
|
@ -1991,7 +2028,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
wasSelected = isSelectedOrChildSelected(multiSource);
|
wasSelected = isSelectedOrChildSelected(multiSource);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
clearSelection();
|
clearSelection();
|
||||||
remove(multiSource);
|
_originatingViewer.remove(multiSource);
|
||||||
if (wasSelected)
|
if (wasSelected)
|
||||||
setSelection(new StructuredSelection(parent),true);
|
setSelection(new StructuredSelection(parent),true);
|
||||||
}
|
}
|
||||||
|
@ -2124,7 +2161,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
|
|
||||||
Object element = i.next();
|
Object element = i.next();
|
||||||
ISystemViewElementAdapter adapter = getAdapter(element);
|
ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
|
||||||
if ((parentElementItem==null) && (adapter != null) && (!adapter.hasChildren(element)))
|
if ((parentElementItem==null) && (adapter != null) && (!adapter.hasChildren(element)))
|
||||||
{
|
{
|
||||||
//parentItem = getParentItem((Item)findItem(element));
|
//parentItem = getParentItem((Item)findItem(element));
|
||||||
|
@ -2192,7 +2229,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
if (j.hasNext())
|
if (j.hasNext())
|
||||||
{
|
{
|
||||||
Object element = j.next();
|
Object element = j.next();
|
||||||
ISystemViewElementAdapter adapter = getAdapter(element);
|
ISystemViewElementAdapter adapter = _originatingViewer.getAdapter(element);
|
||||||
if ((parentElemItem==null) && (adapter != null))
|
if ((parentElemItem==null) && (adapter != null))
|
||||||
{
|
{
|
||||||
Item parItem = getParentItem((Item)findItem(element));
|
Item parItem = getParentItem((Item)findItem(element));
|
||||||
|
@ -2230,8 +2267,8 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
{
|
{
|
||||||
// if we cannot find a parent element that has a system filter reference then we refresh
|
// if we cannot find a parent element that has a system filter reference then we refresh
|
||||||
// everything since the explorer must be within a filter
|
// everything since the explorer must be within a filter
|
||||||
event.setType(ISystemResourceChangeEvents.EVENT_REFRESH);
|
_event.setType(ISystemResourceChangeEvents.EVENT_REFRESH);
|
||||||
systemResourceChanged(event);
|
systemResourceChanged(_event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_REFRESH_REMOTE:
|
case EVENT_REFRESH_REMOTE:
|
||||||
|
@ -2249,18 +2286,18 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
case EVENT_MOVE_MANY:
|
case EVENT_MOVE_MANY:
|
||||||
if (debug)
|
if (debug)
|
||||||
logDebugMsg("SV event: EVENT_MOVE_MANY ");
|
logDebugMsg("SV event: EVENT_MOVE_MANY ");
|
||||||
multiSource = event.getMultiSource();
|
multiSource = _event.getMultiSource();
|
||||||
if ((multiSource == null) || (multiSource.length == 0))
|
if ((multiSource == null) || (multiSource.length == 0))
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
refresh(parent); // flush memory
|
refresh(parent); // flush memory
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clearSelection();
|
clearSelection();
|
||||||
moveTreeItems(parentItem, multiSource, event.getPosition());
|
moveTreeItems(parentItem, multiSource, _event.getPosition());
|
||||||
setSelection(new StructuredSelection(multiSource),true);
|
setSelection(new StructuredSelection(multiSource),true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2313,7 +2350,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT ");
|
logDebugMsg("SV event: EVENT_REVEAL_AND_SELECT ");
|
||||||
parentItem = findItem(parent);
|
parentItem = findItem(parent);
|
||||||
if (parentItem == null)
|
if (parentItem == null)
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
if ((parentItem instanceof Item) && !getExpanded((Item)parentItem))
|
||||||
{
|
{
|
||||||
setExpandedState(parent, true);
|
setExpandedState(parent, true);
|
||||||
|
@ -2347,7 +2384,7 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
logDebugMsg("SV event: EVENT_SELECT ");
|
logDebugMsg("SV event: EVENT_SELECT ");
|
||||||
item = findItem(src);
|
item = findItem(src);
|
||||||
if (item == null) // if not showing item, this is a no-op
|
if (item == null) // if not showing item, this is a no-op
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
setSelection(new StructuredSelection(src), true);
|
setSelection(new StructuredSelection(src), true);
|
||||||
break;
|
break;
|
||||||
case EVENT_SELECT_EXPAND:
|
case EVENT_SELECT_EXPAND:
|
||||||
|
@ -2355,14 +2392,17 @@ public class SystemView extends TreeViewer implements ISystemTree,
|
||||||
logDebugMsg("SV event: EVENT_SELECT_EXPAND ");
|
logDebugMsg("SV event: EVENT_SELECT_EXPAND ");
|
||||||
item = findItem(src);
|
item = findItem(src);
|
||||||
if (item == null) // if not showing item, this is a no-op
|
if (item == null) // if not showing item, this is a no-op
|
||||||
return;
|
return Status.OK_STATUS;
|
||||||
if (!getExpanded((Item)item))
|
if (!getExpanded((Item)item))
|
||||||
setExpandedState(src, true);
|
setExpandedState(src, true);
|
||||||
setSelection(new StructuredSelection(src), true);
|
setSelection(new StructuredSelection(src), true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// ISYSTEMREMOTEChangeListener METHOD
|
// ISYSTEMREMOTEChangeListener METHOD
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue