if (getContent() instanceof RootObject || getContent() instanceof RootCollection) {
options.add(new UserActionAbstract("Use as default view for " + getContent().getSpecification().getSingularName(), ActionType.USER) {
@Override
public void execute(final Workspace workspace, final View view, final Location at) {
final Options viewOptions = Properties.getViewConfigurationOptions(getSpecification());
getView().saveOptions(viewOptions);
// Options viewOptions =
final ObjectSpecification specification = content.getSpecification();
final Options settingsOptions = Properties.getDefaultViewOptions(specification);
settingsOptions.addOption("spec", getSpecification().getName());
}
});
}
/*
* options.add(new UserActionAbstract("Create new specification",
* UserAction.USER) { // TODO probably needs to be a replace with new
* view specification public void execute(final Workspace workspace,
* final View view, final Location at) { UserViewSpecification newSpec =
* new UserViewSpecification(getView()); Options viewOptions =
* Properties.getViewConfigurationOptions(newSpec);
* getView().saveOptions(viewOptions);
*
* viewOptions = Properties.getUserViewSpecificationOptions(newSpec);
* viewOptions.addOption("wrapped-specification",
* getSpecification().getClass().getName());
*
* Toolkit.getViewFactory().addSpecification(newSpec); } });
*/
options.add(new UserActionAbstract("Save specification", ActionType.USER) {
@Override
public void execute(final Workspace workspace, final View view, final Location at) {
final Options viewOptions = Properties.getViewConfigurationOptions(getSpecification());
getView().saveOptions(viewOptions);
Toolkit.getViewFactory().addSpecification(getSpecification());
}
});