All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nakedobjects.nos.client.dnd.basic.UnlinedTextFieldSpecification Maven / Gradle / Ivy

package org.nakedobjects.nos.client.dnd.basic;

import org.nakedobjects.nos.client.dnd.Content;
import org.nakedobjects.nos.client.dnd.ValueContent;
import org.nakedobjects.nos.client.dnd.View;
import org.nakedobjects.nos.client.dnd.ViewAxis;
import org.nakedobjects.nos.client.dnd.builder.AbstractFieldSpecification;
import org.nakedobjects.nos.client.dnd.view.field.SingleLineTextField;


/**
 * Creates a single line text field without the baseline being drawn.
 */
public class UnlinedTextFieldSpecification extends AbstractFieldSpecification {
    public boolean canDisplay(final Content content) {
        return content.isValue() && content instanceof ValueContent && ((ValueContent) content).getNoLines() == 1;
    }

    public View createView(final Content content, final ViewAxis axis) {
        return new SingleLineTextField((ValueContent) content, this, axis, false);
    }

    public String getName() {
        return "Single Line Text Field";
    }
    
    public boolean isAligned() {
        return true;
    }

}
// Copyright (c) Naked Objects Group Ltd.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy