From 6c8512b897141883069605874c669c993512c2d9 Mon Sep 17 00:00:00 2001 From: nickdavis Date: Fri, 6 Apr 2001 15:51:23 +0000 Subject: [PATCH] removed the use of JDK 1.3 feature (Button.getAction) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268924 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/gui/command/NewElementCmd.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/antidote/org/apache/tools/ant/gui/command/NewElementCmd.java b/src/antidote/org/apache/tools/ant/gui/command/NewElementCmd.java index 043a5ef79..183068def 100644 --- a/src/antidote/org/apache/tools/ant/gui/command/NewElementCmd.java +++ b/src/antidote/org/apache/tools/ant/gui/command/NewElementCmd.java @@ -109,11 +109,11 @@ public class NewElementCmd extends AbstractCommand { String name = button.getText(); // Get the AntAction - Action action = button.getAction(); - if (!(action instanceof AntAction)) { + String cmdStr = button.getActionCommand(); + AntAction antAction = getContext().getActions().getAction(cmdStr); + if (antAction == null) { return; } - AntAction antAction = (AntAction) action; ACSElement e = vals[vals.length - 1]; @@ -153,3 +153,5 @@ public class NewElementCmd extends AbstractCommand { } } + +