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

Public Member Functions

 HTMLComponent (IElement iel) throws IOException
 
 HTMLComponent (IElement iel, boolean toString) throws IOException
 
void writeDate (Date date, String mode)
 
void writeNumber (Number number, String mode)
 
void writeBytes (long bytes)
 
void writeBoolean (boolean value)
 
void configureInPlaceEditor (IElement element, String ident, String component, String action, String params, int rows)
 
void configureFeditor (IElement element, String ident, String component, String action, String params, int rows)
 
String toString ()
 
void startElement (int mode)
 
void endElement (int mode)
 
void writeElement (int mode)
 
String strElement (int mode)
 
void setEditable (boolean editable)
 
- Public Member Functions inherited from org.turro.html.HTMLHelper
 HTMLHelper (IConstructor constructor, Writer out)
 
 HTMLHelper (IConstructor constructor)
 
 HTMLHelper (Writer out)
 
HTMLGenerator write (String value)
 
void writeMacro (String value)
 
void writeln (String value)
 
- Public Member Functions inherited from org.turro.html.HTMLGenerator
 HTMLGenerator ()
 
 HTMLGenerator (Writer out)
 
void setOut (Writer out)
 
void setExtraAttributes (String extraAttributes)
 
HTMLGenerator doTag (String tag)
 
HTMLGenerator doTag (String tag, String attributes)
 
HTMLGenerator doTag (String tag, String[] attributes)
 
HTMLGenerator startTag (String tag)
 
HTMLGenerator startTag (String tag, String attributes)
 
HTMLGenerator startTag (String tag, String[] attributes)
 
HTMLGenerator startExtAnchor (String url, String hint)
 
HTMLGenerator startTargetAnchor (String url, String target, String hint)
 
HTMLGenerator startAnchor (String url, String hint)
 
HTMLGenerator startAnchor (String url, String hint, String cssClass)
 
HTMLGenerator startAnchor (String url, String hint, String cssClass, String onClick)
 
HTMLGenerator startTable (String attributes)
 
HTMLGenerator startTable (String[] attributes)
 
HTMLGenerator endTable ()
 
HTMLGenerator startTableRow (String attributes)
 
HTMLGenerator startTableRow (String[] attributes)
 
HTMLGenerator endTableRow ()
 
HTMLGenerator startTableCol (String attributes)
 
HTMLGenerator startTableCol (String[] attributes)
 
HTMLGenerator endTableCol ()
 
HTMLGenerator endTag ()
 
HTMLGenerator endTag (String tag)
 
HTMLGenerator endBeforeTag (String tag)
 
HTMLGenerator endAllTags ()
 
boolean checkTag (String tag)
 
HTMLGenerator writeNewLine ()
 
HTMLGenerator writeSeparator ()
 
HTMLGenerator writeHorizontalStrut (int pixels)
 
HTMLGenerator startJavaScript ()
 
HTMLGenerator endJavaScript ()
 
HTMLGenerator startCSS ()
 
HTMLGenerator endCSS ()
 
HTMLGenerator addCSSLink (String cssFile)
 
HTMLGenerator addJavaScriptLink (String jsFile)
 
- Public Member Functions inherited from org.turro.html.IHTMLRenderable
void setOut (Writer out)
 

Protected Attributes

IElement iel
 
boolean editable = false
 
StringWriter sw = null
 
- Protected Attributes inherited from org.turro.html.HTMLHelper
IConstructor constructor = null
 
- Protected Attributes inherited from org.turro.html.HTMLGenerator
Stack tags = new Stack()
 
Writer out = null
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.html.IHTMLRenderable
static final int MODE_FULL = 0
 
static final int MODE_MEDIUM = 1
 
static final int MODE_SMALL = 2
 

Detailed Description

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

Definition at line 33 of file HTMLComponent.java.

Constructor & Destructor Documentation

◆ HTMLComponent() [1/2]

org.turro.html.HTMLComponent.HTMLComponent ( IElement  iel) throws IOException

Creates a new instance of HTMLComponent

Definition at line 39 of file HTMLComponent.java.

39  {
40  this(iel, false);
41  }

◆ HTMLComponent() [2/2]

org.turro.html.HTMLComponent.HTMLComponent ( IElement  iel,
boolean  toString 
) throws IOException

Creates a new instance of HTMLComponent

Definition at line 44 of file HTMLComponent.java.

44  {
45  super(iel.getConstructor());
46  this.iel = iel;
47  if(toString) {
48  sw = new StringWriter();
49  setOut(new PrintWriter(sw));
50  }
51  else {
53  }
54  }
Here is the call graph for this function:

Member Function Documentation

◆ configureFeditor()

void org.turro.html.HTMLComponent.configureFeditor ( IElement  element,
String  ident,
String  component,
String  action,
String  params,
int  rows 
)

Definition at line 97 of file HTMLComponent.java.

97  {
99  write(
100  "$('" + ident + "').onclick = function() { openFeditor(this); }"
101  );
102  endJavaScript();
103  }
HTMLGenerator write(String value)
Definition: HTMLHelper.java:69
Here is the call graph for this function:

◆ configureInPlaceEditor()

void org.turro.html.HTMLComponent.configureInPlaceEditor ( IElement  element,
String  ident,
String  component,
String  action,
String  params,
int  rows 
)

Definition at line 79 of file HTMLComponent.java.

79  {
81  write(
82  "new Ajax.InPlaceEditor(" +
83  "$('" + ident + "')," +
84  "'" + ElephantContext.getRootWebPath() +
85  "/xpaction/" + component + "?action=" + action + "&context=" + element.getContext().getPath() + "&idel=" + element.getId() + params + "', {" +
86  "okText: '" + I_.get("Save") + "'," +
87  "cancelText: '" + I_.get("Cancel") + "'," +
88  "savingText: '" + I_.get("Saving") + "',"+
89  "clickToEditText: '" + I_.get("Click to edit") + "'," +
90  "rows: " + rows + "," +
91  "ajaxOptions: {method: 'get'}" +
92  "});"
93  );
94  endJavaScript();
95  }
Here is the call graph for this function:

◆ endElement()

void org.turro.html.HTMLComponent.endElement ( int  mode)

Implements org.turro.html.IHTMLRenderable.

Definition at line 119 of file HTMLComponent.java.

119 {}

◆ setEditable()

void org.turro.html.HTMLComponent.setEditable ( boolean  editable)

Implements org.turro.html.IHTMLRenderable.

Definition at line 133 of file HTMLComponent.java.

133  {
134  this.editable = editable;
135  }

◆ startElement()

void org.turro.html.HTMLComponent.startElement ( int  mode)

Implements org.turro.html.IHTMLRenderable.

Definition at line 116 of file HTMLComponent.java.

116 {}

◆ strElement()

String org.turro.html.HTMLComponent.strElement ( int  mode)

Implements org.turro.html.IHTMLRenderable.

Definition at line 125 of file HTMLComponent.java.

125  {
126  StringWriter w = new StringWriter();
127  setOut(new PrintWriter(w));
128  writeElement(mode);
129  return w.toString();
130  }
Here is the call graph for this function:

◆ toString()

String org.turro.html.HTMLComponent.toString ( )

Reimplemented from org.turro.html.HTMLGenerator.

Definition at line 106 of file HTMLComponent.java.

106  {
107  if(sw != null) {
108  return sw.toString();
109  }
110  return null;
111  }
Here is the caller graph for this function:

◆ writeBoolean()

void org.turro.html.HTMLComponent.writeBoolean ( boolean  value)

Reimplemented from org.turro.html.HTMLHelper.

Definition at line 75 of file HTMLComponent.java.

75  {
76  write(I_.compatibility().get("fmt." + (value ? "true" : "false")));
77  }
Here is the call graph for this function:

◆ writeBytes()

void org.turro.html.HTMLComponent.writeBytes ( long  bytes)

Reimplemented from org.turro.html.HTMLHelper.

Definition at line 69 of file HTMLComponent.java.

69  {
70  Localizer localizer = iel.getConstructor().getLocalizer();
71  write(localizer.parseValue("bytes", null, Long.valueOf(bytes)));
72  }
Here is the call graph for this function:

◆ writeDate()

void org.turro.html.HTMLComponent.writeDate ( Date  date,
String  mode 
)

Reimplemented from org.turro.html.HTMLHelper.

Definition at line 57 of file HTMLComponent.java.

57  {
58  Localizer localizer = iel.getConstructor().getLocalizer();
59  write(localizer.parseValue("date", mode, date));
60  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeElement()

void org.turro.html.HTMLComponent.writeElement ( int  mode)

Implements org.turro.html.IHTMLRenderable.

Definition at line 122 of file HTMLComponent.java.

122 {}
Here is the caller graph for this function:

◆ writeNumber()

void org.turro.html.HTMLComponent.writeNumber ( Number  number,
String  mode 
)

Reimplemented from org.turro.html.HTMLHelper.

Definition at line 63 of file HTMLComponent.java.

63  {
64  Localizer localizer = iel.getConstructor().getLocalizer();
65  write(localizer.parseValue("number", mode, number));
66  }
Here is the call graph for this function:

Member Data Documentation

◆ editable

boolean org.turro.html.HTMLComponent.editable = false
protected

Definition at line 35 of file HTMLComponent.java.

◆ iel

IElement org.turro.html.HTMLComponent.iel
protected

Definition at line 34 of file HTMLComponent.java.

◆ sw

StringWriter org.turro.html.HTMLComponent.sw = null
protected

Definition at line 36 of file HTMLComponent.java.


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