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); 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 } // MField

View File

@ -2506,5 +2506,15 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
m_listenerList.add(DataStatusListener.class, l); 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 } // MTab

View File

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

View File

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

View File

@ -20,6 +20,7 @@ import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.beans.*; import java.beans.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.CaretListener;
import org.adempiere.plaf.AdempierePLAF; import org.adempiere.plaf.AdempierePLAF;
import org.compiere.model.*; import org.compiere.model.*;
@ -257,6 +258,26 @@ public final class VString extends CTextField
ValuePreference.addMenu (this, popupMenu); ValuePreference.addMenu (this, popupMenu);
} // setField } // 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) * Set Text (optionally obscured)
@ -297,6 +318,17 @@ public final class VString extends CTextField
return text; return text;
} // getText } // getText
/**
* Feature Request [1707462]
* Get VFormat
* @return strMask mask
* @author fer_luck
*/
public String getVFormat ()
{
return this.m_VFormat;
} // getVFormat
/** /**
* Focus Gained. * Focus Gained.
* Enabled with Obscure * Enabled with Obscure

View File

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

View File

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

View File

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