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


Java Env.getWindow方法代码示例

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


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

示例1: actionLetter

import org.compiere.util.Env; //导入方法依赖的package包/类
private void actionLetter()
{
	final BoilerPlateContext context = MADBoilerPlate.createEditorContext(SourceDocument.toSourceDocumentOrNull(parent.getCurrentTab()));
	final LetterDialog dialog = new LetterDialog(
			Env.getWindow(parent.getWindowNo()),
			Services.get(IMsgBL.class).getMsg(Env.getCtx(), Letters.MSG_Letter),
			context
			);
	dialog.setPrintOnOK(true);
	dialog.getRichTextEditor().setEnablePrint(false);
	AEnv.showCenterScreen(dialog);
	if (dialog.isPrinted())
	{
		final File pdf = dialog.getPDF();
		MADBoilerPlate.createRequest(pdf,
				parent.getCurrentTab().getAD_Table_ID(), parent.getCurrentTab().getRecord_ID(),
				context);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:20,代码来源:AEMailLetter.java

示例2: VDocAction

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Constructor.
 *
 * Please note, in case there is a failure, a popup will be displayed but this constructor will never fail.
 * To check if this dialog is valid, use {@link #getNumberOfOptions()}.
 *
 * @param WindowNo window no
 * @param mTab tab
 * @param Record_ID record id
 */
public VDocAction(final int WindowNo, final GridTab mTab, final int Record_ID)
{
	super(Env.getWindow(WindowNo), Services.get(IMsgBL.class).translate(Env.getCtx(), "DocAction"), true);
	log.info("");
	m_WindowNo = WindowNo;
	m_mTab = mTab;
	m_AD_Table_ID = mTab.getAD_Table_ID();

	//
	try
	{
		jbInit();

		//
		dynInit(Record_ID);
		//
		AEnv.positionCenterWindow(Env.getWindow(WindowNo), this);
	}
	catch (Exception ex)
	{
		Services.get(IClientUI.class).error(WindowNo, ex);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:34,代码来源:VDocAction.java

示例3: VPayment

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param WindowNo
 *            owning window
 * @param mTab
 *            owning tab
 * @param button
 *            button with access information
 */
public VPayment(int WindowNo, GridTab mTab, VButton button)
{
	super(Env.getWindow(WindowNo), Services.get(IMsgBL.class).getMsg(Env.getCtx(), "Payment"), true);
	m_ctx = Env.getCtx();
	m_WindowNo = WindowNo;
	m_mTab = mTab;
	doc = InterfaceWrapperHelper.create(m_mTab, IPayableDocument.class);
	try
	{
		jbInit();
		m_initOK = dynInit(getPaymentRules(button)); // Null Pointer if order/invoice not saved yet
	}
	catch (Throwable ex)
	{
		log.error("VPayment", ex);
		ADialog.error(m_WindowNo, this, "PaymentError", ex.getLocalizedMessage());
		m_initOK = false;
		dispose();
		return;
	}
	//
	AEnv.positionCenterWindow(Env.getWindow(WindowNo), this);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:34,代码来源:VPayment.java

示例4: OrderLineCreate

import org.compiere.util.Env; //导入方法依赖的package包/类
public OrderLineCreate(int windowNo, GridTab orderTab) {
	super(Env.getWindow(windowNo), true);

	final I_C_Order orderBean = InterfaceWrapperHelper.create(orderTab,
			I_C_Order.class);

	if (orderBean.getC_Order_ID() <= 0) {
		throw new IllegalStateException("@[email protected]=0");
	}
	this.windowNo = windowNo;
	this.orderTab = orderTab;
	this.order = new MOrder(Env.getCtx(), orderBean.getC_Order_ID(), null);

	try {
		dynInit();
	} catch (Exception e) {
		ADialog.error(windowNo, this, "Error", e.getLocalizedMessage());
		if (LogManager.isLevelFine())
			e.printStackTrace();
		dispose();
		return;
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:24,代码来源:OrderLineCreate.java

示例5: startEditor

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
protected String startEditor(final GridField gridField, final String text, final boolean editable)
{
	final VEditor editor = getEditor();
	if ((gridField.getDisplayType() == DisplayType.TextLong) && (editor instanceof Component))
	{
		final Component editorComp = (Component)editor;
		final String columnName = gridField.getColumnName();
		final String title = Services.get(IMsgBL.class).translate(Env.getCtx(), columnName);
		
		final int windowNo = gridField.getWindowNo();
		final Frame frame = Env.getWindow(windowNo);
		
		final RichTextEditorDialog ed = new RichTextEditorDialog(editorComp, frame, title, text, editable);
		AEnv.showCenterWindow(frame, ed);
		final String textNew = ed.getHtmlText();
		return textNew;
	}
	else
	{
		return super.startEditor(gridField, text, editable);
	}

}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:25,代码来源:MetasTextEditorContextMenuAction.java

示例6: getParentFrame

import org.compiere.util.Env; //导入方法依赖的package包/类
private final JFrame getParentFrame()
{
	final int parentWindowNo = getParentWindowNo();

	// No windowNo => use main window
	if (parentWindowNo < 0 || parentWindowNo == Env.WINDOW_None)
	{
		return Env.getWindow(Env.WINDOW_MAIN);
	}

	// Use particular window
	final JFrame frame = Env.getWindow(parentWindowNo);
	if (frame != null)
	{
		return frame;
	}

	// Fallback to main window (shall not happen)
	return Env.getWindow(Env.WINDOW_MAIN);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:21,代码来源:InfoWindowMenuBuilder.java

示例7: getParentWindowOrNull

import org.compiere.util.Env; //导入方法依赖的package包/类
private Window getParentWindowOrNull()
{
	Window parent = null;
	if (_parentCompObj instanceof Component)
	{
		parent = Env.getParent((Component)_parentCompObj);
	}

	if (parent == null && Env.isRegularOrMainWindowNo(_parentWindowNo))
	{
		parent = Env.getWindow(_parentWindowNo);
	}

	return parent;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:16,代码来源:SwingAskDialogBuilder.java

示例8: setParentComponentByWindowNo

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public final IClientUIInvoker setParentComponentByWindowNo(final int windowNo)
{
	final Component window = Env.getWindow(windowNo);
	setParentComponent(windowNo, window);
	return this;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:8,代码来源:SwingClientUIInvoker.java

示例9: startEditor

import org.compiere.util.Env; //导入方法依赖的package包/类
protected String startEditor(final GridField gridField, final String text, final boolean editable)
{
	final Properties ctx = Env.getCtx();

	final String columnName = gridField.getColumnName();
	final String title = Services.get(IMsgBL.class).translate(ctx, columnName);

	final int windowNo = gridField.getWindowNo();
	final Frame frame = Env.getWindow(windowNo);
	
	final String textNew;
	if (gridField.getDisplayType() == DisplayType.TextLong)
	{
		//	Start it
		HTMLEditor ed = new HTMLEditor (frame, title, text, editable);
		textNew = ed.getHtmlText();
		ed = null;
	}
	else if (isScriptEditor())
	{
		textNew = ScriptEditor.start(frame, title, text, editable, windowNo);
	}
	else
	{
		final Container comp = (Container)getEditor();
		final int fieldLength = gridField.getFieldLength();
		textNew = Editor.startEditor(comp, title, text, editable, fieldLength);
	}
	
	return textNew;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:32,代码来源:TextEditorContextMenuAction.java

示例10: run

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public void run()
{
	final VEditor editor = getEditor();
	final GridField gridField = editor.getField();
	final Lookup lookup = gridField.getLookup();
	final int windowNo = gridField.getWindowNo();

	final VBPartner vbp = new VBPartner(Env.getWindow(windowNo), windowNo);
	int BPartner_ID = 0;
	// if update, get current value
	if (!createNew)
	{
		final Object value = editor.getValue();
		if (value instanceof Integer)
			BPartner_ID = ((Integer)value).intValue();
		else if (value != null)
			BPartner_ID = Integer.parseInt(value.toString());
	}

	vbp.loadBPartner(BPartner_ID);
	vbp.setVisible(true);
	// get result
	int result = vbp.getC_BPartner_ID();
	if (result == 0 // 0 = not saved
			&& result == BPartner_ID) // the same
		return;
	// Maybe new BPartner - put in cache
	lookup.getDirect(IValidationContext.NULL, new Integer(result), false, true);

	// actionCombo (new Integer(result)); // data binding
	gridField.getGridTab().setValue(gridField, result);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:34,代码来源:BPartnerNewUpdateContextEditorAction.java

示例11: getCallingFrame

import org.compiere.util.Env; //导入方法依赖的package包/类
/** @return the {@link Frame} in which this action was executed or <code>null</code> if not available. */
protected final Frame getCallingFrame()
{
	final GridField gridField = getContext().getEditor().getField();
	if (gridField == null)
	{
		return null;
	}
	final int windowNo = gridField.getWindowNo();
	final Frame frame = Env.getWindow(windowNo);
	return frame;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:13,代码来源:OpenFormContextMenuAction.java

示例12: onButtonPressed

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 *  Start dialog and set value
 */
private final void onButtonPressed()
{
	try
	{
		// Show the dialog
		final VImageDialog vid = new VImageDialog(Env.getWindow(m_WindowNo), m_WindowNo, m_mImage);
		vid.setVisible(true);

		// Do nothing if user canceled (i.e. closed the window)
		if (vid.isCanceled())
		{
			return;
		}
		
		final int AD_Image_ID = vid.getAD_Image_ID();
		final Integer newValue = AD_Image_ID > 0 ? AD_Image_ID : null;
		//
		m_mImage = null;	//	force reload
		setValue(newValue);	//	set explicitly
		//
		try
		{
			fireVetoableChange(m_columnName, null, newValue);
		}
		catch (PropertyVetoException pve)	{}
	}
	catch (Exception e)
	{
		Services.get(IClientUI.class).error(m_WindowNo, e);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:35,代码来源:VImage.java

示例13: VRelationTarget

import org.compiere.util.Env; //导入方法依赖的package包/类
public VRelationTarget(final int windowNo, final ModelRelationTarget model)
{
	if (Env.isRegularOrMainWindowNo(windowNo))
	{
		dialog = new CDialog(Env.getWindow(windowNo), true);
	}
	else
	{
		dialog = new CDialog();
	}
	this.windowNo = windowNo;
	init(windowNo, model);
	new CtrlRelationTarget(model, this);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:15,代码来源:VRelationTarget.java

示例14: getAMenu

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * FR [ 1966328 ] get AMenu
 */
public static AMenu getAMenu()
{
	final JFrame top = Env.getWindow(Env.WINDOW_MAIN);
	if (top instanceof AMenu)
	{
		return (AMenu)top;
	}
	return null;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:13,代码来源:AEnv.java

示例15: create

import org.compiere.util.Env; //导入方法依赖的package包/类
@Deprecated
public static Info create(final int windowNo, final I_AD_InfoWindow infoWindow)
{
	final JFrame parentFrame = Env.getWindow(windowNo);
	return newBuilder()
			.setParentFrame(parentFrame)
			.setWindowNo(windowNo)
			.setInfoWindow(infoWindow)
			.build();
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:11,代码来源:InfoBuilder.java


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