static private ArrayList stylelist = new ArrayList(); public void doHighlight(){ ClassGraph cg = ClassGraph.fromString(cd); try{ Traversal trv = Traversal.compute(Strategy.fromString(strategy) ,cg); Highlighting(cg, trv); } catch(Exception e){ } } public void Highlighting(ClassGraph cg, Traversal trv){ Collection c = cg.getNodes(); Iterator c_i = c.iterator(); while(c_i.hasNext()){ Object node = c_i.next(); st.append(node.toString()); if(is_construction(node, cg)){ st.append(" = "); } else{ st.append(" : "); } try{ Collection oe = cg.getOutgoingEdges(node); Iterator oe_i = oe.iterator(); int i =0; while(oe_i.hasNext()){ EdgeI edge = (EdgeI) oe_i.next(); st.append(edge.toString()+ " "); if(trv.getEdgeSet(edge) != null){ StyleRange sr = new StyleRange(); sr.start = st.getText().length() - edge.toString().length() - 1; sr.length = edge.toString().length(); sr.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_RED); stylelist.add(sr); } } } catch(Exception e){ } st.append(".\n"); } StyleRange[] srs = new StyleRange[stylelist.size()]; stylelist.toArray(srs); st.setStyleRanges(srs); } public boolean is_construction(Object node, ClassGraph cg){ try{ Collection c = cg.getOutgoingEdges(node); Iterator c_i = c.iterator(); while(c_i.hasNext()){ EdgeI edge = (EdgeI) c_i.next(); if(!edge.isConstructionEdge()) return false; } } catch(Exception e){ return false; } return true; }