This code commit is related to:

Feature request: 1707462
	Description: Change VFormat on runtime and add a mask that uppercases any char.

	Patch: 1646656
	Description: Truncated characters for pt_BR lang files. Converted the truncated files to unicode hex format.
This commit is contained in:
fer_luck 2007-04-29 04:33:35 +00:00
parent 2965c83ae2
commit a460bed9d0
10 changed files with 156 additions and 50 deletions

View File

@ -1546,4 +1546,15 @@ public class GridField
Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.ColumnName, m_backupValue);
}
}
/**
* Feature Request [1707462]
* Enable user to change VFormat on runtime
* @param strNewFormat VFormat mask
* @author fer_luck
*/
public void setVFormat(String strNewFormat){
m_vo.VFormat = strNewFormat;
} //setVFormat
} // MField

View File

@ -2506,5 +2506,15 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
m_listenerList.add(DataStatusListener.class, l);
}
/**
* Feature Request [1707462]
* Enable runtime change of VFormat
* @param Identifier field ident
* @param strNewFormat new mask
* @author fer_luck
*/
public void setFieldVFormat (String identifier, String strNewFormat)
{
m_mTable.setFieldVFormat(identifier, strNewFormat);
} // setFieldVFormat
} // MTab

View File

@ -3072,4 +3072,24 @@ public class GridTable extends AbstractTableModel
} // Loader
/**
* Feature Request [1707462]
* Enable runtime change of VFormat
* @param Identifier field ident
* @param strNewFormat new mask
* @author fer_luck
*/
protected void setFieldVFormat (String identifier, String strNewFormat)
{
int cols = m_fields.size();
for (int i = 0; i < cols; i++)
{
GridField field = (GridField)m_fields.get(i);
if (identifier.equalsIgnoreCase(field.getColumnName())){
field.setVFormat(strNewFormat);
m_fields.set(i, field);
break;
}
}
} // setFieldVFormat
}

View File

@ -26,13 +26,14 @@ import java.util.*;
*/
public final class ALoginRes_pt extends ListResourceBundle
{
// TODO Run native2ascii to convert to plain ASCII !!
/** Translation Content */
//Characters encoded to UTF8 Hex, so no more problems with svn commits
//Fernando Lucktemberg - CenturuyOn Consultoria
static final Object[][] contents = new String[][]
{
{ "Connection", "Conex<EFBFBD>o" },
{ "Defaults", "Padr<EFBFBD>es" },
{ "Connection", "Conex\u00e3o" },
{ "Defaults", "Padr\u00f5es" },
{ "Login", "Adempiere Login" },
{ "File", "Arquivo" },
{ "Exit", "Sair" },
@ -40,29 +41,29 @@ public final class ALoginRes_pt extends ListResourceBundle
{ "About", "Sobre" },
{ "Host", "Servidor" },
{ "Database", "Banco de Dados" },
{ "User", "ID Usu<73>rio" },
{ "EnterUser", "Entre com o ID Usu<73>rio da Aplica<63><61>o" },
{ "User", "Usu\u00e1rio" },
{ "EnterUser", "Entre com o Usu\u00e1rio da Aplica\u00e7\u00e3o" },
{ "Password", "Senha" },
{ "EnterPassword", "Entre com a Senha da Aplica<63><61>o" },
{ "EnterPassword", "Entre com a senha da Aplica\u00e7\u00e3o" },
{ "Language", "Idioma" },
{ "SelectLanguage", "Selecione o idioma" },
{ "Role", "Regra" },
{ "Client", "Cliente" },
{ "Organization", "Organiza<EFBFBD><EFBFBD>o" },
{ "Organization", "Organiza\u00e7\u00e3o" },
{ "Date", "Data" },
{ "Warehouse", "Dep<EFBFBD>sito" },
{ "Warehouse", "Dep\u00f3sito" },
{ "Printer", "Impressora" },
{ "Connected", "Conectado" },
{ "NotConnected", "N<EFBFBD>o conectado" },
{ "DatabaseNotFound", "Banco de Dados n<EFBFBD>o encontrado" },
{ "UserPwdError", "Usu<EFBFBD>rio/Senha inv<6E>lidos" },
{ "RoleNotFound", "Regra n<EFBFBD>o encontrada/incorreta" },
{ "NotConnected", "N\u00e3o conectado" },
{ "DatabaseNotFound", "Banco de Dados n\u00e3o encontrado" },
{ "UserPwdError", "Usu\u00e1rio/Senha inv\u00e1lidos" },
{ "RoleNotFound", "Regra n\u00e3o encontrada/incorreta" },
{ "Authorized", "Autorizado" },
{ "Ok", "Ok" },
{ "Cancel", "Cancelar" },
{ "VersionConflict", "Conflito de Vers<EFBFBD>es:" },
{ "VersionConflict", "Conflito de Vers\u00f5es:" },
{ "VersionInfo", "Servidor <> Cliente" },
{ "PleaseUpgrade", "Favor executar o programa de atualiza<7A><EFBFBD>o" }
{ "PleaseUpgrade", "Favor executar o programa de atualiza<7A>o" }
};
/**

View File

@ -890,6 +890,18 @@ public class GridController extends CPanel
{
if (!comp.isVisible())
comp.setVisible(true); // visibility
/**
* Feature Request [1707462]
* Enable runtime change of VFormat
* @author fer_luck
*/
if (comp instanceof VString){
VString vs = (VString)comp;
if(!vs.getVFormat().equals(mField.getVFormat()) && mField.getVFormat() != null){
vs.setVFormat(mField.getVFormat());
}
}
//End Feature Request [1707462]
if (comp instanceof VEditor)
{
VEditor ve = (VEditor)comp;

View File

@ -40,6 +40,7 @@ import org.compiere.util.*;
* A any Letters & Digits NO space converted to upper case
* c any Letters & Digits or space
* C any Letters & Digits or space converted to upper case
* Z any character converted to upper case
* </pre>
* @see VString
* @author Jorg Janke
@ -105,6 +106,11 @@ public final class MDocString extends PlainDocument implements CaretListener
m_mask = m_mask.replace('O', SPACE); // O any Letter a..Z or space converted to upper case
m_mask = m_mask.replace('0', SPACE); // 0 Digits 0..9 NO space
m_mask = m_mask.replace('9', SPACE); // 9 Digits 0..9 or space
/**
* Feature Request [1707462]
* Convert any to Uppercase
*/
m_mask = m_mask.replace('Z', SPACE); // Z any character converted to upper case
// Check Caret
if (m_tc == null || m_tc.getCaret() instanceof VOvrCaret)
@ -135,7 +141,7 @@ public final class MDocString extends PlainDocument implements CaretListener
}
/** Formating required **/
log.finest("Offset=" + offset
log.finest("Offsret=" + offset
+ ", String=" + string + ", MaxLength=" + m_maxLength
+ ", Format=" + m_VFormat + ", Mask=" + m_mask
+ ", Text=" + getText() + ", Length=" + getText().length());
@ -248,6 +254,14 @@ public final class MDocString extends PlainDocument implements CaretListener
case SPACE: // any character
break;
//
/**
* Feature Request [1707462]
* Convert any to Uppercase
*/
case 'Z': // Z any character converted to upper case
string = string.toUpperCase();
break;
// ----
default: // other
return;
} // switch

View File

@ -20,6 +20,7 @@ import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import javax.swing.*;
import javax.swing.event.CaretListener;
import org.adempiere.plaf.AdempierePLAF;
import org.compiere.model.*;
@ -257,6 +258,26 @@ public final class VString extends CTextField
ValuePreference.addMenu (this, popupMenu);
} // setField
/**
* Feature Request [1707462]
* Set VFormat
* @param strMask mask
* @author fer_luck
*/
public void setVFormat (String strMask)
{
m_VFormat = strMask;
//Get the actual caret from the field, if there's no
//caret then just catch the exception and continue
//creating the new caret.
try{
CaretListener [] cl = this.getCaretListeners();
this.removeCaretListener(cl[0]);
} catch(ClassCastException ex ){
log.fine("VString.setVFormat - No caret Listeners");
}
setDocument(new MDocString(m_VFormat, m_fieldLength, this));
} // setVFormat
/**
* Set Text (optionally obscured)
@ -297,6 +318,17 @@ public final class VString extends CTextField
return text;
} // getText
/**
* Feature Request [1707462]
* Get VFormat
* @return strMask mask
* @author fer_luck
*/
public String getVFormat ()
{
return this.m_VFormat;
} // getVFormat
/**
* Focus Gained.
* Enabled with Obscure

View File

@ -27,31 +27,33 @@ import java.util.*;
public class DBRes_pt extends ListResourceBundle
{
/** Data */
//Characters encoded to UTF8 Hex, so no more problems with svn commits
//Fernando Lucktemberg - CenturuyOn Consultoria
static final Object[][] contents = new String[][]
{
{ "CConnectionDialog", "Adempiere Conexão" },
{ "CConnectionDialog", "Adempiere Conex\u00e3o" },
{ "Name", "Nome" },
{ "AppsHost", "Servidor de Aplicação" },
{ "AppsPort", "Porta TCP da Aplicação" },
{ "TestApps", "Testar Aplicação" },
{ "AppsHost", "Servidor de Aplica\u00e7\u00e3o" },
{ "AppsPort", "Porta TCP da Aplica\u00e7\u00e3o" },
{ "TestApps", "Testar Aplica\u00e7\u00e3o" },
{ "DBHost", "Servidor do Banco de Dado" },
{ "DBPort", "Porta TCP do Banco de Dados" },
{ "DBName", "Nome do Banco de Dados" },
{ "DBUidPwd", "Usuário / Senha" },
{ "DBUidPwd", "Usu\u00e1rio / Senha" },
{ "ViaFirewall", "via Firewall" },
{ "FWHost", "Servidor de Firewall" },
{ "FWPort", "Porta TCP do Firewall" },
{ "TestConnection", "Testar Banco de Dados" },
{ "Type", "Tipo de Banco de Dados" },
{ "BequeathConnection", "Conexão Bequeath" },
{ "BequeathConnection", "Conex\u00e3o Bequeath" },
{ "Overwrite", "Sobrescrever" },
{ "ConnectionProfile", "Connection" },
{ "LAN", "LAN" },
{ "TerminalServer", "Terminal Server" },
{ "VPN", "VPN" },
{ "WAN", "WAN" },
{ "ConnectionError", "Erro de Conexão" },
{ "ServerNotActive", "Servidor não Ativo" }
{ "ConnectionError", "Erro de Conex\u00e3o" },
{ "ServerNotActive", "Servidor n\u00e3o Ativo" }
};
/**

View File

@ -27,11 +27,13 @@ import java.util.ListResourceBundle;
public class PlafRes_pt extends ListResourceBundle
{
/** The data */
//Characters encoded to UTF8 Hex, so no more problems with svn commits
//Fernando Lucktemberg - CenturuyOn Consultoria
static final Object[][] contents = new String[][]
{
{ "BackColType", "Tipo da Cor de Fundo" },
{ "BackColType_Flat", "Plano" },
{ "BackColType_Gradient", "D<EFBFBD>grad<EFBFBD>" },
{ "BackColType_Gradient", "Degrad\u00ea" },
{ "BackColType_Lines", "Linhas" },
{ "BackColType_Texture", "Textura" },
//
@ -39,9 +41,9 @@ public class PlafRes_pt extends ListResourceBundle
{ "LookAndFeel", "Look & Feel" },
{ "Theme", "Tema" },
{ "EditAdempiereTheme", "Editar Tema Adempiere" },
{ "SetDefault", "Fundo Padr<EFBFBD>o" },
{ "SetDefault", "Fundo Padr\u00e3o" },
{ "SetDefaultColor", "Cor de Fundo" },
{ "ColorBlind", "Defici<EFBFBD>ncia de Cor" },
{ "ColorBlind", "Defici\u00eancia de Cor" },
{ "Example", "Exemplo" },
{ "Reset", "Reinicializar" },
{ "OK", "OK" },
@ -52,31 +54,31 @@ public class PlafRes_pt extends ListResourceBundle
{ "AdempiereColors", "Cores Adempiere" },
{ "AdempiereFonts", "Fontes Adempiere" },
{ "Primary1Info", "Sombra, Separador" },
{ "Primary1", "Prim<EFBFBD>rio 1" },
{ "Primary1", "Prim\u00e1rio 1" },
{ "Primary2Info", "Linha de Foco, Menu Selecionado" },
{ "Primary2", "Prim<EFBFBD>rio 2" },
{ "Primary2", "Prim\u00e1rio 2" },
{ "Primary3Info", "Linha da Tabele Selecionada, Texto Selecionado, Fundo Dicas" },
{ "Primary3", "Prim<EFBFBD>rio 3" },
{ "Primary3", "Prim\u00e1rio 3" },
{ "Secondary1Info", "Bordas de Linhas" },
{ "Secondary1", "Secund<EFBFBD>rio 1" },
{ "Secondary1", "Secund\u00e1rio 1" },
{ "Secondary2Info", "Tabs Inativas, Campos Pressed, Borda Inativa + Texto" },
{ "Secondary2", "Secund<EFBFBD>rio 2" },
{ "Secondary2", "Secund\u00e1rio 2" },
{ "Secondary3Info", "<EFBFBD>rea de Fundo" },
{ "Secondary3", "Secund<EFBFBD>rio 3" },
{ "Secondary3", "Secund\u00e1rio 3" },
//
{ "ControlFontInfo", "Controle de Fonte" },
{ "ControlFont", "R<EFBFBD>tulo da Fonte" },
{ "ControlFont", "R\u00f3tulo da Fonte" },
{ "SystemFontInfo", "Tool Tip, Tree nodes" },
{ "SystemFont", "System Font" },
{ "UserFontInfo", "Entrada de Dados pelo Usu<EFBFBD>rio" },
{ "UserFontInfo", "Entrada de Dados pelo Usu\u00e1rio" },
{ "UserFont", "Fonte dos Campos" },
// { "SmallFontInfo", "Relat<EFBFBD>rios" },
// { "SmallFontInfo", "Relat\u00f3rios" },
{ "SmallFont", "Fonte pequena" },
{ "WindowTitleFont", "Fonte do T<EFBFBD>tulo" },
{ "WindowTitleFont", "Fonte do T\u00edtulo" },
{ "MenuFont", "Fonte do Menu" },
//
{ "MandatoryInfo", "Fundo de Campos Obrigat<61>rios" },
{ "Mandatory", "Obrigat<EFBFBD>rio" },
{ "Mandatory", "Obrigat\u00f3rio" },
{ "ErrorInfo", "Fundo de Campo de Erro" },
{ "Error", "Erro" },
{ "InfoInfo", "Fundo de Campos Informativos" },
@ -95,9 +97,9 @@ public class PlafRes_pt extends ListResourceBundle
{ "FontChooser", "Selecionar Fonte" },
{ "Fonts", "Fontes" },
{ "Plain", "Plano" },
{ "Italic", "It<EFBFBD>lico" },
{ "Italic", "It\u00e1lico" },
{ "Bold", "Negrito" },
{ "BoldItalic", "Negrito & It<EFBFBD>lico" },
{ "BoldItalic", "Negrito & It\u00e1lico" },
{ "Name", "Nome" },
{ "Size", "Tamanho" },
{ "Style", "Estilo" },
@ -106,17 +108,17 @@ public class PlafRes_pt extends ListResourceBundle
//
{ "AdempiereColorEditor", "Adempiere: Editor de Cores" },
{ "AdempiereType", "Tipo de Cor" },
{ "GradientUpperColor", "Cor D<EFBFBD>grad<EFBFBD> Superior" },
{ "GradientLowerColor", "Cor D<EFBFBD>grad<EFBFBD> Inferior" },
{ "GradientStart", "In<EFBFBD>cio do D<>grad<61>" },
{ "GradientDistance", "Dist<EFBFBD>ncia do D<>grad<61>" },
{ "GradientUpperColor", "Cor Degrad\u00ea Superior" },
{ "GradientLowerColor", "Cor Degrad\u00ea Inferior" },
{ "GradientStart", "In\u00edcio do Degrad\u00ea" },
{ "GradientDistance", "Dist\u00e2ncia do Degrad\u00ea" },
{ "TextureURL", "URL Textura" },
{ "TextureAlpha", "Alfa Textura" },
{ "TextureTaintColor", "Colora<EFBFBD><EFBFBD>o da Textura" },
{ "TextureTaintColor", "Colora\u00e7\u00e3o da Textura" },
{ "LineColor", "Cor da Linha" },
{ "LineBackColor", "Cores de Fundo" },
{ "LineWidth", "Largura da Linha" },
{ "LineDistance", "Dist<EFBFBD>ncia das linhas" },
{ "LineDistance", "Dist\u00e2ncia das linhas" },
{ "FlatColor", "Cores Planas" }
};

View File

@ -27,14 +27,16 @@ import java.util.ListResourceBundle;
public class IniRes_pt extends ListResourceBundle
{
/** Translation Content */
//Characters encoded to UTF8 Hex, so no more problems with svn commits
//Fernando Lucktemberg - CenturuyOn Consultoria
static final Object[][] contents = new String[][]
{
{ "Adempiere_License", "Acordo de Licen<EFBFBD>a" },
{ "Do_you_accept", "Voc<EFBFBD> aceita os termos da Licen<65>a ?" },
{ "No", "N<EFBFBD>o" },
{ "Adempiere_License", "Acordo de Licen\u00e7a" },
{ "Do_you_accept", "Voc\u00ea aceita os termos da Licen\u00e7a ?" },
{ "No", "Licen\u00e7a" },
{ "Yes_I_Understand", "Sim, eu Entendi e Aceito" },
{ "license_htm", "org/adempiere/license.htm" },
{ "License_rejected", "Licen<EFBFBD>a rejeitada ou expirada" }
{ "License_rejected", "Licen\u00e7a rejeitada ou expirada" }
};
/**