BrightSide Workbench Full Report + Source Code
org.turro.action.ActionMenu Class Reference
Inheritance diagram for org.turro.action.ActionMenu:
Collaboration diagram for org.turro.action.ActionMenu:

Public Member Functions

Object getEntity ()
 
void setEntity (Object entity)
 
void addAction (AbstractAction action)
 
void loadItems ()
 
void afterCompose ()
 

Protected Attributes

List< AbstractActionactions = new ArrayList<>()
 
Object entity
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 34 of file ActionMenu.java.

Member Function Documentation

◆ addAction()

void org.turro.action.ActionMenu.addAction ( AbstractAction  action)

Definition at line 47 of file ActionMenu.java.

47  {
48  actions.add(action);
49  }
List< AbstractAction > actions
Definition: ActionMenu.java:36

◆ afterCompose()

void org.turro.action.ActionMenu.afterCompose ( )

Definition at line 70 of file ActionMenu.java.

70  {
71  loadItems();
72  }
Here is the call graph for this function:

◆ getEntity()

Object org.turro.action.ActionMenu.getEntity ( )

Definition at line 39 of file ActionMenu.java.

39  {
40  return entity;
41  }

◆ loadItems()

void org.turro.action.ActionMenu.loadItems ( )

Definition at line 51 of file ActionMenu.java.

51  {
52  getChildren().clear();
53  for(final AbstractAction aa : actions) {
54  Menuitem mi = new Menuitem();
55  mi.setLabel(aa.getLabel());
56  mi.setImage(aa.getImage());
57  mi.addEventListener(Events.ON_CLICK, new EventListener() {
58  @Override
59  public void onEvent(Event event) throws Exception {
60  Context ctx = new Context();
61  ctx.put("entity", entity);
62  aa.execute(ctx);
63  }
64  });
65  appendChild(mi);
66  }
67  }
Here is the caller graph for this function:

◆ setEntity()

void org.turro.action.ActionMenu.setEntity ( Object  entity)

Definition at line 43 of file ActionMenu.java.

43  {
44  this.entity = entity;
45  }
Here is the caller graph for this function:

Member Data Documentation

◆ actions

List<AbstractAction> org.turro.action.ActionMenu.actions = new ArrayList<>()
protected

Definition at line 36 of file ActionMenu.java.

◆ entity

Object org.turro.action.ActionMenu.entity
protected

Definition at line 37 of file ActionMenu.java.


The documentation for this class was generated from the following file: