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

jaxx.runtime.swing.navigation.NavigationTreeNodeRendererI18nImpl Maven / Gradle / Ivy

There is a newer version: 3.0-alpha-6
Show newest version
/*
 * *##% 
 * JAXX Runtime
 * Copyright (C) 2008 - 2009 CodeLutin
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 *
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * .
 * ##%*
 */
package jaxx.runtime.swing.navigation;

import static org.nuiton.i18n.I18n._;

/**
 * I18n label Renderer of a {@link NavigationTreeNode}.
 *
 * Just apply a i18n translation on the given {@link #libelle}.
 * 
 * @author chemit
 * @since 1.7.2, replace {@code NavigationUtil#NodeRenderer} which disappear soon...
 */
public class NavigationTreeNodeRendererI18nImpl implements NavigationTreeNodeRenderer {

    private static final long serialVersionUID = -1L;
    /**
     * Static i18n label to render
     */
    protected final String libelle;
    /**
     * internal class of representing data
     */
    protected final Class internalClass;
    /**
     * last renderered value
     */
    protected String text;

    public NavigationTreeNodeRendererI18nImpl(String libelle) {
        this.libelle = libelle;
        this.internalClass = String.class;
    }

    @Override
    public String toString() {
        return text;
    }

    @Override
    public void reload(Object data) {
        text = _(libelle);
    }

    @Override
    public Class getInternalClass() {
        return internalClass;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy