當前位置: 首頁>>代碼示例>>Java>>正文


Java Env.getLanguage方法代碼示例

本文整理匯總了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;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:28,代碼來源:JasperEngine.java

示例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);
	}	
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:39,代碼來源:PrintBOM.java

示例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;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:14,代碼來源:Language.java

示例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);
	}
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:19,代碼來源:VTabbedPane.java

示例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());
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:11,代碼來源:JXlsExporter.java

示例6: getLanguage

import org.compiere.util.Env; //導入方法依賴的package包/類
Language getLanguage()
{
	return Env.getLanguage(getCtx());
}
 
開發者ID:metasfresh,項目名稱:metasfresh-webui-api,代碼行數:5,代碼來源:InternalUserSessionData.java

示例7: getDecimalFormat

import org.compiere.util.Env; //導入方法依賴的package包/類
private DecimalFormat getDecimalFormat()
{
	final Language language = Env.getLanguage(Env.getCtx());
	return DisplayType.getNumberFormat(displayType, language, formatPattern);
}
 
開發者ID:metasfresh,項目名稱:metasfresh-webui-api,代碼行數:6,代碼來源:GenericDocumentSummaryValueProvider.java

示例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);
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:6,代碼來源:MLookupFactory.java

示例9: getLanguage

import org.compiere.util.Env; //導入方法依賴的package包/類
protected Language getLanguage()
{
	if (m_lang == null)
		m_lang = Env.getLanguage(getCtx());
	return m_lang;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:7,代碼來源:AbstractExcelExporter.java

示例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());
	}
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:48,代碼來源:ALogin.java

示例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());
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:51,代碼來源:JRClient.java


注:本文中的org.compiere.util.Env.getLanguage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。