Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/scouter-project/scouter into…
Browse files Browse the repository at this point in the history
… dev
  • Loading branch information
sjokim committed Jul 28, 2015
2 parents fffbd5c + 97080c3 commit e840edc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
15 changes: 15 additions & 0 deletions scouter.client/src/scouter/client/threads/ObjectSelectManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,27 @@ public boolean isUnselectedObject(int objHash) {
return unSelectedObjSet.contains(objHash);
}

public int unselectedSize() {
return unSelectedObjSet.size();
}

public void addAll(Set<Integer> 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);
}
Expand Down
27 changes: 19 additions & 8 deletions scouter.client/src/scouter/client/views/ObjectNavigationView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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<Integer> unselSet = new HashSet<Integer>();
for (AgentObject a : aos) {
if (a.getObjHash() != ao.getObjHash()) {
unselSet.add(a.getObjHash());
}
}
objSelMgr.addAll(unselSet);
}
refreshViewer();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scouter.deploy/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property name="deploy-dir" value="./out/package"/>
<property name="outpack-dir" value="./out"/>

<property name="VERSION" value="0.2.3"/>
<property name="VERSION" value="0.2.4"/>


<target name="packing">
Expand Down

0 comments on commit e840edc

Please sign in to comment.