KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > editor2d > actions > EditorPasteTemplateAction


1 /**
2  * <p> Project: com.nightlabs.editor2d </p>
3  * <p> Copyright: Copyright (c) 2004 </p>
4  * <p> Company: NightLabs GmbH (Germany) </p>
5  * <p> Creation Date: 11.11.2004 </p>
6  * <p> Author: Daniel Mazurek </p>
7 **/

8 package com.nightlabs.editor2d.actions;
9
10 import org.eclipse.draw2d.geometry.Point;
11 import org.eclipse.gef.requests.CreationFactory;
12 import org.eclipse.ui.IEditorPart;
13
14 import com.nightlabs.editor2d.model.ModelCreationFactory;
15
16
17 public class EditorPasteTemplateAction
18 extends PasteTemplateAction
19 {
20
21   /**
22    * Constructor for LogicPasteTemplateAction.
23    * @param editor
24    */

25   public EditorPasteTemplateAction(IEditorPart editor) {
26     super(editor);
27   }
28
29   /**
30    * @see org.eclipse.gef.ui.actions.PasteTemplateAction#getFactory(java.lang.Object)
31    */

32   protected CreationFactory getFactory(Object JavaDoc template)
33   {
34     // TODO see if it works with class
35
if (template instanceof Class JavaDoc)
36       return new ModelCreationFactory((Class JavaDoc)template);
37     
38     return null;
39   }
40
41   /**
42    *
43    * @see org.eclipse.gef.examples.logicdesigner.actions.PasteTemplateAction#getPasteLocation()
44    */

45   protected Point getPasteLocation() {
46     return new Point(10, 10);
47   }
48
49 }
50
Popular Tags