Revision 41081 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.editing.app/org.gvsig.editing.app.mainplugin/src/main/java/org/gvsig/editing/StartEditing.java

View differences:

StartEditing.java
31 31

  
32 32
import org.slf4j.Logger;
33 33
import org.slf4j.LoggerFactory;
34

  
35 34
import org.gvsig.andami.PluginServices;
36 35
import org.gvsig.andami.messages.Messages;
37 36
import org.gvsig.andami.messages.NotificationManager;
38 37
import org.gvsig.andami.plugins.Extension;
38
import org.gvsig.andami.plugins.IExtensionExecuteWithArgs;
39 39
import org.gvsig.app.ApplicationLocator;
40 40
import org.gvsig.app.gui.preferencespage.GridPage;
41 41
import org.gvsig.app.project.documents.view.ViewDocument;
......
51 51
import org.gvsig.utils.console.jedit.Token;
52 52

  
53 53

  
54
/**
55
 * DOCUMENT ME!
56
 *
57
 * @author Vicente Caballero Navarro
58
 */
59
public class StartEditing extends Extension {
54
public class StartEditing extends Extension implements IExtensionExecuteWithArgs {
60 55
    
61 56
    private static Logger logger = LoggerFactory.getLogger(StartEditing.class);
62 57

  
63
//	private class MyAction extends AbstractAction
64
//	{
65
//
66
//		public void actionPerformed(ActionEvent e) {
67
//			System.err.println("F3");
68
//		}
69
//
70
//	}
71

  
72
	//View vista;
73
	/**
74
	 * @see org.gvsig.andami.plugins.IExtension#initialize()
75
	 */
76 58
	public void initialize() {
77 59
	}
78 60

  
79
	/**
80
	 * @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String)
81
	 */
82 61
    public void execute(String actionCommand) {
62
		this.execute(actionCommand, null);
63
	}
64
	
65
	public void execute(String actionCommand, Object[] args) {
83 66

  
84 67
        if (actionCommand.compareTo("layer-start-editing") == 0) {
85 68

  
69
        	FLayer[] selectedItems = null;
70
    		// Desde el menu contextual del TOC se le pasan las capas seleccionadas como primer argumento.
71
        	if( args!=null && args.length>0 && args[0] instanceof FLayer[] ) {
72
        		selectedItems = (FLayer[]) args[0];
73
        	}
74
        	
86 75
            org.gvsig.andami.ui.mdiManager.IWindow f =
87 76
                PluginServices.getMDIManager().getActiveWindow();
88 77

  
......
163 152
    }
164 153

  
165 154

  
166
//	 private void registerKeyStrokes() {
167
//		 JComponent theComponent = vista.getConsolePanel().getTxt();
168
//
169
//		 // The actions
170
//		 Action F3Action = new AbstractAction("REFENT") {
171
//			public void actionPerformed(ActionEvent evt) {
172
//				System.err.println("SOY F3");
173
//			}
174
//		};
175
//
176
//		 InputMap inputMap = theComponent.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
177
//		 inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0), F3Action.getValue(Action.NAME));
178
//
179
//		 ActionMap actionMap = theComponent.getActionMap();
180
//		 // actionMap.put("REFENT", new MyAction());
181
//		 actionMap.put(F3Action.getValue(Action.NAME), F3Action);
182
//
183
//	}
184 155

  
185 156
	public static void startCommandsApplicable(DefaultViewPanel vista,FLyrVect lv) {
186 157
	    if (vista==null)
......
204 175

  
205 176
	}
206 177

  
207
//	private void changeModelTable(ProjectTable pt, VectorialEditableAdapter vea){
208
//   	 com.iver.andami.ui.mdiManager.IWindow[] views = PluginServices.getMDIManager().getAllWindows();
209
//
210
//		for (int i=0 ; i<views.length ; i++){
211
//			if (views[i] instanceof Table){
212
//				Table table=(Table)views[i];
213
//				ProjectTable model =table.getModel();
214
//				if (model.equals(pt)){
215
//						table.setModel(pt);
216
//						vea.getCommandRecord().addCommandListener(table);
217
//				}
218
//			}
219
//		}
220
//   }
221
	/**
222
	 * @see org.gvsig.andami.plugins.IExtension#isEnabled()
223
	 */
178

  
224 179
	public boolean isEnabled() {
225 180
		return true;
226 181
	}
227 182

  
228
	/**
229
	 * @see org.gvsig.andami.plugins.IExtension#isVisible()
230
	 */
231 183
	public boolean isVisible() {
232 184
		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager()
233 185
				.getActiveWindow();

Also available in: Unified diff