org.nakedobjects.nos.client.dnd.builder.AbstractCompositeViewSpecification Maven / Gradle / Ivy
package org.nakedobjects.nos.client.dnd.builder;
import org.nakedobjects.noa.adapter.NakedObject;
import org.nakedobjects.nof.core.context.NakedObjectsContext;
import org.nakedobjects.nos.client.dnd.CompositeViewBuilder;
import org.nakedobjects.nos.client.dnd.CompositeViewSpecification;
import org.nakedobjects.nos.client.dnd.Content;
import org.nakedobjects.nos.client.dnd.ObjectContent;
import org.nakedobjects.nos.client.dnd.View;
import org.nakedobjects.nos.client.dnd.ViewAxis;
public abstract class AbstractCompositeViewSpecification implements CompositeViewSpecification {
protected CompositeViewBuilder builder;
public View createView(final Content content, final ViewAxis axis) {
ViewAxis ax = builder.createViewAxis();
if (ax == null) {
ax = axis;
}
return builder.createCompositeView(content, this, ax);
}
public CompositeViewBuilder getSubviewBuilder() {
return builder;
}
public View decorateSubview(final View subview) {
return subview;
}
public boolean isOpen() {
return true;
}
public boolean isReplaceable() {
return true;
}
public boolean isSubView() {
return false;
}
public boolean isAligned() {
return false;
}
protected void resolveObject(final Content content) {
NakedObject object = ((ObjectContent) content).getObject();
if (!object.getResolveState().isResolved()) {
NakedObjectsContext.getObjectPersistor().resolveImmediately(object);
}
}
}
// Copyright (c) Naked Objects Group Ltd.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy