Fix resizable for TextArea #PL-2564

This commit is contained in:
Yuriy Artamonov 2013-09-16 16:55:50 +00:00
parent a7c373e663
commit 805a6e66d7
2 changed files with 13 additions and 1 deletions

View File

@ -13,8 +13,9 @@ public interface ResizableTextArea extends TextArea {
String NAME = TextArea.NAME;
boolean isResizable();
/** Note: TextArea with fixed rows or cols can not be resizable */
void setResizable(boolean resizable);
boolean isResizable();
public void addResizeListener(ResizeListener resizeListener);
public void removeResizeListener(ResizeListener resizeListener);

View File

@ -41,6 +41,17 @@ public class CubaResizableTextArea extends CubaTextArea {
getState().resizable = resizable;
}
@Override
public void beforeClientResponse(boolean initial) {
super.beforeClientResponse(initial);
if (getState(false).rows > 0 && getState(false).columns > 0) {
// TextArea with fixed rows or cols can not be resizable
getState().resizable = false;
}
}
public void addResizeListener(ResizeListener resizeListener) {
if (!listeners.contains(resizeListener))
listeners.add(resizeListener);