Package elisa :: Package plugins :: Package poblesec :: Package base :: Module list :: Class BaseListController

Class BaseListController

source code


Base list controller with a common API for all list-like controllers.

Nested Classes
DOCME view_mode
DOCME
Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
twisted.internet.defer.Deferred
initialize(self)
Initialize the component.
source code
twisted.internet.defer.Deferred
clean(self)
Clean the component.
source code
elisa.core.utils.defer.Deferred
reload(self)
Reload the model as it is done at initialization time.
source code
elisa.core.utils.defer.Deferred
populate_model(self)
Initial population of the data model (self.model).
source code
(elisa.core.action.ContextualAction, list of elisa.core.action.ContextualAction)
create_actions(self)
Create the default action and the contextual actions associated to the type of item the controller will be presenting.
source code
None or elisa.core.utils.defer.Deferred
set_frontend(self, frontend)
Set the frontend for the controller.
source code
 
ready(self)
Called after frontend finished creation of the controller and all decorators are loaded.
source code
 
nodes_setup(self)
Create the list widget.
source code
 
fastscroller_setup(self)
Create fastscroller.
source code
 
layout_components(self)
Layout fastscroller and nodes.
source code
 
get_shortcut_for_item(self, item)
Returns: a shortcut for the item, or None
source code
 
shortcut_renderer(self, shortcut, widget)
DOCME
source code
elisa.core.utils.defer.Deferred
item_activated(self, item)
Callback invoked when an item is activated.
source code
 
node_clicked(self, widget, item)
[DEPRECATED] Callback invoked when an item of the list representing a given level of the hierarchy is clicked.
source code
 
stop_loading_animation(self)
[DEPRECATED] This method can be safely removed once the transition from using node_clicked to implementing item_activated is complete.
source code
 
sensitive_set(self, value) source code
 
sensitive_get(self) source code
 
display_empty_alert(self, label)
Display an alert widget to inform that the model is empty.
source code
 
hide_empty_alert(self)
Hide the alert widget that informs that the model is empty.
source code
 
node_renderer(self, item, widget)
Render an item in a list widget.
source code
 
node_selected(self, widget, item, previous_item)
Callback invoked when an item is selected.
source code
bool
handle_input(self, manager, event)
Specialisation that allows for key presses to the letter keys to trigger a fast-scroll to the first label with a first letter equal to the pressed letter.
source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from hierarchy.HierarchyController
 
cancel_all_deferreds(self)
Cancel all the currently pending deferred calls.
source code
 
cancel_deferreds(self, key)
Cancel all the currently pending deferred calls associated to one given key in the internal dictionary.
source code
 
register_deferred(self, key, deferred)
Register a deferred call to be associated to a given key.
source code
    Inherited from pigment.pigment_controller.PigmentController
 
has_focus(self) source code
 
prepare(self)
Called after widget is added to the canvas.
source code
 
removed(self)
Called after widget is removed from the canvas.
source code
 
set_path(self, path)
Set the path for the controller.
source code
    Inherited from core.component.Component
 
name__get(self) source code
 
name__set(self, value) source code
Class Methods
    Inherited from core.component.Component
elisa.core.component.Component or a subclass
create(cls, config_section=None, **kwargs)
Create and initialize the component.
source code
Class Variables
bool fastscroller_enabled = False
whether to show a fastscroller (False by default)
int fastscroller_threshold = 20
DOCME
str empty_label = None
text shown when there no models are to be displayed
bool sensitive = property(fget= sensitive_get, fset= sensitive_set)
whether this controller should react on click events

Inherited from extern.log.log.Loggable: logCategory

    Inherited from pigment.pigment_controller.PigmentController
  __gsignals__ = {'clean':(gobject.SIGNAL_RUN_LAST, gobject.TYPE...
    Inherited from core.component.Component
  config_doc = {}
  default_config = {}
  name = property(fget= name__get, fset= name__set)
Instance Variables
elisa.plugins.pigment.widgets.list.List fastscroller
DOCME
elisa.core.utils.notifying_list.List model
the data model
elisa.plugins.pigment.widgets.list.List nodes
the list widget
elisa.core.utils.notifying_list.List shortcuts
the fastscroller's model
    Inherited from hierarchy.HierarchyController
dict of any immutable type -> list of {elisa.core.utils.defer.Deferred} deferreds
currently pending deferred calls
    Inherited from pigment.pigment_controller.PigmentController
elisa.core.components.frontend.Frontend frontend
frontend that created the controller
str path
path for which that controller was selected
elisa.plugins.pigment.widgets.widget.Widget widget
Pigment widget containing the UI of the controller
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

initialize(self)

source code 

Initialize the component.

This method is called by Component.create to finish the initialization of a component.

Returns: twisted.internet.defer.Deferred
a deferred called when a component is fully initialized
Overrides: core.component.Component.initialize
(inherited documentation)

clean(self)

source code 

Clean the component.

This method is called when a component is not needed anymore to clean its state.

Returns: twisted.internet.defer.Deferred
a deferred called when the component has finished cleaning its state
Overrides: core.component.Component.clean
(inherited documentation)

reload(self)

source code 

Reload the model as it is done at initialization time. Re-build accordingly the shortcuts.

Returns: elisa.core.utils.defer.Deferred
a deferred fired when the reload is complete

populate_model(self)

source code 

Initial population of the data model (self.model).

This method should be overridden by subclasses. The default implementation returns an empty list.

Returns: elisa.core.utils.defer.Deferred
a deferred fired when the population of the model is complete, with the resulting model (of type list)

create_actions(self)

source code 

Create the default action and the contextual actions associated to the type of item the controller will be presenting.

The default implementation does create any action, subclasses should override this method.

Returns: (elisa.core.action.ContextualAction, list of elisa.core.action.ContextualAction)
a 2-tuple containing the default action and a list of contextual actions

set_frontend(self, frontend)

source code 

Set the frontend for the controller.

It can optionally return a deferred.

Parameters:
  • frontend - frontend
Returns: None or elisa.core.utils.defer.Deferred
Overrides: pigment.pigment_controller.PigmentController.set_frontend
(inherited documentation)

ready(self)

source code 

Called after frontend finished creation of the controller and all decorators are loaded.

Overrides: pigment.pigment_controller.PigmentController.ready
(inherited documentation)

nodes_setup(self)

source code 

Create the list widget.

This method should be overridden by subclasses.

fastscroller_setup(self)

source code 

Create fastscroller.

This method should be overridden by subclasses.

layout_components(self)

source code 

Layout fastscroller and nodes.

This method should be overridden by subclasses.

get_shortcut_for_item(self, item)

source code 
Returns:
a shortcut for the item, or None

This method should be overridden by subclasses.

shortcut_renderer(self, shortcut, widget)

source code 

DOCME

This method should be overridden by subclasses.

item_activated(self, item)

source code 

Callback invoked when an item is activated.

The default implementation executes the default action associated with the item.

This method should be overriden by subclasses that do not make use of contextual actions.

Parameters:
Returns: elisa.core.utils.defer.Deferred
a deferred fired when the action taken is complete

node_clicked(self, widget, item)

source code 

[DEPRECATED] Callback invoked when an item of the list representing a given level of the hierarchy is clicked.

Parameters:

Deprecated: implement item_activated instead

display_empty_alert(self, label)

source code 

Display an alert widget to inform that the model is empty.

Parameters:
  • label (unicode) - the text of the alert

node_renderer(self, item, widget)

source code 

Render an item in a list widget.

The default implementation does nothing. Subclasses should override this method to control how items are visually rendered.

Parameters:

node_selected(self, widget, item, previous_item)

source code 

Callback invoked when an item is selected.

The default implementation does nothing. Subclasses should override if an action is to be taken.

Parameters:

handle_input(self, manager, event)

source code 

Specialisation that allows for key presses to the letter keys to trigger a fast-scroll to the first label with a first letter equal to the pressed letter.

Parameters:
  • manager - the input manager that emitted the event
  • event - the input event received
Returns: bool
True is the event was handled, False otherwise
Overrides: pigment.pigment_controller.PigmentController.handle_input