diff --git a/scouter.client/src/scouter/client/threads/ObjectSelectManager.java b/scouter.client/src/scouter/client/threads/ObjectSelectManager.java index 4f6d15019..435fbbac8 100644 --- a/scouter.client/src/scouter/client/threads/ObjectSelectManager.java +++ b/scouter.client/src/scouter/client/threads/ObjectSelectManager.java @@ -38,12 +38,27 @@ public boolean isUnselectedObject(int objHash) { return unSelectedObjSet.contains(objHash); } + public int unselectedSize() { + return unSelectedObjSet.size(); + } + public void addAll(Set unSelectedSet) { unSelectedObjSet.clear(); unSelectedObjSet.addAll(unSelectedSet); notifyChangeCheckedState(); } + public void selectObj(int objHash) { + if (unselectedSize() > 0) { + if (isUnselectedObject(objHash)) { + unSelectedObjSet.remove(objHash); + } else { + unSelectedObjSet.add(objHash); + } + notifyChangeCheckedState(); + } + } + public void addObjectCheckStateListener(IObjectCheckListener listener) { objectCheckStateListeners.add(listener); } diff --git a/scouter.client/src/scouter/client/views/ObjectNavigationView.java b/scouter.client/src/scouter/client/views/ObjectNavigationView.java index 44e33252c..5a3ba1f7b 100644 --- a/scouter.client/src/scouter/client/views/ObjectNavigationView.java +++ b/scouter.client/src/scouter/client/views/ObjectNavigationView.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeMap; @@ -41,6 +42,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; @@ -95,22 +97,18 @@ import scouter.client.server.GroupPolicyConstants; import scouter.client.server.Server; import scouter.client.server.ServerManager; -import scouter.client.tags.actions.OpenTagCountViewAction; import scouter.client.threads.ObjectSelectManager; import scouter.client.util.ColorUtil; -import scouter.client.util.CounterUtil; import scouter.client.util.DummyAction; import scouter.client.util.ExUtil; import scouter.client.util.ImageUtil; import scouter.client.util.MenuUtil; import scouter.client.util.ScouterUtil; -import scouter.client.xlog.ImageCache; import scouter.lang.counters.CounterConstants; import scouter.lang.counters.CounterEngine; import scouter.lang.value.Value; import scouter.util.CastUtil; import scouter.util.FormatUtil; -import scouter.util.StringUtil; public class ObjectNavigationView extends ViewPart implements RefreshThread.Refreshable { public static final String ID = ObjectNavigationView.class.getName(); @@ -242,10 +240,23 @@ public void handleEvent(Event event) { Point point = new Point(event.x, event.y); TreeItem item = objTreeViewer.getTree().getItem(point); if (item != null) { - if(item.getExpanded()){ - item.setExpanded(false); - }else{ - item.setExpanded(true); + StructuredSelection sel = (StructuredSelection) objTreeViewer.getSelection(); + Object o = sel.getFirstElement(); + if (o instanceof AgentObject) { + AgentObject ao = (AgentObject) o; + if (objSelMgr.unselectedSize() > 0) { + objSelMgr.selectObj(ao.getObjHash()); + } else { + AgentObject[] aos = agentThread.getObjectList(); + Set unselSet = new HashSet(); + for (AgentObject a : aos) { + if (a.getObjHash() != ao.getObjHash()) { + unselSet.add(a.getObjHash()); + } + } + objSelMgr.addAll(unselSet); + } + refreshViewer(); } } } diff --git a/scouter.deploy/build.xml b/scouter.deploy/build.xml index 2aa16c41a..95979a53b 100644 --- a/scouter.deploy/build.xml +++ b/scouter.deploy/build.xml @@ -4,7 +4,7 @@ - +