2 * $Id: InsertHTMLElementAction.java,v 1.3 2006-10-21 23:18:43 pombredanne Exp $
3 * Copyright Narushima Hironori. All rights reserved.
5 package net.sourceforge.phpeclipse.wizards.html;
7 import org.eclipse.jface.action.IAction;
8 import org.eclipse.jface.viewers.ISelection;
9 import org.eclipse.jface.wizard.WizardDialog;
10 import org.eclipse.swt.SWT;
11 import org.eclipse.ui.IEditorActionDelegate;
12 import org.eclipse.ui.IEditorPart;
13 import org.eclipse.ui.texteditor.ITextEditor;
18 public class InsertHTMLElementAction implements IEditorActionDelegate {
20 ITextEditor targetEditor = null;
22 public InsertHTMLElementAction() {
25 public void setActiveEditor(IAction action, IEditorPart targetEditor) {
26 if (targetEditor instanceof ITextEditor) {
27 this.targetEditor = (ITextEditor) targetEditor;
31 public void run(IAction action) {
33 WizardDialog wizDialog = new WizardDialog(targetEditor.getSite()
34 .getShell(), new EditElementWizard(targetEditor, null)) {
36 protected int getShellStyle() {
37 return super.getShellStyle() | SWT.RESIZE;
44 public void selectionChanged(IAction action, ISelection selection) {