Java Code Examples for org.stringtemplate.v4.ST#getAttributes()

The following examples show how to use org.stringtemplate.v4.ST#getAttributes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 2
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
	Map<String, Object> attrs = st.getAttributes();
	if ( attrs==null ) return;
	for (String a : attrs.keySet()) {
		String descr;
		if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
			List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
			StringBuilder locations = new StringBuilder();
			int i = 0;
			if ( events!=null ) {
				for (AddAttributeEvent ae : events) {
					if ( i>0 ) locations.append(", ");
					locations.append(ae.getFileName()+":"+ae.getLine());
					i++;
				}
			}
			if ( locations.length()>0 ) {
				descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
			}
			else {
				descr = a + " = " +attrs.get(a);
			}
		}
		else {
			descr = a + " = " +attrs.get(a);
		}

		if (!names.add(a)) {
			StringBuilder builder = new StringBuilder();
			builder.append("<html><font color=\"gray\">");
			builder.append(StringRenderer.escapeHTML(descr));
			builder.append("</font></html>");
			descr = builder.toString();
		}

		node.addChild( new StringTree(descr) );
	}
}
 
Example 3
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 4
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 5
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 6
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 7
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 8
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 9
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState !=null && st.debugState.addAttrEvents !=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 10
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 11
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 12
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length() >0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 13
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 14
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 15
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 16
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length() >0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
Example 17
Source File: JTreeScopeStackModel.java    From codebuff with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}