summaryrefslogtreecommitdiff
path: root/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/java/com/sun/star/script/framework/browse/DialogFactory.java')
-rw-r--r--scripting/java/com/sun/star/script/framework/browse/DialogFactory.java95
1 files changed, 0 insertions, 95 deletions
diff --git a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
index 4b80e9a685f1..6e46e193f8cf 100644
--- a/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
+++ b/scripting/java/com/sun/star/script/framework/browse/DialogFactory.java
@@ -126,101 +126,6 @@ public class DialogFactory
return (String)resultHolder.getResult();
}
- private XDialog createConfirmDialog(String title, String prompt)
- throws com.sun.star.uno.Exception
- {
- if (title == null || title.equals(""))
- {
- title = "Scripting Framework";
- }
-
- if (prompt == null || prompt.equals(""))
- {
- prompt = "Enter name";
- }
-
- // get the service manager from the component context
- XMultiComponentFactory xMultiComponentFactory =
- xComponentContext.getServiceManager();
-
- // create the dialog model and set the properties
- Object dialogModel = xMultiComponentFactory.createInstanceWithContext(
- "com.sun.star.awt.UnoControlDialogModel", xComponentContext);
-
- XPropertySet props = UnoRuntime.queryInterface(
- XPropertySet.class, dialogModel);
-
- props.setPropertyValue("Title", title);
- setDimensions(dialogModel, 100, 100, 157, 37);
-
- // get the service manager from the dialog model
- XMultiServiceFactory xMultiServiceFactory =
- UnoRuntime.queryInterface(
- XMultiServiceFactory.class, dialogModel);
-
- // create the label model and set the properties
- Object label = xMultiServiceFactory.createInstance(
- "com.sun.star.awt.UnoControlFixedTextModel");
-
- setDimensions(label, 15, 5, 134, 12);
-
- XPropertySet labelProps = UnoRuntime.queryInterface(
- XPropertySet.class, label);
- labelProps.setPropertyValue("Name", "PromptLabel");
- labelProps.setPropertyValue("Label", prompt);
-
- // create the Run Macro button model and set the properties
- Object okButtonModel = xMultiServiceFactory.createInstance(
- "com.sun.star.awt.UnoControlButtonModel");
-
- setDimensions(okButtonModel, 40, 18, 38, 15);
-
- XPropertySet buttonProps = UnoRuntime.queryInterface(
- XPropertySet.class, okButtonModel);
- buttonProps.setPropertyValue("Name", "Ok");
- buttonProps.setPropertyValue("Label", "Ok");
-
- // create the Dont Run Macro button model and set the properties
- Object cancelButtonModel = xMultiServiceFactory.createInstance(
- "com.sun.star.awt.UnoControlButtonModel");
-
- setDimensions(cancelButtonModel, 83, 18, 38, 15);
-
- buttonProps = UnoRuntime.queryInterface(
- XPropertySet.class, cancelButtonModel);
- buttonProps.setPropertyValue("Name", "Cancel");
- buttonProps.setPropertyValue("Label", "Cancel");
-
- // insert the control models into the dialog model
- XNameContainer xNameCont = UnoRuntime.queryInterface(
- XNameContainer.class, dialogModel);
-
- xNameCont.insertByName("PromptLabel", label);
- xNameCont.insertByName("Ok", okButtonModel);
- xNameCont.insertByName("Cancel", cancelButtonModel);
-
- // create the dialog control and set the model
- Object dialog = xMultiComponentFactory.createInstanceWithContext(
- "com.sun.star.awt.UnoControlDialog", xComponentContext);
- XControl xControl = UnoRuntime.queryInterface(
- XControl.class, dialog);
-
- XControlModel xControlModel = UnoRuntime.queryInterface(XControlModel.class, dialogModel);
- xControl.setModel(xControlModel);
-
- // create a peer
- Object toolkit = xMultiComponentFactory.createInstanceWithContext(
- "com.sun.star.awt.ExtToolkit", xComponentContext);
- XToolkit xToolkit = UnoRuntime.queryInterface(
- XToolkit.class, toolkit);
- XWindow xWindow = UnoRuntime.queryInterface(
- XWindow.class, xControl);
- xWindow.setVisible(false);
- xControl.createPeer(xToolkit, null);
-
- return UnoRuntime.queryInterface(XDialog.class, dialog);
- }
-
private void setDimensions(Object o, int x, int y, int width, int height)
throws com.sun.star.uno.Exception
{