Skip to content

Commit

Permalink
RequiresProjectPredicate now uses Projects class
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 3, 2014
1 parent 249ca7d commit a993fd8
Showing 1 changed file with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@

import javax.inject.Inject;

import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.projects.ProjectFactory;
import org.jboss.forge.addon.resource.FileResource;
import org.jboss.forge.addon.projects.Projects;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UISelection;
import org.jboss.forge.furnace.util.Predicate;

/**
Expand All @@ -29,27 +27,6 @@ public class RequiresProjectPredicate implements Predicate<UIContext>
@Override
public boolean accept(UIContext context)
{
UISelection<FileResource<?>> initialSelection = context.getInitialSelection();
if (!initialSelection.isEmpty())
{
return projectFactory.containsProject(initialSelection.get());
}
return false;
return Projects.containsProject(projectFactory, context);
}

protected Project getProject(UIContext context)
{
UISelection<FileResource<?>> initialSelection = context.getInitialSelection();
if (!initialSelection.isEmpty())
{
return projectFactory.findProject(initialSelection.get());
}
return null;
}

protected ProjectFactory getProjectFactory()
{
return projectFactory;
}

}

0 comments on commit a993fd8

Please sign in to comment.