org.eggframework2.view.elements.xhtml.tags
Class AttributableXhtmlElement

java.lang.Object
  extended by org.eggframework2.view.elements.Element
      extended by org.eggframework2.view.elements.xhtml.XhtmlElement
          extended by org.eggframework2.view.elements.xhtml.tags.AttributableXhtmlElement
All Implemented Interfaces:
Attributable, IElement, Eventable, IXhtmlElement, Styleable
Direct Known Subclasses:
Area, Base, Col, Frame, Hr, Img, Input, Link, Meta, Param, SimpleXhtmlElement

public abstract class AttributableXhtmlElement
extends XhtmlElement
implements Styleable, Eventable

[PL] Rozszerza klasę XhtmlElement o implementację metod z interfejsu Attributable, Styleable oraz Eventable. Metody te tak naprawdę delegują wykonanie do implementacji AttributableImpl, StylableImpl oraz EventableImpl

Author:
Jacek Olszak

Constructor Summary
AttributableXhtmlElement(java.lang.String tagName)
           
 
Method Summary
 void addEventAttribute(EventType event, boolean onTheEnd, JavascriptCode code)
          [PL] Dodaje kod JavaScript do atrybutu zdarzenia w podanym miejscu.
 void addEventAttribute(EventType event, boolean onTheEnd, java.lang.String javascript)
          [PL] Dodaje kod JavaScript do atrybutu zdarzenia w podanym miejscu.
 void addEventAttribute(EventType event, JavascriptCode code)
          [PL] Dodaje kod JavaScript na końcu atrybutu zdarzenia (za średnikiem).
 void addEventAttribute(EventType event, java.lang.String javascript)
          [PL] Dodaje kod JavaScript na końcu atrybutu zdarzenia (za średnikiem).
 java.lang.String getAttribute(java.lang.String name)
          [PL] Zwraca wartość atrybutu o podanej nazwie
 java.util.Set<java.lang.String> getAttributeNames()
          [PL] Zwraca niemodyfikowalny zbiór nazw atrybutów (dodanie nowych/usunięcie istniejących nazw nie jest możliwe).
 java.lang.String getId()
          [PL] Zwraca wartość atrybutu ID.
 java.lang.String getStyleProperty(java.lang.String name)
          [PL] Zwraca wartość wskazanej właściwości w atrybucie "style"
 boolean isVisible()
          [PL] Zwraca typ logiczny określający czy element jest widoczny na ekranie, tzn.
 Attributable setAttribute(java.lang.String name, java.lang.String value)
          [PL] Dodaje nowy lub aktualizuje istniejący atrybut
 void setId(java.lang.String value)
          [PL] Ustawia atrybut ID.
 Styleable setStyleProperty(java.lang.String name, java.lang.String value)
          [PL] Ustawia właściwość w atrybucie "style" elementu.
 Styleable setVisible(boolean visible)
          [PL] Ustawia właściwość o nazwie "visibility" atrybutu "style".
 
Methods inherited from class org.eggframework2.view.elements.xhtml.XhtmlElement
getTagName
 
Methods inherited from class org.eggframework2.view.elements.Element
marshal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eggframework2.view.elements.IElement
marshal
 
Methods inherited from interface org.eggframework2.view.elements.IElement
marshal
 

Constructor Detail

AttributableXhtmlElement

public AttributableXhtmlElement(java.lang.String tagName)
Method Detail

getAttribute

public java.lang.String getAttribute(java.lang.String name)
                              throws java.lang.IllegalArgumentException
Description copied from interface: Attributable
[PL] Zwraca wartość atrybutu o podanej nazwie

Specified by:
getAttribute in interface Attributable
Throws:
java.lang.IllegalArgumentException - Gdy name jest null

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Description copied from interface: Attributable
[PL] Zwraca niemodyfikowalny zbiór nazw atrybutów (dodanie nowych/usunięcie istniejących nazw nie jest możliwe). Natomiast dodawanie/usuwanie kolejnych atrybutów do elementu automatycznie modyfikuje ten zbiór.

Specified by:
getAttributeNames in interface Attributable

setAttribute

public Attributable setAttribute(java.lang.String name,
                                 java.lang.String value)
                          throws java.lang.IllegalArgumentException
Description copied from interface: Attributable
[PL] Dodaje nowy lub aktualizuje istniejący atrybut

Specified by:
setAttribute in interface Attributable
Parameters:
name - [PL] Nazwa atrybutu.
value - [PL] Wartość atrybutu. Automatycznie konwertuje znaki specjalne (&, >, <, ") do encji Xhtml. Jeśli null to usuwa atrybut.
Returns:
[PL] Instancję elementu, na którym została wywołana ta metoda
Throws:
java.lang.IllegalArgumentException - [PL] Gdy nazwa jest null lub gdy nazwa atrybutu jest równa "id" i wartośc jest pustym łańcuchem tekstowym "".

setId

public void setId(java.lang.String value)
[PL] Ustawia atrybut ID. Skrót do wywołania metody setAttribute("id",id).

Parameters:
value - [PL] Wartość atrybutu ID
See Also:
Attributable.setAttribute(String, String)

getId

public java.lang.String getId()
[PL] Zwraca wartość atrybutu ID. Skrót do wywołania metody getAttribute("id").

Returns:
[PL] Wartość atrybutu ID
See Also:
Attributable.getAttribute(String)

getStyleProperty

public java.lang.String getStyleProperty(java.lang.String name)
                                  throws java.lang.IllegalArgumentException
Description copied from interface: Styleable
[PL] Zwraca wartość wskazanej właściwości w atrybucie "style"

Specified by:
getStyleProperty in interface Styleable
Parameters:
name - [PL] Nazwa właściwości np. color, z-index
Returns:
[PL] Wartość właściwości
Throws:
java.lang.IllegalArgumentException - [PL] Gdy nazwa właściwości jest null lub pustym stringiem.
See Also:
Styleable.setStyleProperty(String, String)

isVisible

public boolean isVisible()
Description copied from interface: Styleable
[PL] Zwraca typ logiczny określający czy element jest widoczny na ekranie, tzn. czy posiada odpowiednio ustawioną właściwość "visibility" atrybutu "style". Domyślnie jeśli atrybut nie posiada tej właściwości to jest widoczny.

Specified by:
isVisible in interface Styleable
Returns:
[PL] False jeśli wartość właściwości "visibility" atrybutu "style" jest równa "hidden". True w przeciwnym wypadku
See Also:
Styleable.setStyleProperty(String, String)

setStyleProperty

public Styleable setStyleProperty(java.lang.String name,
                                  java.lang.String value)
                           throws java.lang.IllegalArgumentException
Description copied from interface: Styleable
[PL] Ustawia właściwość w atrybucie "style" elementu. Jeśli atrybut "style" nie istniał w elemencie to jest tworzony, wypełniany i dodawany do elementu. Jeśli istniał to najpierw jego zawartość jest wczytywana i w momencie gdy przekazana właściwość juz istniała to jest zastępowana nową. Przykład elementu z atrybutem style:

<div style="color: black; border:black solid thin">

W powyższym elemenencie mamy 2 właściwości: color i border. Pierwsza z nich ma wartość "black", a druga "black solid thin". W momencie gdy uruchomimy tą metodę przekazując jako name "color", a jako value "red" to istniejąca właściwość zostanie nadpisana:

<div style="color: red; border:black solid thin">

Specified by:
setStyleProperty in interface Styleable
Parameters:
name - [PL] nazwa właściwości np. color, z-index
value - [PL] wartość właściwości wstawiona po dwukropku ":". Jeśli null to usuwa właściwość
Returns:
[PL] Instancję elementu, na którym została wywołana ta metoda
Throws:
java.lang.IllegalArgumentException - [PL] Gdy nazwa właściwości jest null lub pustym stringiem.

setVisible

public Styleable setVisible(boolean visible)
Description copied from interface: Styleable
[PL] Ustawia właściwość o nazwie "visibility" atrybutu "style".

Specified by:
setVisible in interface Styleable
Parameters:
visible - [PL] Jeśli true to wstawia wartość "show". Jeśli false to wstawia wartość "hidden".
Returns:
[PL] Instancję elementu, na którym została wywołana ta metoda
See Also:
Styleable.setStyleProperty(String, String)

addEventAttribute

public void addEventAttribute(EventType event,
                              boolean onTheEnd,
                              java.lang.String javascript)
                       throws java.lang.IllegalArgumentException
Description copied from interface: Eventable
[PL] Dodaje kod JavaScript do atrybutu zdarzenia w podanym miejscu.

Specified by:
addEventAttribute in interface Eventable
Parameters:
event - [PL] Typ zdarzenia
onTheEnd - [PL] Jeśli true to kod zostanie wstawiony na końcu, za średnikiem
javascript - [PL] Kod JavaScript
Throws:
java.lang.IllegalArgumentException

addEventAttribute

public void addEventAttribute(EventType event,
                              boolean onTheEnd,
                              JavascriptCode code)
                       throws java.lang.IllegalArgumentException
Description copied from interface: Eventable
[PL] Dodaje kod JavaScript do atrybutu zdarzenia w podanym miejscu.

Specified by:
addEventAttribute in interface Eventable
Parameters:
event - [PL] Typ zdarzenia
onTheEnd - [PL] Jeśli true to kod zostanie wstawiony na końcu, za średnikiem
code - [PL] Kod JavaScript
Throws:
java.lang.IllegalArgumentException

addEventAttribute

public void addEventAttribute(EventType event,
                              java.lang.String javascript)
                       throws java.lang.IllegalArgumentException
Description copied from interface: Eventable
[PL] Dodaje kod JavaScript na końcu atrybutu zdarzenia (za średnikiem).

Specified by:
addEventAttribute in interface Eventable
Parameters:
event - [PL] Typ zdarzenia średnikiem
javascript - [PL] Kod JavaScript
Throws:
java.lang.IllegalArgumentException

addEventAttribute

public void addEventAttribute(EventType event,
                              JavascriptCode code)
                       throws java.lang.IllegalArgumentException
Description copied from interface: Eventable
[PL] Dodaje kod JavaScript na końcu atrybutu zdarzenia (za średnikiem).

Specified by:
addEventAttribute in interface Eventable
Parameters:
event - [PL] Typ zdarzenia średnikiem
code - [PL] Kod JavaScript
Throws:
java.lang.IllegalArgumentException


Copyright © 2010. All Rights Reserved.