org.nakedobjects.nos.client.dnd.tree.NodeSpecification Maven / Gradle / Ivy
package org.nakedobjects.nos.client.dnd.tree;
import org.nakedobjects.nos.client.dnd.Content;
import org.nakedobjects.nos.client.dnd.View;
import org.nakedobjects.nos.client.dnd.ViewAxis;
import org.nakedobjects.nos.client.dnd.ViewSpecification;
import org.nakedobjects.nos.client.dnd.basic.NullFocusManager;
abstract class NodeSpecification implements ViewSpecification {
public static final int CAN_OPEN = 1;
public static final int CANT_OPEN = 2;
public static final int UNKNOWN = 0;
private ViewSpecification replacementNodeSpecification;
public abstract int canOpen(final Content content);
protected abstract View createNodeView(final Content content, final ViewAxis axis);
public final View createView(final Content content, final ViewAxis axis) {
View view = createNodeView(content, axis);
TreeNodeBorder newView = new TreeNodeBorder(view, replacementNodeSpecification);
newView.setFocusManager(new NullFocusManager());
return newView;
}
public boolean isAligned() {
return false;
}
public boolean isOpen() {
return false;
}
public boolean isReplaceable() {
return false;
}
public boolean isSubView() {
return true;
}
final void setReplacementNodeSpecification(final ViewSpecification replacementNodeSpecification) {
this.replacementNodeSpecification = replacementNodeSpecification;
}
}
// Copyright (c) Naked Objects Group Ltd.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy