Revision 38619 branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/actioninfo/impl/DefaultActionInfoManager.java
DefaultActionInfoManager.java | ||
---|---|---|
30 | 30 |
ActionInfo action = new DefaultActionInfo(extension, actionName, text, command, icon, enableText, position, tip); |
31 | 31 |
ActionInfo previous = this.getAction(action.getName()); |
32 | 32 |
if( previous != null ) { |
33 |
action.merge(previous);
|
|
33 |
((DefaultActionInfo)action).merge(previous);
|
|
34 | 34 |
} |
35 | 35 |
if( name == null ){ |
36 | 36 |
logger.info("createAction: name of action is null/empty, rename to '"+actionName+"' ("+action.toString()+")."); |
... | ... | |
62 | 62 |
} |
63 | 63 |
ActionInfo previous = this.getAction(action.getName()); |
64 | 64 |
if( previous != null ) { |
65 |
previous.merge(action);
|
|
65 |
((DefaultActionInfo)previous).merge(action);
|
|
66 | 66 |
return previous; |
67 | 67 |
} else { |
68 | 68 |
this.actions.put(action.getName(), action); |
... | ... | |
98 | 98 |
public ActionInfoStatusCache createActionStatusCache() { |
99 | 99 |
return new DefaultActionInfoStatusCache(); |
100 | 100 |
} |
101 |
|
|
102 |
public ActionInfo replaceAction(ActionInfo newAction, String oldAction) { |
|
103 |
ActionInfo old = this.actions.get(oldAction); |
|
104 |
ActionInfo info = this.createAction(null, oldAction, null, null, null, null, 0, null); |
|
105 |
info.merge(newAction); |
|
106 |
this.actions.put(oldAction, info); |
|
107 |
return old; |
|
108 |
} |
|
109 | 101 |
|
102 |
public void redirect(String sourceName, String targetName) { |
|
103 |
ActionInfo source = this.getAction(sourceName); |
|
104 |
if( source == null ) { |
|
105 |
throw new IllegalArgumentException("Can't locate source action '"+sourceName+"'."); |
|
106 |
} |
|
107 |
ActionInfo target = this.getAction(targetName); |
|
108 |
if( target == null ) { |
|
109 |
throw new IllegalArgumentException("Can't locate target action '"+targetName+"'."); |
|
110 |
} |
|
111 |
source.getRedirections().add(target); |
|
112 |
} |
|
113 |
|
|
110 | 114 |
} |
Also available in: Unified diff