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 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.XDialogEventHandler
This class provides an abstract uno component which implements a dialog
from an xml description (using the DialogProvider2 service)
TODO: Use DialogAccess.java
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
The component should also have an implementation name.static String
The component will be registered under this name.protected static final short
protected static final short
protected static final short
protected com.sun.star.uno.XComponentContext
Fields inherited from interface com.sun.star.awt.XDialogEventHandler
UNOTYPEINFO
Fields inherited from interface com.sun.star.ui.dialogs.XExecutableDialog
UNOTYPEINFO
Fields inherited from interface com.sun.star.lang.XServiceInfo
UNOTYPEINFO
Fields inherited from interface com.sun.star.lang.XServiceName
UNOTYPEINFO
Fields inherited from interface com.sun.star.lang.XTypeProvider
UNOTYPEINFO
-
Constructor Summary
ConstructorsConstructorDescriptionDialogBase
(com.sun.star.uno.XComponentContext xContext) Create a new OptionsDialogBase -
Method Summary
Modifier and TypeMethodDescriptionboolean
callHandlerMethod
(com.sun.star.awt.XDialog xDialog, Object event, String sMethod) protected abstract void
End the dialog after execution (eg. save settings to the registry) The subclass must implement thisshort
execute()
protected short
getCheckBoxState
(String sControlName) protected boolean
getCheckBoxStateAsBoolean
(String sControlName) protected String
getComboBoxText
(String sControlName) abstract String
Return the name of the library containing the dialog The subclass must override this to provide the name of the libraryabstract String
Return the name of the dialog within the library The subclass must override this to provide the name of the dialogprotected String
getFormattedFieldText
(String sControlName) byte[]
protected short
getListBoxLineCount
(String sControlName) protected short
getListBoxSelectedItem
(String sControlName) protected String[]
getListBoxStringItemList
(String sControlName) protected int
getNumericFieldValue
(String sControlName) String[]
String[]
protected String
getTextFieldText
(String sControlName) com.sun.star.uno.Type[]
getTypes()
protected abstract void
Initialize the dialog (eg. with settings from the registry) The subclass must implement thisprotected void
setCheckBoxState
(String sControlName, short nState) protected void
setCheckBoxStateAsBoolean
(String sControlName, boolean bChecked) protected void
setComboBoxText
(String sControlName, String sText) protected void
setControlEnabled
(String sControlName, boolean bEnabled) protected void
setFormattedFieldText
(String sControlName, String sText) protected void
setListBoxLineCount
(String sControlName, short nLineCount) protected void
setListBoxSelectedItem
(String sControlName, short nIndex) protected void
setListBoxStringItemList
(String sControlName, String[] items) protected void
setNumericFieldValue
(String sControlName, int nValue) protected void
setTextFieldText
(String sControlName, String sText) void
boolean
supportsService
(String sServiceName)
-
Field Details
-
__serviceName
The component will be registered under this name. The subclass must override this with a suitable name -
__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:
-
CHECKBOX_CHECKED
protected static final short CHECKBOX_CHECKED- See Also:
-
CHECKBOX_DONT_KNOW
protected static final short CHECKBOX_DONT_KNOW- See Also:
-
xContext
protected com.sun.star.uno.XComponentContext xContext
-
-
Constructor Details
-
DialogBase
public DialogBase(com.sun.star.uno.XComponentContext xContext) Create a new OptionsDialogBase
-
-
Method Details
-
getDialogLibraryName
Return the name of the library containing the dialog The subclass must override this to provide the name of the library -
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:
getTypes
in interfacecom.sun.star.lang.XTypeProvider
-
getImplementationId
public byte[] getImplementationId()- Specified by:
getImplementationId
in interfacecom.sun.star.lang.XTypeProvider
-
getServiceName
- Specified by:
getServiceName
in interfacecom.sun.star.lang.XServiceName
-
supportsService
- Specified by:
supportsService
in interfacecom.sun.star.lang.XServiceInfo
-
getImplementationName
- Specified by:
getImplementationName
in interfacecom.sun.star.lang.XServiceInfo
-
getSupportedServiceNames
- Specified by:
getSupportedServiceNames
in interfacecom.sun.star.lang.XServiceInfo
-
setTitle
- Specified by:
setTitle
in interfacecom.sun.star.ui.dialogs.XExecutableDialog
-
execute
public short execute()- Specified by:
execute
in interfacecom.sun.star.ui.dialogs.XExecutableDialog
-
callHandlerMethod
- Specified by:
callHandlerMethod
in interfacecom.sun.star.awt.XDialogEventHandler
-
getSupportedMethodNames
- Specified by:
getSupportedMethodNames
in interfacecom.sun.star.awt.XDialogEventHandler
-
setControlEnabled
-
getCheckBoxState
-
getCheckBoxStateAsBoolean
-
setCheckBoxState
-
setCheckBoxStateAsBoolean
-
getListBoxStringItemList
-
setListBoxStringItemList
-
getListBoxSelectedItem
-
setListBoxSelectedItem
-
getListBoxLineCount
-
setListBoxLineCount
-
getComboBoxText
-
setComboBoxText
-
getTextFieldText
-
setTextFieldText
-
getFormattedFieldText
-
setFormattedFieldText
-
getNumericFieldValue
-
setNumericFieldValue
-