Browse Source

modified getDisplayName to display common attribute information

(eg "mkdir: ${build.dir}")


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268945 13f79535-47bb-0310-9956-ffa450edef68
master
nickdavis 24 years ago
parent
commit
31dfcee606
1 changed files with 38 additions and 0 deletions
  1. +38
    -0
      src/antidote/org/apache/tools/ant/gui/acs/ACSDtdDefinedElement.java

+ 38
- 0
src/antidote/org/apache/tools/ant/gui/acs/ACSDtdDefinedElement.java View File

@@ -97,6 +97,44 @@ implements ACSInfoProvider {
return getTagName();
}

/**
* Get the display name of this.
*
* @return Display name.
*/
public String getDisplayName() {
String name = getTagName();

// Is there only one attribute?
if (getAttributes().getLength() == 1) {
Node onlyNode = getAttributes().item(0);

// Display the only attribute
name += ": " + onlyNode.getNodeValue();
} else {
// Display one of these attributes
// if they are present.
final String[] DISPLAY_ATTRIBUTES =
{
"name",
"id",
"property"
};

for(int i = 0; i < DISPLAY_ATTRIBUTES.length; i++) {
Node testNode =
getAttributes().getNamedItem(DISPLAY_ATTRIBUTES[i]);
if (testNode != null) {
name += ": " + testNode.getNodeValue();
break;
}
}
}
return name;
}
/**
* Set the task type.
*


Loading…
Cancel
Save