Class DialogBase
- java.lang.Object
-
- org.openoffice.da.comp.w2lcommon.helper.DialogBase
-
- All Implemented Interfaces:
com.sun.star.awt.XDialogEventHandler,com.sun.star.lang.XServiceInfo,com.sun.star.lang.XServiceName,com.sun.star.lang.XTypeProvider,com.sun.star.ui.dialogs.XExecutableDialog,com.sun.star.uno.XInterface
- Direct Known Subclasses:
EpubMetadataDialog,LogViewerDialog,OptionsDialogBase
public abstract class DialogBase extends java.lang.Object implements com.sun.star.lang.XTypeProvider, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XServiceName, com.sun.star.ui.dialogs.XExecutableDialog, com.sun.star.awt.XDialogEventHandlerThis class provides an abstract uno component which implements a dialog from an xml description (using the DialogProvider2 service) TODO: Use DialogAccess.java
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String__implementationNameThe component should also have an implementation name.static java.lang.String__serviceNameThe component will be registered under this name.protected static shortCHECKBOX_CHECKEDprotected static shortCHECKBOX_DONT_KNOWprotected static shortCHECKBOX_NOT_CHECKEDprotected com.sun.star.uno.XComponentContextxContext
-
Constructor Summary
Constructors Constructor Description DialogBase(com.sun.star.uno.XComponentContext xContext)Create a new OptionsDialogBase
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancallHandlerMethod(com.sun.star.awt.XDialog xDialog, java.lang.Object event, java.lang.String sMethod)protected abstract voidendDialog()End the dialog after execution (eg. save settings to the registry) The subclass must implement thisshortexecute()protected shortgetCheckBoxState(java.lang.String sControlName)protected booleangetCheckBoxStateAsBoolean(java.lang.String sControlName)protected java.lang.StringgetComboBoxText(java.lang.String sControlName)abstract java.lang.StringgetDialogLibraryName()Return the name of the library containing the dialog The subclass must override this to provide the name of the libraryabstract java.lang.StringgetDialogName()Return the name of the dialog within the library The subclass must override this to provide the name of the dialogprotected java.lang.StringgetFormattedFieldText(java.lang.String sControlName)byte[]getImplementationId()java.lang.StringgetImplementationName()protected shortgetListBoxLineCount(java.lang.String sControlName)protected shortgetListBoxSelectedItem(java.lang.String sControlName)protected java.lang.String[]getListBoxStringItemList(java.lang.String sControlName)protected intgetNumericFieldValue(java.lang.String sControlName)java.lang.StringgetServiceName()java.lang.String[]getSupportedMethodNames()java.lang.String[]getSupportedServiceNames()protected java.lang.StringgetTextFieldText(java.lang.String sControlName)com.sun.star.uno.Type[]getTypes()protected abstract voidinitialize()Initialize the dialog (eg. with settings from the registry) The subclass must implement thisprotected voidsetCheckBoxState(java.lang.String sControlName, short nState)protected voidsetCheckBoxStateAsBoolean(java.lang.String sControlName, boolean bChecked)protected voidsetComboBoxText(java.lang.String sControlName, java.lang.String sText)protected voidsetControlEnabled(java.lang.String sControlName, boolean bEnabled)protected voidsetFormattedFieldText(java.lang.String sControlName, java.lang.String sText)protected voidsetListBoxLineCount(java.lang.String sControlName, short nLineCount)protected voidsetListBoxSelectedItem(java.lang.String sControlName, short nIndex)protected voidsetListBoxStringItemList(java.lang.String sControlName, java.lang.String[] items)protected voidsetNumericFieldValue(java.lang.String sControlName, int nValue)protected voidsetTextFieldText(java.lang.String sControlName, java.lang.String sText)voidsetTitle(java.lang.String sTitle)booleansupportsService(java.lang.String sServiceName)
-
-
-
Field Detail
-
__serviceName
public static java.lang.String __serviceName
The component will be registered under this name. The subclass must override this with a suitable name
-
__implementationName
public static java.lang.String __implementationName
The component should also have an implementation name. The subclass must override this with a suitable name
-
CHECKBOX_NOT_CHECKED
protected static final short CHECKBOX_NOT_CHECKED
- See Also:
- Constant Field Values
-
CHECKBOX_CHECKED
protected static final short CHECKBOX_CHECKED
- See Also:
- Constant Field Values
-
CHECKBOX_DONT_KNOW
protected static final short CHECKBOX_DONT_KNOW
- See Also:
- Constant Field Values
-
xContext
protected com.sun.star.uno.XComponentContext xContext
-
-
Method Detail
-
getDialogLibraryName
public abstract java.lang.String getDialogLibraryName()
Return the name of the library containing the dialog The subclass must override this to provide the name of the library
-
getDialogName
public abstract java.lang.String getDialogName()
Return the name of the dialog within the library The subclass must override this to provide the name of the dialog
-
initialize
protected abstract void initialize()
Initialize the dialog (eg. with settings from the registry) The subclass must implement this
-
endDialog
protected abstract void endDialog()
End the dialog after execution (eg. save settings to the registry) The subclass must implement this
-
getTypes
public com.sun.star.uno.Type[] getTypes()
- Specified by:
getTypesin interfacecom.sun.star.lang.XTypeProvider
-
getImplementationId
public byte[] getImplementationId()
- Specified by:
getImplementationIdin interfacecom.sun.star.lang.XTypeProvider
-
getServiceName
public java.lang.String getServiceName()
- Specified by:
getServiceNamein interfacecom.sun.star.lang.XServiceName
-
supportsService
public boolean supportsService(java.lang.String sServiceName)
- Specified by:
supportsServicein interfacecom.sun.star.lang.XServiceInfo
-
getImplementationName
public java.lang.String getImplementationName()
- Specified by:
getImplementationNamein interfacecom.sun.star.lang.XServiceInfo
-
getSupportedServiceNames
public java.lang.String[] getSupportedServiceNames()
- Specified by:
getSupportedServiceNamesin interfacecom.sun.star.lang.XServiceInfo
-
setTitle
public void setTitle(java.lang.String sTitle)
- Specified by:
setTitlein interfacecom.sun.star.ui.dialogs.XExecutableDialog
-
execute
public short execute()
- Specified by:
executein interfacecom.sun.star.ui.dialogs.XExecutableDialog
-
callHandlerMethod
public boolean callHandlerMethod(com.sun.star.awt.XDialog xDialog, java.lang.Object event, java.lang.String sMethod)- Specified by:
callHandlerMethodin interfacecom.sun.star.awt.XDialogEventHandler
-
getSupportedMethodNames
public java.lang.String[] getSupportedMethodNames()
- Specified by:
getSupportedMethodNamesin interfacecom.sun.star.awt.XDialogEventHandler
-
setControlEnabled
protected void setControlEnabled(java.lang.String sControlName, boolean bEnabled)
-
getCheckBoxState
protected short getCheckBoxState(java.lang.String sControlName)
-
getCheckBoxStateAsBoolean
protected boolean getCheckBoxStateAsBoolean(java.lang.String sControlName)
-
setCheckBoxState
protected void setCheckBoxState(java.lang.String sControlName, short nState)
-
setCheckBoxStateAsBoolean
protected void setCheckBoxStateAsBoolean(java.lang.String sControlName, boolean bChecked)
-
getListBoxStringItemList
protected java.lang.String[] getListBoxStringItemList(java.lang.String sControlName)
-
setListBoxStringItemList
protected void setListBoxStringItemList(java.lang.String sControlName, java.lang.String[] items)
-
getListBoxSelectedItem
protected short getListBoxSelectedItem(java.lang.String sControlName)
-
setListBoxSelectedItem
protected void setListBoxSelectedItem(java.lang.String sControlName, short nIndex)
-
getListBoxLineCount
protected short getListBoxLineCount(java.lang.String sControlName)
-
setListBoxLineCount
protected void setListBoxLineCount(java.lang.String sControlName, short nLineCount)
-
getComboBoxText
protected java.lang.String getComboBoxText(java.lang.String sControlName)
-
setComboBoxText
protected void setComboBoxText(java.lang.String sControlName, java.lang.String sText)
-
getTextFieldText
protected java.lang.String getTextFieldText(java.lang.String sControlName)
-
setTextFieldText
protected void setTextFieldText(java.lang.String sControlName, java.lang.String sText)
-
getFormattedFieldText
protected java.lang.String getFormattedFieldText(java.lang.String sControlName)
-
setFormattedFieldText
protected void setFormattedFieldText(java.lang.String sControlName, java.lang.String sText)
-
getNumericFieldValue
protected int getNumericFieldValue(java.lang.String sControlName)
-
setNumericFieldValue
protected void setNumericFieldValue(java.lang.String sControlName, int nValue)
-
-