public class PreviewWorkspaceDuplicateProvider implements WorkspaceDuplicateProvider{
@Override
public void duplicate(Workspace source, Workspace destination) {
PreviewController previewController=Lookup.getDefault().lookup(PreviewController.class);
PreviewModel sourceModel=previewController.getModel(source);
PreviewModel destModel=previewController.getModel(destination);
destModel.setManagedRenderers(sourceModel.getManagedRenderers());
for(PreviewProperty property:sourceModel.getProperties().getProperties()){
destModel.getProperties().putValue(property.getName(), property.getValue());
}
for(Entry<String,Object> property:sourceModel.getProperties().getSimpleValues()){
destModel.getProperties().putValue(property.getKey(), property.getValue());
}
}