mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 19:57:36 +08:00
col/rows support for TextField and TextArea
This commit is contained in:
parent
1290288900
commit
0ab90b69fa
@ -10,4 +10,9 @@
|
||||
package com.haulmont.cuba.gui.components;
|
||||
|
||||
public interface TextArea extends Field {
|
||||
int getRows();
|
||||
void setRows(int rows);
|
||||
|
||||
int getColumns();
|
||||
void setColumns(int columns);
|
||||
}
|
||||
|
@ -10,4 +10,9 @@
|
||||
package com.haulmont.cuba.gui.components;
|
||||
|
||||
public interface TextField extends Field {
|
||||
int getRows();
|
||||
void setRows(int rows);
|
||||
|
||||
int getColumns();
|
||||
void setColumns(int columns);
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ public class LayoutLoaderConfig {
|
||||
config.registerLoader("groupBox", GroupBoxLoader.class);
|
||||
config.registerLoader("checkBox", AbstractFieldLoader.class);
|
||||
config.registerLoader("label", LabelLoader.class);
|
||||
config.registerLoader("textField", AbstractFieldLoader.class);
|
||||
config.registerLoader("textArea", AbstractFieldLoader.class);
|
||||
config.registerLoader("textField", TextFieldLoader.class);
|
||||
config.registerLoader("textArea", TextAreaLoader.class);
|
||||
config.registerLoader("dateField", AbstractFieldLoader.class);
|
||||
config.registerLoader("lookupField", LookupFieldLoader.class);
|
||||
config.registerLoader("table", TableLoader.class);
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
|
||||
* Haulmont Technology proprietary and confidential.
|
||||
* Use is subject to license terms.
|
||||
|
||||
* Author: Dmitry Abramov
|
||||
* Created: 05.03.2009 11:13:20
|
||||
* $Id$
|
||||
*/
|
||||
package com.haulmont.cuba.gui.xml.layout.loaders;
|
||||
|
||||
import com.haulmont.cuba.gui.components.Component;
|
||||
import com.haulmont.cuba.gui.components.TextArea;
|
||||
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
|
||||
import com.haulmont.cuba.gui.xml.layout.LayoutLoaderConfig;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dom4j.Element;
|
||||
|
||||
public class TextAreaLoader extends AbstractFieldLoader {
|
||||
public TextAreaLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
|
||||
super(context, config, factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component loadComponent(ComponentsFactory factory, Element element) throws InstantiationException, IllegalAccessException {
|
||||
final TextArea component = (TextArea) super.loadComponent(factory, element);
|
||||
|
||||
final String cols = element.attributeValue("cols");
|
||||
final String rows = element.attributeValue("rows");
|
||||
|
||||
if (!StringUtils.isEmpty(cols)) {
|
||||
component.setColumns(Integer.valueOf(cols));
|
||||
}
|
||||
if (!StringUtils.isEmpty(rows)) {
|
||||
component.setRows(Integer.valueOf(rows));
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
|
||||
* Haulmont Technology proprietary and confidential.
|
||||
* Use is subject to license terms.
|
||||
|
||||
* Author: Dmitry Abramov
|
||||
* Created: 05.03.2009 11:13:20
|
||||
* $Id$
|
||||
*/
|
||||
package com.haulmont.cuba.gui.xml.layout.loaders;
|
||||
|
||||
import com.haulmont.cuba.gui.xml.layout.*;
|
||||
import com.haulmont.cuba.gui.components.Component;
|
||||
import com.haulmont.cuba.gui.components.TextField;
|
||||
import org.dom4j.Element;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
public class TextFieldLoader extends AbstractFieldLoader {
|
||||
public TextFieldLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
|
||||
super(context, config, factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component loadComponent(ComponentsFactory factory, Element element) throws InstantiationException, IllegalAccessException {
|
||||
final TextField component = (TextField) super.loadComponent(factory, element);
|
||||
|
||||
final String cols = element.attributeValue("cols");
|
||||
final String rows = element.attributeValue("rows");
|
||||
|
||||
if (!StringUtils.isEmpty(cols)) {
|
||||
component.setColumns(Integer.valueOf(cols));
|
||||
}
|
||||
if (!StringUtils.isEmpty(rows)) {
|
||||
component.setRows(Integer.valueOf(rows));
|
||||
}
|
||||
|
||||
return component;
|
||||
}
|
||||
}
|
@ -23,4 +23,20 @@ public class TextArea
|
||||
component.setImmediate(true);
|
||||
component.setNullRepresentation("");
|
||||
}
|
||||
|
||||
public int getRows() {
|
||||
return component.getRows();
|
||||
}
|
||||
|
||||
public void setRows(int rows) {
|
||||
component.setRows(rows);
|
||||
}
|
||||
|
||||
public int getColumns() {
|
||||
return component.getColumns();
|
||||
}
|
||||
|
||||
public void setColumns(int columns) {
|
||||
component.setColumns(columns);
|
||||
}
|
||||
}
|
@ -22,4 +22,20 @@ public class TextField
|
||||
component.setImmediate(true);
|
||||
component.setNullRepresentation("");
|
||||
}
|
||||
|
||||
public int getRows() {
|
||||
return component.getRows();
|
||||
}
|
||||
|
||||
public void setRows(int rows) {
|
||||
component.setRows(rows);
|
||||
}
|
||||
|
||||
public int getColumns() {
|
||||
return component.getColumns();
|
||||
}
|
||||
|
||||
public void setColumns(int columns) {
|
||||
component.setColumns(columns);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user