xPSetButton.setPropertyValue( "Name", _doNotRunButtonName );
xPSetButton.setPropertyValue( "TabIndex", new Short( (short)0 ) );
xPSetButton.setPropertyValue( "Label", _doNotRunMacro );
// insert the control models into the dialog model
XNameContainer xNameCont = ( XNameContainer )UnoRuntime.queryInterface(
XNameContainer.class, dialogModel );
xNameCont.insertByName( _runButtonName, runButtonModel );
xNameCont.insertByName( _doNotRunButtonName, doNotRunButtonModel );
if ( checkBoxDialog )
{
LogUtils.DEBUG("creating label & checkbox");
// create the label model and set the properties
Object label2Model = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlFixedTextModel" );
XPropertySet xPSetLabel = ( XPropertySet )UnoRuntime.queryInterface(
XPropertySet.class, label2Model );
xPSetLabel.setPropertyValue( "PositionX", new Integer( label2X ));
xPSetLabel.setPropertyValue( "PositionY", new Integer( label2Y ));
xPSetLabel.setPropertyValue( "Width", new Integer( label2W ));
xPSetLabel.setPropertyValue( "Height", new Integer( label2H ));
xPSetLabel.setPropertyValue( "Name", _label2Name );
xPSetLabel.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetLabel.setPropertyValue( "Label", _label2String );
// create the label model and set the properties
Object label3Model = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlFixedTextModel" );
XPropertySet xPSetLabel3 = ( XPropertySet )UnoRuntime.queryInterface(
XPropertySet.class, label3Model );
xPSetLabel3.setPropertyValue( "PositionX", new Integer( label3X ));
xPSetLabel3.setPropertyValue( "PositionY", new Integer( label3Y ));
xPSetLabel3.setPropertyValue( "Width", new Integer( label3W ));
xPSetLabel3.setPropertyValue( "Height", new Integer( label3H ));
xPSetLabel3.setPropertyValue( "Name", _label3Name );
xPSetLabel3.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetLabel3.setPropertyValue( "Label", _label3String );
// create the label model and set the properties
Object label4Model = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlFixedTextModel" );
XPropertySet xPSetLabel4 = ( XPropertySet )UnoRuntime.queryInterface(
XPropertySet.class, label4Model );
xPSetLabel4.setPropertyValue( "PositionX", new Integer( label4X ));
xPSetLabel4.setPropertyValue( "PositionY", new Integer( label4Y ));
xPSetLabel4.setPropertyValue( "Width", new Integer( label4W ));
xPSetLabel4.setPropertyValue( "Height", new Integer( label4H ));
xPSetLabel4.setPropertyValue( "Name", _label4Name );
xPSetLabel4.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetLabel4.setPropertyValue( "Label", _label4String );
// create the checkbox model and set the properties
Object checkBoxModel = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlCheckBoxModel" );
XPropertySet xPSetCheckBox = ( XPropertySet )UnoRuntime.queryInterface(
XPropertySet.class, checkBoxModel );
xPSetCheckBox.setPropertyValue( "PositionX", new Integer( checkBoxX ));
xPSetCheckBox.setPropertyValue( "PositionY", new Integer( checkBoxY ));
xPSetCheckBox.setPropertyValue( "Width", new Integer( checkBoxW ));
xPSetCheckBox.setPropertyValue( "Height", new Integer( checkBoxH ));
xPSetCheckBox.setPropertyValue( "State", new Short((short)0) );
xPSetCheckBox.setPropertyValue( "Name", _checkBoxName );
xPSetCheckBox.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetCheckBox.setPropertyValue( "Label", new String(_checkBoxString +checkBoxPath) );
// insert the control models into the dialog model
xNameCont.insertByName( _label2Name, label2Model );
xNameCont.insertByName( _label3Name, label3Model );
xNameCont.insertByName( _label4Name, label4Model );
xNameCont.insertByName( _checkBoxName, checkBoxModel );
if ( extraPathLine == true )
{
// create the label model and set the properties
Object label5Model = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlFixedTextModel" );
XPropertySet xPSetLabel5 = ( XPropertySet )UnoRuntime.queryInterface(
XPropertySet.class, label5Model );
xPSetLabel5.setPropertyValue( "PositionX", new Integer( label5X ));
xPSetLabel5.setPropertyValue( "PositionY", new Integer( label5Y ));
xPSetLabel5.setPropertyValue( "Width", new Integer( label5W ));
xPSetLabel5.setPropertyValue( "Height", new Integer( label5H ));
xPSetLabel5.setPropertyValue( "Name", _label5Name );
xPSetLabel5.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetLabel5.setPropertyValue( "Label", checkBoxPath2 );
xNameCont.insertByName( _label5Name, label5Model );
}
}
else
{
// create the label model and set the properties
Object labelModel = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlFixedTextModel" );
XPropertySet xPSetLabel = ( XPropertySet )UnoRuntime.queryInterface(
XPropertySet.class, labelModel );
xPSetLabel.setPropertyValue( "PositionX", new Integer( label1X ));
xPSetLabel.setPropertyValue( "PositionY", new Integer( label1Y ));
xPSetLabel.setPropertyValue( "Width", new Integer( label1W ));
xPSetLabel.setPropertyValue( "Height", new Integer( label1H ));
xPSetLabel.setPropertyValue( "Name", _label1Name );
xPSetLabel.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetLabel.setPropertyValue( "Label", _label1String );
// insert the control models into the dialog model
xNameCont.insertByName( _label1Name, labelModel );
}
// create the dialog control and set the model
Object dialog = xMultiComponentFactory.createInstanceWithContext(
"com.sun.star.awt.UnoControlDialog", _xComponentContext );