1
/*FreeMind - A Program for creating and viewing Mindmaps
2
*Copyright (C) 2000-2006 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitri Polivaev and others.
4
*See COPYING for Details
6
*This program is free software; you can redistribute it and/or
7
*modify it under the terms of the GNU General Public License
8
*as published by the Free Software Foundation; either version 2
9
*of the License, or (at your option) any later version.
11
*This program is distributed in the hope that it will be useful,
12
*but WITHOUT ANY WARRANTY; without even the implied warranty of
13
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
*GNU General Public License for more details.
16
*You should have received a copy of the GNU General Public License
17
*along with this program; if not, write to the Free Software
18
*Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* Created on 29.01.2006
22
* Created by Dimitri Polivaev
24
package freemind.modes.mindmapmode.attributeactors;
26
import freemind.controller.actions.generated.instance.UnregistryAttributeValueElementaryAction;
27
import freemind.controller.actions.generated.instance.XmlAction;
28
import freemind.modes.mindmapmode.MindMapController;
29
import freemind.modes.mindmapmode.actions.xml.AbstractActorXml;
30
import freemind.modes.mindmapmode.actions.xml.ActionPair;
32
public class UnregistryAttributeValueActor extends AbstractActorXml {
34
public UnregistryAttributeValueActor(MindMapController mindMapModeController) {
35
super(mindMapModeController);
38
public XmlAction createAction(String name, String value){
39
UnregistryAttributeValueElementaryAction action = new UnregistryAttributeValueElementaryAction();
41
action.setValue(value);
45
public ActionPair createActionPair(String name, String value){
46
ActionPair actionPair = new ActionPair(
47
createAction(name, value),
48
((MindMapModeAttributeController)getAttributeController()).registryAttributeValueActor.createAction(name, value)
53
public void act(XmlAction action) {
54
if(action instanceof UnregistryAttributeValueElementaryAction){
55
UnregistryAttributeValueElementaryAction unrregistryAttributeValueAction = (UnregistryAttributeValueElementaryAction)action;
56
act(unrregistryAttributeValueAction.getName(),
57
unrregistryAttributeValueAction.getValue());
62
private void act(String name, String value) {
63
getAttributeRegistry().getElement(name).removeValue(value);
66
public Class getDoActionClass() {
67
return UnregistryAttributeValueElementaryAction.class;