private Element headerText;
+ private boolean readonly;
+
public IWindow() {
super();
final int order = windowOrder.size();
setResizable(!resizable);
}
+ if (isReadOnly() != uidl.getBooleanAttribute("readonly")) {
+ setReadOnly(!isReadOnly());
+ }
+
// Initialize the position form UIDL
try {
final int positionx = uidl.getIntVariable("positionx");
}
+ private void setReadOnly(boolean readonly) {
+ this.readonly = readonly;
+ if (readonly) {
+ DOM.setStyleAttribute(closeBox, "display", "none");
+ } else {
+ DOM.setStyleAttribute(closeBox, "display", "");
+ }
+ }
+
+ private boolean isReadOnly() {
+ return readonly;
+ }
+
@Override
public void show() {
if (modal) {
setPositionY(y < 0 ? -1 : y);
}
- // Closing
- final Boolean close = (Boolean) variables.get("close");
- if (close != null && close.booleanValue()) {
- close();
+ if (!isReadOnly()) {
+ // Closing
+ final Boolean close = (Boolean) variables.get("close");
+ if (close != null && close.booleanValue()) {
+ close();
+ }
}
}