01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.actions;
05:
06: import org.eclipse.core.resources.IFile;
07: import org.eclipse.jface.action.Action;
08: import org.eclipse.jface.action.IAction;
09: import org.eclipse.jface.viewers.ISelection;
10: import org.eclipse.jface.viewers.IStructuredSelection;
11: import org.eclipse.ui.IActionDelegate;
12: import org.eclipse.ui.IWorkbenchWindow;
13: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
14: import org.terracotta.dso.TcPlugin;
15:
16: public class MakeConfigFileAction extends Action implements
17: IActionDelegate, IWorkbenchWindowActionDelegate {
18: private IFile m_file;
19:
20: public MakeConfigFileAction() {
21: super ("Make Current Config File");
22: }
23:
24: public void run(IAction action) {
25: TcPlugin.getDefault().setup(m_file);
26: }
27:
28: public void selectionChanged(IAction action, ISelection selection) {
29: if (selection instanceof IStructuredSelection) {
30: m_file = (IFile) ((IStructuredSelection) selection)
31: .getFirstElement();
32: }
33: }
34:
35: public void dispose() {/**/
36: }
37:
38: public void init(IWorkbenchWindow window) {/**/
39: }
40: }
|