Started with PHP/HTML Formatter menu => doesn't work right now
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.jtidy / src / net / sourceforge / phpdt / tidy / actions / AbstractJTidyObjectAction.java
1 /**
2  * Created on 13.01.2003 by Jan Schulz
3  */
4 package net.sourceforge.phpdt.tidy.actions;
5
6 import org.eclipse.jface.action.IAction;
7 import org.eclipse.jface.viewers.ISelection;
8 import org.eclipse.swt.widgets.Shell;
9 import org.eclipse.ui.IObjectActionDelegate;
10 import org.eclipse.ui.IWorkbenchPart;
11
12 /**
13  * @author jan
14  * @since 13.01.2003
15  */
16 public  abstract class AbstractJTidyObjectAction extends AbstractJTidyAction implements IObjectActionDelegate {
17         private Shell fShell;
18         /* (non-Javadoc)
19          * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
20          */
21         public void setActivePart(IAction action, IWorkbenchPart targetPart) {
22                 fShell = targetPart.getSite().getShell();
23                 // No need to do something here...
24         }
25         /* (non-Javadoc)
26          * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
27          */
28         public abstract void run(IAction action);
29         /* (non-Javadoc)
30          * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
31          */
32         public void selectionChanged(IAction action, ISelection selection) {
33                 updateSelection(selection);
34                 updateParent(action);
35         }
36         
37         /* (non-Javadoc)
38          * @see net.sourceforge.phpdt.tidy.actions.AbstractJTidyAction#getShell()
39          */
40         protected Shell getShell() {
41                 return fShell;
42         }
43
44
45 }