ooodev.adapter.awt.text_component_partial module

class ooodev.adapter.awt.text_component_partial.TextComponentPartial(component, interface=com.sun.star.awt.XTextComponent)[source]

Bases: object

Partial class for XTextComponent.

Parameters:
  • component (XTextComponent) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.awt.XTextComponent)[source]

Constructor

Parameters:
  • component (XTextComponent) – UNO Component that implements com.sun.star.awt.XTextComponent interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XTextComponent.

Return type:

None

add_text_listener(listener)[source]

Registers a text event listener.

Return type:

None

Parameters:

listener (com.sun.star.awt.XTextListener) –

get_max_text_len()[source]

Gets the currently set maximum text length.

Return type:

int

get_selected_text()[source]

Gets the currently selected text.

Return type:

str

get_selection()[source]

Gets the current user selection.

Return type:

Selection

get_text()[source]

Gets the text of the component.

Return type:

str

insert_text(sel, text)[source]

Inserts text at the specified position.

Return type:

None

Parameters:
  • sel (com.sun.star.awt.Selection) –

  • text (str) –

Hint

Selection can be imported from ooo.dyn.awt.selection.

is_editable()[source]

Gets if the text is editable by the user.

Return type:

bool

remove_text_listener(listener)[source]

Un-registers a text event listener.

Return type:

None

Parameters:

listener (com.sun.star.awt.XTextListener) –

set_editable(editable)[source]

Makes the text editable for the user or read-only.

Return type:

None

Parameters:

editable (bool) –

set_max_text_len(length)[source]

Sets the maximum text length.

Return type:

None

Parameters:

length (int) –

set_selection(selection)[source]

Sets the user selection.

Return type:

None

Parameters:

selection (com.sun.star.awt.Selection) –

Hint

Selection can be imported from ooo.dyn.awt.selection.

set_text(text)[source]

Sets the text of the component.

Return type:

None

Parameters:

text (str) –