forked from phoedos/pmd
added more detail to designer display
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4511 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -30,6 +30,20 @@ public class ASTPrimaryPrefix extends SimpleJavaNode {
|
||||
return this.usesSuperModifier;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
String out = getImage();
|
||||
if (usesSuperModifier) {
|
||||
return "super." + out;
|
||||
} else if (usesThisModifier) {
|
||||
if (getImage() == null) {
|
||||
return "this";
|
||||
} else {
|
||||
return "this." + out;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
public void dump(String prefix) {
|
||||
String out = getImage();
|
||||
if (usesSuperModifier) {
|
||||
|
@ -67,6 +67,13 @@ public abstract class SimpleNode implements Node {
|
||||
return beginLine;
|
||||
}
|
||||
|
||||
// A label is a more visually useful image, e.g.
|
||||
// int[[ for a primary suffix that's a 2D array of ints
|
||||
// this is used only by the Designer to show nodes more helpfully
|
||||
public String getLabel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean hasImageEqualTo(String arg) {
|
||||
return image != null && image.equals(arg);
|
||||
}
|
||||
|
@ -236,7 +236,12 @@ public class Designer implements ClipboardOwner {
|
||||
public String label() {
|
||||
if (node instanceof SimpleNode) {
|
||||
SimpleNode sn = (SimpleNode)node;
|
||||
if (sn.getImage() == null) return node.toString();
|
||||
if (sn.getLabel() != null) {
|
||||
return node.toString() + LABEL_IMAGE_SEPARATOR + sn.getLabel();
|
||||
}
|
||||
if (sn.getImage() == null) {
|
||||
return node.toString();
|
||||
}
|
||||
return node.toString() + LABEL_IMAGE_SEPARATOR + sn.getImage();
|
||||
}
|
||||
return node.toString();
|
||||
|
Reference in New Issue
Block a user