1 4 package org.terracotta.dso.actions; 5 6 import org.eclipse.jdt.core.IJavaElement; 7 import org.eclipse.jdt.core.IType; 8 import org.terracotta.dso.ConfigurationHelper; 9 import org.terracotta.dso.TcPlugin; 10 11 19 20 public class ExcludedTypeAction extends BaseAction { 21 public ExcludedTypeAction() { 22 super("Excluded", AS_CHECK_BOX); 23 } 24 25 public void setJavaElement(IJavaElement element) { 26 super.setJavaElement(element); 27 28 if(element instanceof IType) { 29 IType type = (IType)element; 30 boolean isBootClass = TcPlugin.getDefault().isBootClass(type); 31 32 setEnabled(!isBootClass); 33 setChecked(!isBootClass && getConfigHelper().isExcluded(type)); 34 } 35 else { 36 setChecked(getConfigHelper().isExcluded(element)); 37 } 38 } 39 40 public void performAction() { 41 ConfigurationHelper helper = getConfigHelper(); 42 43 if(isChecked()) { 44 helper.ensureExcluded(m_element); 45 } 46 else { 47 helper.ensureNotExcluded(m_element); 48 } 49 50 inspectCompilationUnit(); 51 } 52 } 53 | Popular Tags |