org.cogroo.addon.dialogs.reporterror
Class DialogBuilder

java.lang.Object
  extended by org.cogroo.addon.dialogs.reporterror.DialogBuilder

public class DialogBuilder
extends Object


Field Summary
static int HORIZONTAL_ALIGNMENT_CENTER
           
static int HORIZONTAL_ALIGNMENT_LEFT
           
static int HORIZONTAL_ALIGNMENT_RIGHT
           
 
Constructor Summary
DialogBuilder(com.sun.star.uno.XComponentContext context, int x, int y, int width, int height, String title)
          Create a new dialog builder.
DialogBuilder(com.sun.star.uno.XComponentContext context, int x, int y, int width, int height, String title, int backgroundColor)
           
 
Method Summary
 com.sun.star.awt.XButton addButton(String title, String name, int x, int y, int width, int height)
           
 com.sun.star.awt.XCheckBox addCheckBox(boolean state, String name, int x, int y, int width, int height)
           
 com.sun.star.awt.XComboBox addComboBox(String[] items, String name, int x, int y, int width, int height)
           
 void addImage(String url, String name, int x, int y, int width, int height, boolean scale)
           
 void addImage(String url, String name, int x, int y, int width, int height, boolean scale, short border)
           
 com.sun.star.awt.XFixedText addLabel(String text, String name, int x, int y, int width, int height)
           
 com.sun.star.awt.XFixedText addLabel(String text, String name, int x, int y, int width, int height, int alignment)
           
 com.sun.star.awt.XListBox addListBox(String[] items, String name, int x, int y, int width, int height)
           
 com.sun.star.awt.XFixedText addMultiLineLabel(String text, String name, int x, int y, int width, int height)
           
 com.sun.star.awt.XTextComponent addPasswordField(char[] password, String name, int x, int y, int width, int height)
          Create a password field
 com.sun.star.awt.XTextComponent addTextArea(String content, String name, int x, int y, int width, int height)
          Create a textarea with given content.
 com.sun.star.awt.XTextComponent addTextArea(String content, String name, int x, int y, int width, int height, boolean readonly)
          Create a textarea with given content.
 com.sun.star.awt.XTextComponent addTextField(String content, String name, int x, int y, int width, int height)
          Create a single line textfield with the given content.
static String createUniqueName(com.sun.star.container.XNameAccess _xElementContainer, String _sElementName)
          makes a String unique by appending a numerical suffix
static void dispose(com.sun.star.awt.XDialog dialog)
           
 com.sun.star.awt.XDialog getDialog()
           
 com.sun.star.container.XNameContainer getModelContainer()
           
 String getTextContent(String componentName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL_ALIGNMENT_LEFT

public static final int HORIZONTAL_ALIGNMENT_LEFT
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_CENTER

public static final int HORIZONTAL_ALIGNMENT_CENTER
See Also:
Constant Field Values

HORIZONTAL_ALIGNMENT_RIGHT

public static final int HORIZONTAL_ALIGNMENT_RIGHT
See Also:
Constant Field Values
Constructor Detail

DialogBuilder

public DialogBuilder(com.sun.star.uno.XComponentContext context,
                     int x,
                     int y,
                     int width,
                     int height,
                     String title)
Create a new dialog builder.

Parameters:
context - the OOo context
x - initial horizontal positon
y - initial vertical position
width - initial width
height - initial height
title - title

DialogBuilder

public DialogBuilder(com.sun.star.uno.XComponentContext context,
                     int x,
                     int y,
                     int width,
                     int height,
                     String title,
                     int backgroundColor)
Method Detail

addButton

public com.sun.star.awt.XButton addButton(String title,
                                          String name,
                                          int x,
                                          int y,
                                          int width,
                                          int height)
                                   throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addLabel

public com.sun.star.awt.XFixedText addLabel(String text,
                                            String name,
                                            int x,
                                            int y,
                                            int width,
                                            int height)
                                     throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addLabel

public com.sun.star.awt.XFixedText addLabel(String text,
                                            String name,
                                            int x,
                                            int y,
                                            int width,
                                            int height,
                                            int alignment)
                                     throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addMultiLineLabel

public com.sun.star.awt.XFixedText addMultiLineLabel(String text,
                                                     String name,
                                                     int x,
                                                     int y,
                                                     int width,
                                                     int height)
                                              throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addListBox

public com.sun.star.awt.XListBox addListBox(String[] items,
                                            String name,
                                            int x,
                                            int y,
                                            int width,
                                            int height)
                                     throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addComboBox

public com.sun.star.awt.XComboBox addComboBox(String[] items,
                                              String name,
                                              int x,
                                              int y,
                                              int width,
                                              int height)
                                       throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addTextField

public com.sun.star.awt.XTextComponent addTextField(String content,
                                                    String name,
                                                    int x,
                                                    int y,
                                                    int width,
                                                    int height)
                                             throws com.sun.star.uno.Exception
Create a single line textfield with the given content.

Parameters:
content -
name -
x -
y -
width -
height -
Returns:
Throws:
com.sun.star.uno.Exception

addTextArea

public com.sun.star.awt.XTextComponent addTextArea(String content,
                                                   String name,
                                                   int x,
                                                   int y,
                                                   int width,
                                                   int height)
                                            throws com.sun.star.uno.Exception
Create a textarea with given content.

Parameters:
content -
name -
x -
y -
width -
height -
Returns:
a multiline XTextArea
Throws:
com.sun.star.uno.Exception

addTextArea

public com.sun.star.awt.XTextComponent addTextArea(String content,
                                                   String name,
                                                   int x,
                                                   int y,
                                                   int width,
                                                   int height,
                                                   boolean readonly)
                                            throws com.sun.star.uno.Exception
Create a textarea with given content.

Parameters:
content -
name -
x -
y -
width -
height -
Returns:
a multiline XTextArea
Throws:
com.sun.star.uno.Exception

addPasswordField

public com.sun.star.awt.XTextComponent addPasswordField(char[] password,
                                                        String name,
                                                        int x,
                                                        int y,
                                                        int width,
                                                        int height)
                                                 throws com.sun.star.uno.Exception
Create a password field

Parameters:
password - , the content will be overriden after setting to the field
name -
x -
y -
width -
height -
Returns:
Throws:
com.sun.star.uno.Exception

addImage

public void addImage(String url,
                     String name,
                     int x,
                     int y,
                     int width,
                     int height,
                     boolean scale)
              throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addImage

public void addImage(String url,
                     String name,
                     int x,
                     int y,
                     int width,
                     int height,
                     boolean scale,
                     short border)
              throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

addCheckBox

public com.sun.star.awt.XCheckBox addCheckBox(boolean state,
                                              String name,
                                              int x,
                                              int y,
                                              int width,
                                              int height)
                                       throws com.sun.star.uno.Exception
Throws:
com.sun.star.uno.Exception

getDialog

public com.sun.star.awt.XDialog getDialog()

dispose

public static void dispose(com.sun.star.awt.XDialog dialog)

getModelContainer

public com.sun.star.container.XNameContainer getModelContainer()

getTextContent

public String getTextContent(String componentName)
                      throws com.sun.star.container.NoSuchElementException,
                             com.sun.star.lang.WrappedTargetException
Throws:
com.sun.star.container.NoSuchElementException
com.sun.star.lang.WrappedTargetException

createUniqueName

public static String createUniqueName(com.sun.star.container.XNameAccess _xElementContainer,
                                      String _sElementName)
makes a String unique by appending a numerical suffix

Parameters:
_xElementContainer - the com.sun.star.container.XNameAccess container that the new Element is going to be inserted to
_sElementName - the StemName of the Element


Copyright © 2012-2013 CoGrOO. All Rights Reserved.