Revision 37876

View differences:

trunk/applications/appgvSIG/src/org/gvsig/fmap/swing/toc/action/TOCActionFactoryAdapter.java
40 40
public class TOCActionFactoryAdapter implements TOCActionFactory {
41 41

  
42 42
    private IContextMenuAction icma = null;
43
    private String name = null;
43 44

  
44 45
    public static final String DYN_CLASS_NAME =
45 46
        TOCActionFactoryAdapter.class.getName() + "_DynClass";
......
71 72
    }
72 73

  
73 74
    public String getName() {
74
        return icma.getClass().getName() + "_TOCActionFactoryAdapter";
75
    	if (name == null) {
76
    		name = icma.getClass().getName() + "_TOCActionFactoryAdapter";
77
    	}
78
        return name;
75 79
    }
76

  
80
    
81
    /**
82
     * Useful to register OldTocMenuEntry wrappers.
83
     * @param name
84
     */
85
    public void setName(String name) {
86
    	this.name = name + "_TOCActionFactoryAdapter";
87
    }
88
 
77 89
    public void initialize() {
78 90
    }
79 91

  
trunk/applications/appgvSIG/src/org/gvsig/fmap/swing/impl/toc/DefaultTOCManager.java
27 27

  
28 28
import com.iver.cit.gvsig.fmap.MapContext;
29 29
import com.iver.cit.gvsig.project.documents.IContextMenuAction;
30
import com.iver.cit.gvsig.project.documents.view.toc.actions.OldTocContextMenuAction;
30 31
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
31 32

  
32 33
import org.gvsig.fmap.swing.toc.TOC;
......
77 78

  
78 79
    public void addServiceFactory(IContextMenuAction icma) {
79 80
        TOCActionFactoryAdapter ada = new TOCActionFactoryAdapter(icma);
81
        if (icma instanceof OldTocContextMenuAction) {
82
        	ada.setName(((OldTocContextMenuAction) icma).getEntry().getClass().toString()); 
83
        }
80 84
        addServiceFactory(ada);
81 85
    }
82 86

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/gui/FPopupMenu.java
126 126

  
127 127
    	OldTocContextMenuAction action = new OldTocContextMenuAction();
128 128
    	action.setEntry(entry);
129
    	
129
    	System.out.println("Add old TocMenuEntry: " + entry);
130 130
    	TOCManager tm = TOCLocator.getInstance().getTOCManager();
131 131
		tm.addServiceFactory(action);
132 132
    }
......
296 296
			if (!action.isVisible() ||
297 297
					(action instanceof TOCActionAdapter &&
298 298
							((TOCActionAdapter) action).getContextMenuAction() instanceof OldTocContextMenuAction)) {
299
				if (((action instanceof TOCActionAdapter) && ((TOCActionAdapter) action).getContextMenuAction() instanceof OldTocContextMenuAction)) {
300
					OldTocContextMenuAction oldAct = (OldTocContextMenuAction) ((TOCActionAdapter) action).getContextMenuAction();
301
					oldAct.getEntry().initialize(this);
302
				}
299 303
				continue;
300 304
			}
301 305
			

Also available in: Unified diff