本文整理汇总了Java中org.compiere.util.Env.WINDOW_MAIN属性的典型用法代码示例。如果您正苦于以下问题:Java Env.WINDOW_MAIN属性的具体用法?Java Env.WINDOW_MAIN怎么用?Java Env.WINDOW_MAIN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.compiere.util.Env
的用法示例。
在下文中一共展示了Env.WINDOW_MAIN属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEvaluationContext
private Evaluatee createEvaluationContext()
{
final Evaluatee evalCtx = Evaluatees.mapBuilder()
.put(Env.CTXNAME_AD_Language, getAD_Language())
.put(AccessSqlStringExpression.PARAM_UserRolePermissionsKey.getName(), getPermissionsKey())
.build();
final Evaluatee parentEvalCtx;
if (parentDocument != null)
{
parentEvalCtx = parentDocument.asEvaluatee();
}
else
{
final Properties ctx = getCtx();
final int windowNo = Env.WINDOW_MAIN; // TODO: get the proper windowNo
final boolean onlyWindow = false;
parentEvalCtx = Evaluatees.ofCtx(ctx, windowNo, onlyWindow);
}
return Evaluatees.compose(evalCtx, parentEvalCtx);
}
示例2: getWindowNo
private int getWindowNo()
{
//
// Get WindowNo from editor
final VEditor editor = menuCtx.getEditor();
if(editor != null)
{
if(editor instanceof java.awt.Component)
{
return Env.getWindowNo((java.awt.Component)editor);
}
}
// Fallback
return Env.WINDOW_MAIN;
}
示例3: reset
/**
* Reset the context to it's initial state (all settings have default values, services are removed etc).
*
* NOTE:
* <ul>
* <li>after invoking this method, the context will not be usable anymore because it needs to be reconfigured.
* <li>you can call this method right before destroying the terminal context
* </ul>
*/
private void reset()
{
ctx = null;
assertAllReferencesDeleted();
disposeAllServices();
if (terminalFactory != null)
{
terminalFactory.dispose();
terminalFactory = null;
}
terminalFactoryHardRef = null;
windowNo = Env.WINDOW_MAIN;
adUserId = -1;
defaultFontSize = DEFAULT_FontSize;
screenWidth = DEFAULT_ScreenWidth;
screenHeight = DEFAULT_ScreenHeight;
}
示例4: handleExceptionInUI
@Override
public void handleExceptionInUI(final IClientUIAsyncExecutor<PropertyChangeEvent, ResultType, PartialResultType> executor, final Throwable ex)
{
final ITerminalFactory terminalFactory = terminalFactoryRef.get();
// If terminalFactory reference expired, we fallback to IClientUI
if (terminalFactory == null)
{
final int windowNo = Env.WINDOW_MAIN;
Services.get(IClientUI.class).warn(windowNo, ex);
}
else
{
final IComponent parent = parentRef.get();
terminalFactory.showWarning(parent, "Error", ex);
}
}
示例5: handleException
private void handleException(final Exception e)
{
final ITerminalFactory terminalFactory = terminalFactoryRef.get();
final IComponent parent = parentRef.get();
// If terminalFactory reference expired, we fallback to IClientUI
if (terminalFactory == null)
{
final int windowNo = Env.WINDOW_MAIN;
Services.get(IClientUI.class).warn(windowNo, e);
}
else
{
terminalFactory.showWarning(parent, "Error", e);
}
}
示例6: getWindowNo
public int getWindowNo()
{
final Object windowNoObj = get(VAR_WindowNo);
if (windowNoObj instanceof Number)
{
return ((Number)windowNoObj).intValue();
}
else
{
return Env.WINDOW_MAIN;
}
}
示例7: GridTabValidationContext
public GridTabValidationContext(final Properties ctx, final int windowNo, final int tabNo, final String tableName)
{
Check.assume(ctx != null, "context not null");
// any windowNo, even Env.WINDOW_None is allowed
Check.assume(tableName != null, "tableName not null");
if (windowNo == Env.WINDOW_MAIN && tabNo <= 0)
{
final AdempiereException ex = new AdempiereException("Possible invalid definition of GridTabValidationContext: windowNo=" + windowNo + ", tabNo=" + tabNo + ", tableName=" + tableName);
logger.warn(ex.getLocalizedMessage(), ex);
}
this.ctx = ctx;
this.windowNo = windowNo;
this.tabNo = tabNo;
this.tableName = tableName;
final int contextTableId = Env.getContextAsInt(ctx, windowNo, tabNo, GridTab.CTX_AD_Table_ID, true);
if (contextTableId <= 0)
{
this.contextTableName = null;
// accept even if there is no tableId found, because maybe we are using the field in custom interfaces
// throw new AdempiereException("No AD_Table_ID found for WindowNo=" + windowNo + ", TabNo=" + tabNo);
}
else
{
this.contextTableName = Services.get(IADTableDAO.class).retrieveTableName(contextTableId);
if (Check.isEmpty(contextTableName, true))
{
throw new AdempiereException("No TableName found for AD_Table_ID=" + contextTableId);
}
}
}
示例8: getParentWindowNo
private final int getParentWindowNo()
{
final Integer parentWindowNo = _parentWindowNoSupplier.get();
return parentWindowNo == null ? Env.WINDOW_MAIN : parentWindowNo;
}