/** * Returns a Styled String out of the {@link MethodIdent} objects which looks like: * 'name'('parameter') - 'package'.'class'. Additionally, as this returns a {@link StyledString} * , the last part is colored. * * @param methodIdent * The object which contains the information to create the styled method string. * @return The created styled method string. */ public static StyledString getStyledMethodString(MethodIdent methodIdent) { StyledString styledString = new StyledString(); styledString.append(getMethodWithParameters(methodIdent)); String decoration; if ((methodIdent.getPackageName() != null) && !methodIdent.getPackageName().equals("")) { decoration = MessageFormat.format("- {0}.{1}", new Object[] { methodIdent.getPackageName(), methodIdent.getClassName() }); } else { decoration = MessageFormat.format("- {0}", new Object[] { methodIdent.getClassName() }); } styledString.append(decoration, StyledString.QUALIFIER_STYLER); return styledString; }
styledString.append(getMethodWithParameters(methodIdent) + " - " + methodIdent.getFQN());
switch (enumId) { case METHOD_CONSTRUCTOR: return new StyledString(TextFormatter.getMethodWithParameters(methodIdent)); case EVENT_TYPE: styledString = new StyledString(data.getExceptionEvent().toString());
return new StyledString(methodIdent.getClassName()); case METHOD: return new StyledString(TextFormatter.getMethodWithParameters(methodIdent)); case INVOCATION_AFFILLIATION: int percentage = (int) (data.getInvocationAffiliationPercentage() * 100);
return new StyledString(TextFormatter.getMethodWithParameters(methodIdent)); } else { return emptyStyledString;
return new StyledString(methodIdent.getClassName()); case METHOD: return new StyledString(TextFormatter.getMethodWithParameters(methodIdent)); case COUNT: return new StyledString(String.valueOf(data.getCount()));