protected void init() throws Exception { String projectName = "MobileMedia_Eval"; IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); Set<IFeature> features = FeatureModelManager.getInstance().getFeatureModel(project).getFeatures(); for (IFeature f : features) { TreeItem featureNode = new TreeItem(tree.getTree(), SWT.DEFAULT); featureNode.setText(f.getName()); featureNode.setData(f); String targetAnnotationFile = "target_" + f.getName() + ".log"; Set<String> targetNodes = AutoEval.readElements(project.getFile(targetAnnotationFile)); ApplicationController lDB = ApplicationController.getInstance(); for (AElement element : lDB.getAllElements()) if (targetNodes.contains(element.getId())) if (!lDB.getElementColors(element).contains(f)) { TreeItem elementNode = new TreeItem(featureNode, SWT.DEFAULT); elementNode.setText(element.getDisplayName()); elementNode.setData(element); } } }
protected void clearEvaluationStrategyCache(IProject project) { IEvaluationStrategy strategy; try { IFeatureModel featureModel = FeatureModelManager.getInstance().getFeatureModel(project); strategy = EvaluationStrategyManager.getInstance().getEvaluationStrategy(project); strategy.clearCache(featureModel); } catch (FeatureModelNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); return; } }
public ColoredSourceFile getSourceFile() { ITypeRoot java = getInputJavaElement(); assert java != null; assert java.getResource() instanceof IFile; IFile file = (IFile) java.getResource(); if (file != null) { IFeatureModel featureModel; try { featureModel = FeatureModelManager.getInstance().getFeatureModel(file.getProject()); } catch (FeatureModelNotFoundException e) { e.printStackTrace(); assert false : e; return null; } return ColoredSourceFile.getColoredSourceFile(file, featureModel); } return null; }