Search in sources :

Example 1 with I18NMessagesModelEntry

use of com.servoy.j2db.i18n.I18NMessagesModel.I18NMessagesModelEntry in project servoy-client by Servoy.

the class I18NPanel method initI18NMessagesModel.

private void initI18NMessagesModel(String searchKey) {
    if (i18NMessagesModel != null) {
        String filterColumn = null;
        String[] filterValue = null;
        if (application instanceof IMessagesCallback) {
            filterColumn = ((IMessagesCallback) application).getI18NColumnNameFilter();
            filterValue = ((IMessagesCallback) application).getI18NColumnValueFilter();
        }
        Collection<I18NMessagesModelEntry> messages = i18NMessagesModel.getMessages(searchKey, filterColumn, filterValue, application.getFoundSetManager(), false, null);
        Object selLang = "<unknown>";
        if (languagesCombo.getSelectedItem() != null)
            selLang = ((Object[]) languagesCombo.getSelectedItem())[1];
        String[] columns = null;
        if (endUser) {
            columns = new String[] { Messages.getString("servoy.i18nPanel.key"), Messages.getString("servoy.i18nPanel.default"), Messages.getString("servoy.i18nPanel.locale") + " (" + selLang + ")" };
        } else {
            columns = new String[] { Messages.getString("servoy.i18nPanel.key"), Messages.getString("servoy.i18nPanel.default"), Messages.getString("servoy.i18nPanel.locale") + " (" + selLang + ")", "" };
        }
        messageModel = new DefaultTableModel(columns, 0) {

            private static final long serialVersionUID = 1L;

            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return (columnIndex == 3 && !Messages.invalidConnection && !Messages.noConnection);
            }
        };
        for (I18NMessagesModelEntry entry : messages) {
            messageModel.addRow(new Object[] { entry.key, entry.defaultvalue, entry.localeValue, "" });
        }
    }
}
Also used : I18NMessagesModelEntry(com.servoy.j2db.i18n.I18NMessagesModel.I18NMessagesModelEntry) DefaultTableModel(javax.swing.table.DefaultTableModel) IMessagesCallback(com.servoy.j2db.IMessagesCallback) EventObject(java.util.EventObject)

Aggregations

IMessagesCallback (com.servoy.j2db.IMessagesCallback)1 I18NMessagesModelEntry (com.servoy.j2db.i18n.I18NMessagesModel.I18NMessagesModelEntry)1 EventObject (java.util.EventObject)1 DefaultTableModel (javax.swing.table.DefaultTableModel)1