{
Shell shell = (Shell) context.getUIContext().getProvider();
PrintStream out = shell.getOutput().out();
Project project = Projects.getSelectedProject(projectFactory, context.getUIContext());
Configuration projectConfig = null;
if (project != null)
{
projectConfig = project.getFacet(ConfigurationFacet.class).getConfiguration();
}
Iterator<?> userConfigKeys = userConfig.getKeys();
while (userConfigKeys.hasNext())
{
Object key = userConfigKeys.next();
if (key != null)
{
out.print(key.toString());
out.print("=");
out.print("user: [" + userConfig.getProperty(key.toString()) + "]");
if (projectConfig != null)
{
out.print(", project: ");
Object value = projectConfig.getProperty(key.toString());
if (value != null)
{
out.print("[" + value.toString() + "] ");
}
else
out.print("[]");
}
}
out.println();
}
if (projectConfig != null)
{
Iterator<?> projectConfigKeys = projectConfig.getKeys();
while (projectConfigKeys.hasNext())
{
String key = projectConfigKeys.next().toString();
if (!userConfig.containsKey(key))
{
out.print(key.toString());
out.print("=project: [");
out.print(projectConfig.getProperty(key.toString()).toString() + "]");
}
}
}
return Results.success();
}