KickJava   Java API By Example, From Geeks To Geeks.

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


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.jdt.core.IMethod;
7 import org.terracotta.dso.ConfigurationHelper;
8
9 /**
10  * Marks the currently selected IMethod as being a distribute method.
11  *
12  * @see org.eclipse.jdt.core.IMethod
13  * @see org.terracotta.dso.ConfigurationHelper.isDistributedMethod
14  * @see org.terracotta.dso.ConfigurationHelper.ensureDistributedMethod
15  * @see org.terracotta.dso.ConfigurationHelper.ensureNotDistributedMethod
16  */

17
18 public class DistributedMethodAction extends BaseAction {
19   private IMethod m_method;
20   
21   public DistributedMethodAction() {
22     super("Distributed method", AS_CHECK_BOX);
23   }
24   
25   public void setMethod(IMethod method) {
26     setJavaElement(m_method = method);
27     setChecked(getConfigHelper().isDistributedMethod(method));
28   }
29   
30   public void performAction() {
31     ConfigurationHelper helper = getConfigHelper();
32     
33     if(isChecked()) {
34       helper.ensureDistributedMethod(m_method);
35     }
36     else {
37       helper.ensureLocalMethod(m_method);
38     }
39
40     inspectCompilationUnit();
41   }
42 }
43
Popular Tags