KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > terracotta > dso > actions > ContactTerracottaAction


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package org.terracotta.dso.actions;
5
6 import org.eclipse.jface.action.Action;
7 import org.eclipse.jface.action.IAction;
8 import org.eclipse.jface.viewers.ISelection;
9 import org.eclipse.ui.IActionDelegate;
10 import org.eclipse.ui.IWorkbenchWindow;
11 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
12
13 import com.tc.admin.common.BrowserLauncher;
14
15 public class ContactTerracottaAction extends Action
16   implements IActionDelegate,
17              IWorkbenchWindowActionDelegate
18 {
19   public ContactTerracottaAction() {
20     super();
21   }
22
23   public void run(IAction action) {
24     String JavaDoc id = action.getId();
25     String JavaDoc url = null;
26     
27     if(id.equals("visitForumsAction")) {
28       url = "http://www.terracottatech.com/forums/";
29     }
30     else if(id.equals("contactSupportAction")) {
31       url = "http://www.terracottatech.com/support_services.shtml";
32     }
33     else if(id.equals("contactFieldAction")) {
34       url = "http://www.terracottatech.com/contact/field/";
35     }
36     else if(id.equals("contactSalesAction")) {
37       url = "http://www.terracottatech.com/contact/";
38     }
39
40     if(url != null) {
41       BrowserLauncher.openURL(url);
42     }
43   }
44
45   public void selectionChanged(IAction action, ISelection selection) {/**/}
46   public void dispose() {/**/}
47   public void init(IWorkbenchWindow window) {/**/}
48 }
49
Popular Tags