use of com.liferay.ide.maven.core.model.NewLiferayProfileOp in project liferay-ide by liferay.
the class AbstractProjectMarkerResolution method run.
public void run(IMarker marker) {
IProject project = marker.getResource().getProject();
IProjectConfigurationManager projectManager = MavenPlugin.getProjectConfigurationManager();
ResolverConfiguration configuration = projectManager.getResolverConfiguration(project);
List<String> currentProfiles = configuration.getActiveProfileList();
NewLiferayProfileOp op = NewLiferayProfileOp.TYPE.instantiate();
ElementList<Profile> selectedProfiles = op.getSelectedProfiles();
for (String currentProfile : currentProfiles) {
selectedProfiles.insert().setId(currentProfile);
}
int result = promptUser(project, op);
if (result == SapphireDialog.OK) {
configuration.setSelectedProfiles(op.getActiveProfilesValue().content());
boolean changed = projectManager.setResolverConfiguration(project, configuration);
if (changed) {
WorkspaceJob job = new WorkspaceJob("Updating project " + project.getName()) {
public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
MavenPlugin.getProjectConfigurationManager().updateProjectConfiguration(project, monitor);
} catch (CoreException ce) {
return ce.getStatus();
}
return Status.OK_STATUS;
}
};
job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
job.schedule();
}
}
}
Aggregations