Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.nuiton.jaxx.widgets.i18n;
/*-
* #%L
* JAXX :: Widgets
* %%
* Copyright (C) 2008 - 2024 Code Lutin, Ultreia.io
* %%
* 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
* .
* #L%
*/
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JToggleButton;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.runtime.JAXXBinding;
import org.nuiton.jaxx.runtime.JAXXContext;
import org.nuiton.jaxx.runtime.JAXXObject;
import org.nuiton.jaxx.runtime.JAXXObjectDescriptor;
import org.nuiton.jaxx.runtime.JAXXUtil;
import org.nuiton.jaxx.runtime.binding.DefaultJAXXBinding;
import org.nuiton.jaxx.runtime.binding.SimpleJAXXObjectBinding;
import org.nuiton.jaxx.runtime.context.DefaultJAXXContext;
import org.nuiton.jaxx.runtime.spi.UIHandler;
import org.nuiton.jaxx.runtime.swing.JAXXButtonGroup;
import org.nuiton.jaxx.runtime.swing.SwingUtil;
import org.nuiton.jaxx.runtime.swing.renderer.LocaleListCellRenderer;
import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
public class I18nEditor extends JPanel implements PropertyChangeListener, ActionListener, JAXXObject {
/*-----------------------------------------------------------------------*/
/*---------------- Constants for all javaBean properties ----------------*/
/*-----------------------------------------------------------------------*/
public static final String PROPERTY_LOCALES = "locales";
public static final String PROPERTY_NOT_SELECTED_TOOL_TIP_TEXT = "notSelectedToolTipText";
public static final String PROPERTY_POPUP_BORDER = "popupBorder";
public static final String PROPERTY_POPUP_VISIBLE = "popupVisible";
public static final String PROPERTY_RENDERER = "renderer";
public static final String PROPERTY_SELECTED_LOCALE = "selectedLocale";
public static final String PROPERTY_SELECTED_TOOL_TIP_TEXT = "selectedToolTipText";
public static final String PROPERTY_SHOW_ICON = "showIcon";
public static final String PROPERTY_SHOW_POPUP_ICON = "showPopupIcon";
public static final String PROPERTY_SHOW_POPUP_TEXT = "showPopupText";
public static final String PROPERTY_SHOW_TEXT = "showText";
/*-----------------------------------------------------------------------*/
/*------------------ Constants for all public bindings ------------------*/
/*-----------------------------------------------------------------------*/
public static final String BINDING_BUTTON_ICON = "button.icon";
public static final String BINDING_BUTTON_SELECTED = "button.selected";
public static final String BINDING_BUTTON_TEXT = "button.text";
public static final String BINDING_BUTTON_TOOL_TIP_TEXT = "button.toolTipText";
public static final String BINDING_POPUP_BORDER = "popup.border";
public static final String BINDING_RENDERER_SHOW_ICON = "renderer.showIcon";
public static final String BINDING_RENDERER_SHOW_TEXT = "renderer.showText";
/*-----------------------------------------------------------------------*/
/*------------------------- Other static fields -------------------------*/
/*-----------------------------------------------------------------------*/
private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAKVVTU8TQRieVtrSDypoQuKNBAWMsA03DR8CRR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49JJO0bH8f94H6A7nG7ZvmCQAA";
private static final Logger log = LogManager.getLogger(I18nEditor.class);
private static final long serialVersionUID = 1L;
/*-----------------------------------------------------------------------*/
/*--------------------------- Internal states ---------------------------*/
/*-----------------------------------------------------------------------*/
protected List