// iXPixelFactor = (int) (100000/xDevice.getInfo().PixelPerMeterX);
}
public XTextComponent insertFileControl(XTextListener _xTextListener, int _nPosX, int _nPosY, int _nWidth){
XTextComponent xTextComponent = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "FileControl");
// retrieve the configured Work path...
Object oPathSettings = m_xMCF.createInstanceWithContext("com.sun.star.util.PathSettings",m_xContext);
XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, oPathSettings);
String sWorkUrl = (String) xPropertySet.getPropertyValue("Work");
// convert the Url to a system path that is "human readable"...
Object oFCProvider = m_xMCF.createInstanceWithContext("com.sun.star.ucb.FileContentProvider", m_xContext);
XFileIdentifierConverter xFileIdentifierConverter = (XFileIdentifierConverter) UnoRuntime.queryInterface(XFileIdentifierConverter.class, oFCProvider);
String sSystemWorkPath = xFileIdentifierConverter.getSystemPathFromFileURL(sWorkUrl);
// create a controlmodel at the multiservicefactory of the dialog model...
Object oFCModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlFileControlModel");
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
XMultiPropertySet xFCModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oFCModel);
xFCModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Text", "Width"},
new Object[] { new Integer(14), sName, new Integer(_nPosX), new Integer(_nPosY), sSystemWorkPath, new Integer(_nWidth)});
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oFCModel);
XPropertySet xFCModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFCModel);
// add a textlistener that is notified on each change of the controlvalue...
XControl xFCControl = m_xDlgContainer.getControl(sName);
xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xFCControl);
XWindow xFCWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xFCControl);
xTextComponent.addTextListener(_xTextListener);
} catch (com.sun.star.uno.Exception ex) {
/* perform individual exception handling here.
* Possible exception types are:
* com.sun.star.lang.IllegalArgumentException,
* com.sun.star.lang.WrappedTargetException,