misc
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / html / InsertHTMLElementAction.java
1 /*
2  * $Id: InsertHTMLElementAction.java,v 1.1 2004-10-05 20:51:57 jsurfer Exp $
3  * Copyright Narushima Hironori. All rights reserved.
4  */
5 package net.sourceforge.phpeclipse.wizards.html;
6
7 import net.sourceforge.phpeclipse.wizards.html.EditElementWizard;
8
9 import org.eclipse.jface.action.IAction;
10 import org.eclipse.jface.viewers.ISelection;
11 import org.eclipse.jface.wizard.WizardDialog;
12 import org.eclipse.swt.SWT;
13 import org.eclipse.ui.*;
14 import org.eclipse.ui.texteditor.ITextEditor;
15
16
17 /**
18  * InsertTagAction
19  */
20 public class InsertHTMLElementAction implements IEditorActionDelegate {
21
22         ITextEditor targetEditor = null;
23
24         public InsertHTMLElementAction() {
25         }
26         
27         public void setActiveEditor(IAction action, IEditorPart targetEditor) {
28                 if(targetEditor instanceof ITextEditor){
29                         this.targetEditor = (ITextEditor)targetEditor;
30                 }
31         }
32
33         public void run(IAction action) {
34         
35                 WizardDialog wizDialog =
36                         new WizardDialog(
37                                 targetEditor.getSite().getShell(),
38                                 new EditElementWizard(targetEditor, null) ){
39
40                         protected int getShellStyle() {
41                                 return super.getShellStyle() | SWT.RESIZE;
42                         }
43                 };
44                 
45                 wizDialog.open();
46         }
47
48         public void selectionChanged(IAction action, ISelection selection) {
49         }
50
51 }