Project

General

Profile

« Previous | Next » 

Revision 3be6ef3e

Added by Niels Hoffmann over 13 years ago

performed javacscript:fix and worked on documentation

View differences:

taxeditor-application/src/main/java/eu/etaxonomy/taxeditor/SaveHandler.java
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

  
11
package eu.etaxonomy.taxeditor;
12

  
13
import org.apache.log4j.Logger;
14
import org.eclipse.core.commands.AbstractHandler;
15
import org.eclipse.core.commands.ExecutionEvent;
16
import org.eclipse.core.commands.ExecutionException;
17
import org.eclipse.ui.IEditorPart;
18
import org.eclipse.ui.handlers.HandlerUtil;
19

  
20
/**
21
 * Now handled entirely by native save action. 
22
 * 
23
 * @author p.ciardelli
24
 * @created 04.09.2009
25
 * @version 1.0
26
 * @deprecated
27
 * @see ApplicationActionBarAdvisor
28
 */
29
public class SaveHandler extends AbstractHandler {
30
	private static final Logger logger = Logger.getLogger(SaveHandler.class);
31

  
32
	/* (non-Javadoc)
33
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
34
	 */
35
	public Object execute(ExecutionEvent event) throws ExecutionException {
36
		IEditorPart editor = HandlerUtil.getActiveEditor(event);
37
		if (editor != null) {
38
			HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveEditor(editor, false);
39
		}
40
		return null;
41
	}
42
}
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

  
11
package eu.etaxonomy.taxeditor;
12

  
13
import org.apache.log4j.Logger;
14
import org.eclipse.core.commands.AbstractHandler;
15
import org.eclipse.core.commands.ExecutionEvent;
16
import org.eclipse.core.commands.ExecutionException;
17
import org.eclipse.ui.IEditorPart;
18
import org.eclipse.ui.handlers.HandlerUtil;
19

  
20
/**
21
 * Now handled entirely by native save action.
22
 *
23
 * @author p.ciardelli
24
 * @created 04.09.2009
25
 * @version 1.0
26
 * @see ApplicationActionBarAdvisor
27
 */
28
public class SaveHandler extends AbstractHandler {
29
	private static final Logger logger = Logger.getLogger(SaveHandler.class);
30

  
31
	/* (non-Javadoc)
32
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
33
	 */
34
	/** {@inheritDoc} */
35
	public Object execute(ExecutionEvent event) throws ExecutionException {
36
		IEditorPart editor = HandlerUtil.getActiveEditor(event);
37
		if (editor != null) {
38
			HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveEditor(editor, false);
39
		}
40
		return null;
41
	}
42
}

Also available in: Unified diff