当前位置: 首页>>代码示例>>Java>>正文


Java Env.createWindowNo方法代码示例

本文整理汇总了Java中org.compiere.util.Env.createWindowNo方法的典型用法代码示例。如果您正苦于以下问题:Java Env.createWindowNo方法的具体用法?Java Env.createWindowNo怎么用?Java Env.createWindowNo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.compiere.util.Env的用法示例。


在下文中一共展示了Env.createWindowNo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupAdempiere

import org.compiere.util.Env; //导入方法依赖的package包/类
private void setupAdempiere()
{
	final TestConfig config = getConfig();

	Services.setAutodetectServices(true);
	// Services.registerService(IFreightCostBL.class, new FreightCostSubscriptionBL()); // TODO: hardcoded
	org.compiere.Adempiere.startupEnvironment(true);
	LogManager.setLevel(config.getLogLevel());
	// Decrease log level for CacheAsp:
	Logger cacheLogger = LogManager.getLogger(de.metas.adempiere.util.cache.CacheInterceptor.class);
	LogManager.setLoggerLevel(cacheLogger, Level.INFO);

	// when we start Adempiere.main(), right after adempiere startup, the class org.compiere.apps.AMenu is fired up and takes the first WindowNo, which is 0
	// we need to emulate that be havior, becaus otherwise our first "real" window will get WindowNo and that WindowNo this will lead to problems in the lookup code
	Env.createWindowNo(null);

	this.ctx = Env.getCtx();
	Env.setContext(ctx, "#AD_Client_ID", config.getAD_Client_ID());
	Env.setContext(ctx, "#AD_Org_ID", config.getAD_Org_ID());
	Env.setContext(ctx, "#AD_User_ID", config.getAD_User_Login_ID());

	Env.setContext(ctx, "#AD_Role_ID", config.getAD_Role_ID());

	// Make sure the test won't produce migration scripts because it's pointless and annoying
	Ini.setProperty(Ini.P_LOGMIGRATIONSCRIPT, false);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:27,代码来源:Helper.java

示例2: ProcessFrame

import org.compiere.util.Env; //导入方法依赖的package包/类
ProcessFrame(final ProcessDialogBuilder builder)
{
	super();

	if (builder.getWindowNo() <= 0 || builder.getWindowNo() == Env.WINDOW_None)
	{
		windowNoCreatedHere = Env.createWindowNo(this);
		builder.setWindowAndTabNo(windowNoCreatedHere);
	}
	else
	{
		windowNoCreatedHere = null;
	}

	panel = builder.buildPanel();

	if (panel.isDisposed())
	{
		dispose();
		return;
	}

	panel.installTo(this);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:25,代码来源:ProcessFrame.java

示例3: WFActivity

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * WF Activity
 * 
 */
public WFActivity()
{
	super();
	log.info("");
	m_WindowNo = Env.createWindowNo(this);
	try
	{
		dynInit(m_WindowNo);
		jbInit();
	}
	catch (Exception e)
	{
		log.error("", e);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:20,代码来源:WFActivity.java

示例4: ALogin

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Construct the dialog. Need to call initLogin for dynamic start
 *
 * @param parent parent
 */
public ALogin(final Frame parent, final Properties ctx)
{
	super(parent, "Login", true);	// Modal
	setDefaultCloseOperation(DISPOSE_ON_CLOSE);

	this.ctx = ctx;
	this.m_WindowNo = Env.createWindowNo(this);

	//
	try
	{
		jbInit();
	}
	catch (Exception e)
	{
		log.error("Failed initializing the login window", e);
	}

	// Focus to OK
	this.getRootPane().setDefaultButton(confirmPanel.getOKButton());
	parent.setIconImage(Adempiere.getProductIconSmall());
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:28,代码来源:ALogin.java

示例5: loadWindow

import org.compiere.util.Env; //导入方法依赖的package包/类
private GridTab loadWindow(final String tableName, final boolean isSOTrx)
{
	final int AD_Window_ID;
	if (isSOTrx)
	{
		AD_Window_ID = MTable.get(helper.getCtx(), tableName).getAD_Window_ID();
		assertTrue("Expected table " + tableName + " to have an AD_Window_ID", AD_Window_ID > 0);
	}
	else
	{
		AD_Window_ID = MTable.get(helper.getCtx(), tableName).getPO_Window_ID();
		assertTrue("Expected table " + tableName + " to have a PO_Window_ID", AD_Window_ID > 0);
	}
	logger.info("AD_Window_ID=" + AD_Window_ID);

	final int windowNo = Env.createWindowNo(null);
	this.gridWindow = GridWindow.get(helper.getCtx(), windowNo, AD_Window_ID, false);
	if (gridWindow.isSOTrx())
		Env.setContext(Env.getCtx(), windowNo, "IsSOTrx", gridWindow.isSOTrx());
	assertThat("Can not load window AD_Window_ID=" + AD_Window_ID, gridWindow, notNullValue());
	logger.info("GridWindow=" + gridWindow);

	final GridTab gridTab = gridWindow.getTab(0);
	Assert.assertEquals("PO and GridTab tableNames don't match", tableName, gridTab.get_TableName());
	logger.info("GridTab=" + gridTab);

	initTab(gridTab);

	this.currentGridTab = gridTab;

	return gridTab;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:33,代码来源:GridWindowHelper.java

示例6: VAccountDialog

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param frame frame
 * @param title title
 * @param mAccount account info
 * @param C_AcctSchema_ID as
 */
public VAccountDialog(
		final Frame frame,
		final String title,
		final MAccountLookup mAccount,
		final int C_AcctSchema_ID)
{
	super(frame, title, true);
	if (log.isInfoEnabled())
	{
		log.info("C_AcctSchema_ID=" + C_AcctSchema_ID + ", C_ValidCombination_ID=" + mAccount.getC_ValidCombination_ID());
	}

	m_mAccount = mAccount;
	m_C_AcctSchema_ID = C_AcctSchema_ID;
	m_WindowNo = Env.createWindowNo(this);

	setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	try
	{
		jbInit();
	}
	catch (Exception ex)
	{
		log.error(ex.toString());
	}

	if (initAccount())
	{
		// make sure we have a decent size at least
		setMinimumSize(new Dimension(720, 350));
		
		AEnv.showCenterWindow(frame, this);
	}
	else
	{
		dispose();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:47,代码来源:VAccountDialog.java

示例7: VPAttributeDialog

import org.compiere.util.Env; //导入方法依赖的package包/类
public VPAttributeDialog(final Frame frame, final ASIEditingInfo asiInfo, final IVPAttributeContext attributeContext)
{
	super(frame, Services.get(IMsgBL.class).translate(Env.getCtx(), "M_AttributeSetInstance_ID"), true);

	m_WindowNo = Env.createWindowNo(this);
	this.attributeContext = attributeContext;

	final I_M_AttributeSet attributeSet = asiInfo.getM_AttributeSet();
	_attributeSet = LegacyAdapters.convertToPO(attributeSet);
	_asiTemplate = asiInfo.getM_AttributeSetInstance();
	_availableAttributes = asiInfo.getAvailableAttributes();
	_allowSelectExistingASI = asiInfo.isAllowSelectExistingASI();

	_productId = attributeContext.getM_Product_ID();
	_callerColumnId = asiInfo.getCallerColumnId();

	this.isLotEnabled = asiInfo.isLotEnabled();
	this.isSerNoEnabled = asiInfo.isSerNoEnabled();
	this.isGuaranteeDateEnabled = asiInfo.isGuaranteeDateEnabled();

	//
	// Initialize
	try
	{
		jbInit();

		// Init all UI editors and fields based on ASI template
		initAttributes();

		AEnv.showCenterWindow(frame, this);
	}
	catch (Exception ex)
	{
		dispose();
		throw AdempiereException.wrapIfNeeded(ex);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:38,代码来源:VPAttributeDialog.java

示例8: Viewer

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 *	Viewer Constructor
 *	@param re report engine
 */
public Viewer (ReportEngine re)
{
	super();
	log.info("");
	m_WindowNo = Env.createWindowNo(this);
	m_reportEngine = re;
	m_AD_Table_ID = re.getPrintFormat().getAD_Table_ID();
	if (!Env.getUserRolePermissions().isCanReport(m_AD_Table_ID))
	{
		ADialog.error(m_WindowNo, this, "AccessCannotReport", m_reportEngine.getName());
		this.dispose();
	}
	m_isCanExport = Env.getUserRolePermissions().isCanExport(m_AD_Table_ID);
	try
	{
		m_viewPanel = re.getView();
		m_ctx = m_reportEngine.getCtx();
		jbInit();
		dynInit();
		if (!m_viewPanel.isArchivable())
			log.warn("Cannot archive Document");
		AEnv.showCenterScreen(this);
	}
	catch(Exception e)
	{
		log.error("", e);
		ADialog.error(m_WindowNo, this, "LoadError", e.getLocalizedMessage());
		this.dispose();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:35,代码来源:Viewer.java

示例9: FormFrame

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 *	Create Form.
 *  Need to call openForm
 */
public FormFrame ()
{
	super();
	addWindowListener(new java.awt.event.WindowAdapter() 
	{
		@Override
		public void windowOpened(java.awt.event.WindowEvent evt) 
		{
			formWindowOpened(evt);
		}
	});
	
	m_WindowNo = Env.createWindowNo (this);
	m_glassPane = MetasfreshGlassPane.install(this);
	try
	{
		jbInit();
		createMenu();
	}
	catch(Exception e)
	{
		log.error("Failed to initialize the form frame", e);
		
		// Dispose this FormFrame (to make sure the status is cleared)
		dispose();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:32,代码来源:FormFrame.java

示例10: getWindowNo

import org.compiere.util.Env; //导入方法依赖的package包/类
private int getWindowNo()
{
	if (_windowNo <= 0)
	{
		_windowNo = Env.getWindowNo(getParent());
	}
	if (_windowNo <= 0)
	{
		_windowNo = Env.createWindowNo(getParent());
	}
	return _windowNo;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:13,代码来源:EMailDialog.java

示例11: VPAttributeSerNoDialog

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 *	Product Attribute Instance Dialog
 *	@param frame parent frame
 *	@param M_AttributeSetInstance_ID Product Attribute Set Instance id
 * 	@param M_Product_ID Product id
 * 	@param C_BPartner_ID b partner
 * 	@param productWindow this is the product window (define Product Instance)
 * 	@param AD_Column_ID column
 * 	@param WindowNo window
 */
public VPAttributeSerNoDialog (Frame frame, int M_AttributeSetInstance_ID, 
	int M_Product_ID, int C_BPartner_ID, 
	 int AD_Column_ID, int WindowNo)
{
	super (frame, Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID") , true);
	log.info("M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID 
		+ ", M_Product_ID=" + M_Product_ID
		+ ", C_BPartner_ID=" + C_BPartner_ID
		+ ", Column=" + AD_Column_ID);
	m_WindowNo = Env.createWindowNo (this);
	m_M_AttributeSetInstance_ID = M_AttributeSetInstance_ID;
	m_M_Product_ID = M_Product_ID;
	m_C_BPartner_ID = C_BPartner_ID;
	m_AD_Column_ID = AD_Column_ID;
	m_WindowNoParent = WindowNo;

	try
	{
		jbInit();
	}
	catch(Exception ex)
	{
		log.error("VPAttributeDialog" + ex);
	}
	//	Dynamic Init
	if (!initAttributes ())
	{
		dispose();
		return;
	}
	AEnv.showCenterWindow(frame, this);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:43,代码来源:VPAttributeSerNoDialog.java

示例12: ReadPaymentDocumentPanel

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * @param window
 * @param AD_Org_ID
 */
public ReadPaymentDocumentPanel(final Window window, final int AD_Org_ID)
{
	this(Env.createWindowNo(window), window, AD_Org_ID);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:ReadPaymentDocumentPanel.java

示例13: SelectPaySelectionDialog

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Open pay selection dialog. When pressing OK, {@link I_C_PaySelectionLine}s will be created for the selected {@link I_C_PaySelection}
 *
 * @param owner
 * @param title
 * @param partner
 * @param invoicesToProcess
 *
 * @throws HeadlessException
 */
public SelectPaySelectionDialog(final Frame owner,
		final String title,
		final I_C_BPartner partner,
		final List<I_C_Invoice> invoicesToProcess,
		final int currencyId,
		final String paymentReference)
		throws HeadlessException
{
	super(owner, title, true); // modal (always)

	//
	// Initialize window number
	windowNo = Env.createWindowNo(getContentPane());

	this.partner = partner;
	this.invoicesToProcess = invoicesToProcess;
	this.currencyId = currencyId;

	final Properties ctx = Env.getCtx();

	//
	// Initialize field(s) which depend on window number
	final String paySelectionColumnName = org.compiere.model.I_C_PaySelection.COLUMNNAME_C_PaySelection_ID;
	final I_AD_Column paySelectionColumn = adTableDAO.retrieveColumn(org.compiere.model.I_C_PaySelection.Table_Name, paySelectionColumnName);

	//
	// Filter out pay selection for bank accounts not matching the currency
	final String whereClause = "EXISTS ("
			+ "SELECT 1 FROM C_BP_BankAccount bpba"
			+ " WHERE bpba.C_BP_BankAccount_ID=C_PaySelection.C_BP_BankAccount_ID"
			+ " AND bpba.C_Currency_ID=" + this.currencyId
			+ ")";

	final Lookup paySelectionLookup;
	try
	{
		paySelectionLookup = MLookupFactory.get(ctx,
				windowNo,
				paySelectionColumn.getAD_Column_ID(),
				DisplayType.Search,
				null, //table name
				paySelectionColumnName,
				paySelectionColumn.getAD_Reference_Value_ID(),
				false, // IsParent,
				whereClause);
	}
	catch (final Exception e)
	{
		throw new AdempiereException(e);
	}

	paySelectionField = new VLookup(I_C_PaySelection.COLUMNNAME_C_PaySelection_ID,
			true, // mandatory
			false, // isReadOnly
			true, // isUpdateable
			paySelectionLookup);
	paySelectionField.enableLookupAutocomplete();

	this.paymentReference = paymentReference;

	init();
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:73,代码来源:SelectPaySelectionDialog.java

示例14: PosApplication

import org.compiere.util.Env; //导入方法依赖的package包/类
PosApplication() {
		Adempiere.startup(true);	//	needs to be here for UI
		Splash splash = Splash.getSplash();
		final CFrame frame = new CFrame();
		//  Focus Traversal
		KeyboardFocusManager.setCurrentKeyboardFocusManager(AKeyboardFocusManager.get());
	//	FocusManager.getCurrentManager().setDefaultFocusTraversalPolicy(AFocusTraversalPolicy.get());
	//	this.setFocusTraversalPolicy(AFocusTraversalPolicy.get());


		ALogin login = new ALogin(splash, Env.getCtx());
		if (!login.initLogin())		//	no automatic login
		{
			//	Center the window
			try
			{
				AEnv.showCenterScreen(login);	//	HTML load errors
			}
			catch (Exception ex)
			{
			}
			if (!login.isConnected() || !login.isOKpressed())
				AEnv.exit(1);
		}

		//  Check Build
		// we already check the server version via ClientUpdateValidator and that's enough
//		if (!DB.isBuildOK(m_ctx))
//			AEnv.exit(1);

		//  Check DB	(AppsServer Version checked in Login)
		// DB.isDatabaseOK(m_ctx); 	// we already check the server version via ClientUpdateValidator and that's enough


		splash.setText(Msg.getMsg(m_ctx, "Loading"));
		splash.toFront();
		splash.paint(splash.getGraphics());

		//
		if (!Adempiere.startupEnvironment(true)) // Load Environment
			System.exit(1);
		Services.get(ISessionBL.class).getCurrentOrCreateNewSession(Env.getCtx());		//	Start Session

		int m_WindowNo = Env.createWindowNo(frame);

	//  Default Image
		frame.setIconImage(Adempiere.getProductIconSmall());

		// Setting close operation/listener - teo_sarca [ 1684168 ]
		frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		frame.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				if (!ADialog.ask(0, null, "ExitApplication?"))
					return;
				frame.dispose();
			}
		});

		PosBasePanel pos = new PosBasePanel();
		pos.init(0,frame);
		frame.pack();
		splash.dispose();
		splash = null;
		frame.setVisible(true);
	}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:67,代码来源:PosApplication.java

示例15: AcctViewer

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 *  Detail Constructor
 *
 *  @param AD_Client_ID Client
 *  @param AD_Table_ID Table
 *  @param Record_ID Record
 */
public AcctViewer(int AD_Client_ID, final int AD_Table_ID, final int Record_ID)
{
	super(Services.get(IMsgBL.class).getMsg(Env.getCtx(), "AcctViewer"));

	final Properties ctx = Env.getCtx();

	log.info("AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID);

	setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	
	// task 07393: find out the AD_Org_ID. we'll use that info to initially set the current document's accounting schema.
	final int AD_Org_ID;
	if (AD_Table_ID > 0 && Record_ID > 0)
	{
		final PO po = MTable.get(ctx, AD_Table_ID).getPO(Record_ID, ITrx.TRXNAME_None);
		AD_Org_ID = po.getAD_Org_ID(); // the the AD_Org_ID for out table and record
		AD_Client_ID =  po.getAD_Client_ID(); // also get the AD_Client_ID to make sure it is consistent with the org
	}
	else
	{
		AD_Org_ID = 0; // assume AD_Org_ID=0
	}
	
	m_data = new AcctViewerData(ctx, Env.createWindowNo(this), AD_Client_ID, AD_Org_ID, AD_Table_ID);
	AEnv.addToWindowManager(this);
	//
	try
	{
		// Enable "Display" checkboxes by default (see 07609)
		// (ony if this window is not opened from a document)
		if (AD_Table_ID <= 0 || Record_ID <= 0)
		{
			displayDocumentInfo.setSelected(true);
			displayQty.setSelected(true);
			displayEndingBalance.setSelected(true);
		}

		//
		jbInit();
		dynInit(AD_Table_ID, Record_ID);
		AEnv.showCenterScreen(this);
	}
	catch (Exception e)
	{
		log.error("", e);
		dispose();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:56,代码来源:AcctViewer.java


注:本文中的org.compiere.util.Env.createWindowNo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。