本文整理汇总了Java中org.compiere.util.Env.getLanguage方法的典型用法代码示例。如果您正苦于以下问题:Java Env.getLanguage方法的具体用法?Java Env.getLanguage怎么用?Java Env.getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.util.Env
的用法示例。
在下文中一共展示了Env.getLanguage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParam_Language
import org.compiere.util.Env; //导入方法依赖的package包/类
/**
* Extracts {@link Language} parameter
*
* @param ctx
* @param jrParameters
* @return {@link Language}; never returns null
*/
private final Language getParam_Language(final Map<String, Object> jrParameters)
{
Object langParam = jrParameters.get(PARAM_REPORT_LANGUAGE);
Language currLang = null;
if (langParam instanceof String)
{
currLang = Language.getLanguage((String)langParam);
}
else if (langParam instanceof Language)
{
currLang = (Language)langParam;
}
if (currLang == null)
{
currLang = Env.getLanguage(Env.getCtx());
}
return currLang;
}
示例2: print
import org.compiere.util.Env; //导入方法依赖的package包/类
/**
* Print result generate for this report
*/
void print() throws Exception
{
Language language = Env.getLanguage(getCtx()); // Base Language
MPrintFormat pf = null;
int pfid = 0;
// get print format for client, else copy system to client
RowSet pfrs = MPrintFormat.getAccessiblePrintFormats(X_RV_PP_Product_BOMLine_Table_ID, -1, null);
pfrs.next();
pfid = pfrs.getInt("AD_PrintFormat_ID");
if(pfrs.getInt("AD_Client_ID") != 0) pf = MPrintFormat.get(getCtx(), pfid, false);
else pf = MPrintFormat.copyToClient(getCtx(), pfid, getAD_Client_ID());
pfrs.close();
if (pf == null) raiseError("Error: ","No Print Format");
pf.setLanguage(language);
pf.setTranslationLanguage(language);
// query
MQuery query = MQuery.get(getCtx(), AD_PInstance_ID, X_RV_PP_Product_BOMLine_Table_Name);
query.addRestriction("AD_PInstance_ID", Operator.EQUAL, AD_PInstance_ID);
PrintInfo info = new PrintInfo(X_RV_PP_Product_BOMLine_Table_Name,
X_RV_PP_Product_BOMLine_Table_ID, getRecord_ID());
ReportEngine re = new ReportEngine(getCtx(), pf, query, info);
ReportCtl.preview(re);
// wait for report window to be closed as t_bomline
// records are deleted when process ends
while (re.getView().isDisplayable())
{
Env.sleep(1);
}
}
示例3: getLoginLanguage
import org.compiere.util.Env; //导入方法依赖的package包/类
/**************************************************************************
* Get Default Login Language
*
* @return default Language
* @deprecated Please use {@link Env#getLanguage(java.util.Properties)} instead
*/
@Deprecated
public static Language getLoginLanguage()
{
// metas: tsa: 02214: use #AD_Language from context because s_loginLanguage is not working on zk
return Env.getLanguage(Env.getCtx());
// return s_loginLanguage;
}
示例4: setWorkbench
import org.compiere.util.Env; //导入方法依赖的package包/类
/**
* Set Workbench - or Window
* @param isWorkbench
*/
public void setWorkbench (final boolean isWorkbench)
{
m_workbenchTab = isWorkbench;
if (m_workbenchTab)
{
super.setTabPlacement(JTabbedPane.BOTTOM);
}
else
{
final Language language = Env.getLanguage(Env.getCtx());
final boolean isLeftToRight = language == null ? true : language.isLeftToRight();
super.setTabPlacement(isLeftToRight ? JTabbedPane.LEFT : JTabbedPane.RIGHT);
}
}
示例5: getLanguage
import org.compiere.util.Env; //导入方法依赖的package包/类
private Language getLanguage()
{
if(!Check.isEmpty(_adLanguage, true))
{
final Language language = Language.getLanguage(_adLanguage);
return language;
}
return Env.getLanguage(getContext());
}
示例6: getLanguage
import org.compiere.util.Env; //导入方法依赖的package包/类
Language getLanguage()
{
return Env.getLanguage(getCtx());
}
示例7: getDecimalFormat
import org.compiere.util.Env; //导入方法依赖的package包/类
private DecimalFormat getDecimalFormat()
{
final Language language = Env.getLanguage(Env.getCtx());
return DisplayType.getNumberFormat(displayType, language, formatPattern);
}
示例8: ofSpecificLanguage
import org.compiere.util.Env; //导入方法依赖的package包/类
public static final LanguageInfo ofSpecificLanguage(final Properties ctx)
{
final Language language = Env.getLanguage(ctx);
return new LanguageInfo(language);
}
示例9: getLanguage
import org.compiere.util.Env; //导入方法依赖的package包/类
protected Language getLanguage()
{
if (m_lang == null)
m_lang = Env.getLanguage(getCtx());
return m_lang;
}
示例10: connectionOK
import org.compiere.util.Env; //导入方法依赖的package包/类
/**************************************************************************
* Connection OK pressed
*/
private void connectionOK()
{
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
confirmPanel.getOKButton().setEnabled(false);
try
{
m_connectionOK = tryConnection();
if (m_connectionOK)
{
final Properties ctx = getCtx();
//
// Verify Language & Load Msg
final Language language = Env.getLanguage(ctx);
if (language == null)
{
// Shall not happen because we checked this several times.
// But in case it happens and it's because somehow the language was not preselected,
// at least give to user the opportunity so select the language manually
setLanguageComboVisible(true);
new AdempiereException("@[email protected] @[email protected]").throwIfDeveloperModeOrLogWarningElse(log);
}
Env.verifyLanguage(language);
Env.setContext(ctx, Env.CTXNAME_AD_Language, language.getAD_Language());
Services.get(IMsgBL.class).getMsg(ctx, "0"); // trigger messages cache loading
//
// Show warehouse only if ShowWarehouseOnLogin is Y (task 06009)
// Also assume 'Y' if we have no connection.
final boolean showWarehouseOnLogin = m_login == null || m_login.isShowWarehouseOnLogin();
warehouseLabel.setVisible(showWarehouseOnLogin);
warehouseCombo.setVisible(showWarehouseOnLogin);
// Change Tab to Default
loginTabPane.setSelectedIndex(TABINDEX_Defaults);
}
}
finally
{
confirmPanel.getOKButton().setEnabled(true);
setCursor(Cursor.getDefaultCursor());
}
}
示例11: extractLanguage
import org.compiere.util.Env; //导入方法依赖的package包/类
/**
* Extracts reporting language from given {@link ProcessInfo}.
*
* @param pi
* @return Language; never returns null
*
* @implNote Usually the ProcessInfo already has the language set, so this method is just a fallback.
* If you are thinking to extend how the reporting language is fetched, please check {@link ProcessInfoBuilder}'s getReportLanguage() method.
*/
private static Language extractLanguage(final ProcessInfo pi)
{
//
// Get Language from ProcessInfo, if any (08023)
Language lang = pi.getReportLanguage();
if (lang != null)
{
return lang;
}
// task 09740
// In case the report is not linked to a window but it has C_BPartner_ID as parameter and it is set, take the language of that bpartner
// TODO: i think this one is no longer needed because we already checking this case in ProcessInfo.findReportingLanguage()
if (lang == null)
{
final IRangeAwareParams parameterAsIParams = pi.getParameterAsIParams();
final int bPartnerID = parameterAsIParams.getParameterAsInt(I_C_BPartner.COLUMNNAME_C_BPartner_ID);
if (bPartnerID > 0)
{
lang = Services.get(IBPartnerBL.class).getLanguage(pi.getCtx(), bPartnerID);
return lang;
}
}
//
// Get Organization Language if any (03040)
if (null == lang)
{
lang = Services.get(ILanguageBL.class).getOrgLanguage(pi.getCtx(), pi.getAD_Org_ID());
}
// If we got an Language already, return it
if (null != lang)
{
return lang;
}
//
// Fallback: get it from client context
return Env.getLanguage(Env.getCtx());
}