29 lines
703 B
Java
29 lines
703 B
Java
package org.gcube.portlets.user.shareupdates.client.elements;
|
|
|
|
import com.google.gwt.user.client.DOM;
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
import com.google.gwt.user.client.ui.HasText;
|
|
|
|
/**
|
|
*
|
|
* @author Massimiliano Assante, ISTI-CNR
|
|
*
|
|
*/
|
|
public class Div extends HTML implements HasText {
|
|
|
|
public Div() {
|
|
super(DOM.createElement("div"));
|
|
//important to make it act like a textarea
|
|
DOM.setElementAttribute(getElement(), "contentEditable", "true");
|
|
}
|
|
|
|
public Div(String text) {
|
|
this();
|
|
setText(text);
|
|
}
|
|
|
|
public void setEnabled(boolean enabled) {
|
|
DOM.setElementPropertyBoolean(getElement(), "disabled", !enabled);
|
|
}
|
|
}
|