BrightSide Workbench Full Report + Source Code
org.turro.zkoss.input.Multilinebox Class Reference
Inheritance diagram for org.turro.zkoss.input.Multilinebox:
Collaboration diagram for org.turro.zkoss.input.Multilinebox:

Public Member Functions

 Multilinebox (String value, int scale) throws WrongValueException
 
 Multilinebox ()
 
void setValue (String value) throws WrongValueException
 
String getValue () throws WrongValueException
 
void afterCompose ()
 
void onEvent (Event event) throws Exception
 

Static Public Member Functions

static String formatValue (String value)
 

Detailed Description

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

Definition at line 40 of file Multilinebox.java.

Constructor & Destructor Documentation

◆ Multilinebox() [1/2]

org.turro.zkoss.input.Multilinebox.Multilinebox ( String  value,
int  scale 
) throws WrongValueException

Definition at line 44 of file Multilinebox.java.

44  {
45  super(value);
46  this.scale = scale;
47  }

◆ Multilinebox() [2/2]

org.turro.zkoss.input.Multilinebox.Multilinebox ( )

Definition at line 49 of file Multilinebox.java.

49  {
50  }

Member Function Documentation

◆ afterCompose()

void org.turro.zkoss.input.Multilinebox.afterCompose ( )

Definition at line 72 of file Multilinebox.java.

72  {
73  addEventListener(Events.ON_CLICK, this);
74  }

◆ formatValue()

static String org.turro.zkoss.input.Multilinebox.formatValue ( String  value)
static

Definition at line 67 of file Multilinebox.java.

67  {
68  return value == null ? null : ((String) value).replaceAll("\\n", Chars.nl().toString());
69  }
Here is the caller graph for this function:

◆ getValue()

String org.turro.zkoss.input.Multilinebox.getValue ( ) throws WrongValueException

Definition at line 62 of file Multilinebox.java.

62  {
63  String tmp = super.getValue();
64  return tmp == null ? null : tmp.replaceAll(Chars.nl().regexp().toString(), "\n");
65  }
Here is the caller graph for this function:

◆ onEvent()

void org.turro.zkoss.input.Multilinebox.onEvent ( Event  event) throws Exception

Definition at line 77 of file Multilinebox.java.

77  {
78  if(isReadonly()) {
79  Collection c = Listeners.cancelListener(this, Events.ON_BLUR);
80  Messages.info(I_.get("Reference")).add(this.getValue()).show();
81  Listeners.activateListeners(this, Events.ON_BLUR, c);
82  } else {
83  final Collection c = Listeners.cancelListener(this, Events.ON_BLUR);
84  InputDialog.getInput(getPage(), I_.get("Reference"), "Description",
85  this.getValue(), null, scale, new Command() {
86  @Override
87  public Object execute(Context context) {
88  String value = (String) context.get("value");
89  if(value != null) {
90  Multilinebox.this.setValue(value);
91  }
92  return null;
93  }
94  }, new Command() {
95  @Override
96  public Object execute(Context context) {
97  Listeners.activateListeners(Multilinebox.this, Events.ON_BLUR, c);
98  return null;
99  }
100  });
101  }
102  }
Here is the call graph for this function:

◆ setValue()

void org.turro.zkoss.input.Multilinebox.setValue ( String  value) throws WrongValueException

Definition at line 53 of file Multilinebox.java.

53  {
54  if(value != null && value.contains("\n")) {
55  super.setValue(formatValue(value));
56  } else {
57  super.setValue(value);
58  }
59  }
static String formatValue(String value)
Here is the call graph for this function:
Here is the caller graph for this function:

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