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

griffon.pivot.support.adapters.TextInputContentAdapter Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
/*
 * Copyright 2008-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package griffon.pivot.support.adapters;

import griffon.core.CallableWithArgs;
import org.apache.pivot.util.Vote;

/**
 * @author Andres Almiray
 * @since 2.0.0
 */
public class TextInputContentAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TextInputContentListener {
    private CallableWithArgs textChanged;
    private CallableWithArgs previewInsertText;
    private CallableWithArgs textInserted;
    private CallableWithArgs insertTextVetoed;
    private CallableWithArgs previewRemoveText;
    private CallableWithArgs textRemoved;
    private CallableWithArgs removeTextVetoed;

    public CallableWithArgs getTextChanged() {
        return this.textChanged;
    }

    public CallableWithArgs getPreviewInsertText() {
        return this.previewInsertText;
    }

    public CallableWithArgs getTextInserted() {
        return this.textInserted;
    }

    public CallableWithArgs getInsertTextVetoed() {
        return this.insertTextVetoed;
    }

    public CallableWithArgs getPreviewRemoveText() {
        return this.previewRemoveText;
    }

    public CallableWithArgs getTextRemoved() {
        return this.textRemoved;
    }

    public CallableWithArgs getRemoveTextVetoed() {
        return this.removeTextVetoed;
    }


    public void setTextChanged(CallableWithArgs textChanged) {
        this.textChanged = textChanged;
    }

    public void setPreviewInsertText(CallableWithArgs previewInsertText) {
        this.previewInsertText = previewInsertText;
    }

    public void setTextInserted(CallableWithArgs textInserted) {
        this.textInserted = textInserted;
    }

    public void setInsertTextVetoed(CallableWithArgs insertTextVetoed) {
        this.insertTextVetoed = insertTextVetoed;
    }

    public void setPreviewRemoveText(CallableWithArgs previewRemoveText) {
        this.previewRemoveText = previewRemoveText;
    }

    public void setTextRemoved(CallableWithArgs textRemoved) {
        this.textRemoved = textRemoved;
    }

    public void setRemoveTextVetoed(CallableWithArgs removeTextVetoed) {
        this.removeTextVetoed = removeTextVetoed;
    }


    public void textChanged(org.apache.pivot.wtk.TextInput arg0) {
        if (textChanged != null) {
            textChanged.call(arg0);
        }
    }

    public org.apache.pivot.util.Vote previewInsertText(org.apache.pivot.wtk.TextInput arg0, java.lang.CharSequence arg1, int arg2) {
        if (previewInsertText != null) {
            return previewInsertText.call(arg0, arg1, arg2);
        }
        return Vote.APPROVE;
    }

    public void textInserted(org.apache.pivot.wtk.TextInput arg0, int arg1, int arg2) {
        if (textInserted != null) {
            textInserted.call(arg0, arg1, arg2);
        }
    }

    public void insertTextVetoed(org.apache.pivot.wtk.TextInput arg0, org.apache.pivot.util.Vote arg1) {
        if (insertTextVetoed != null) {
            insertTextVetoed.call(arg0, arg1);
        }
    }

    public org.apache.pivot.util.Vote previewRemoveText(org.apache.pivot.wtk.TextInput arg0, int arg1, int arg2) {
        if (previewRemoveText != null) {
            return previewRemoveText.call(arg0, arg1, arg2);
        }
        return Vote.APPROVE;
    }

    public void textRemoved(org.apache.pivot.wtk.TextInput arg0, int arg1, int arg2) {
        if (textRemoved != null) {
            textRemoved.call(arg0, arg1, arg2);
        }
    }

    public void removeTextVetoed(org.apache.pivot.wtk.TextInput arg0, org.apache.pivot.util.Vote arg1) {
        if (removeTextVetoed != null) {
            removeTextVetoed.call(arg0, arg1);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy