Implement #8 Allow number boxes wider

http://hg.idempiere.com/idempiere/issue/8
This commit is contained in:
Carlos Ruiz 2011-05-04 22:43:28 -05:00
parent 977877d962
commit fa77d740ae
1 changed files with 8 additions and 1 deletions

View File

@ -49,7 +49,8 @@ public class WNumberEditor extends WEditor implements ContextMenuListener
{
public static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK};
public static final int MAX_DISPLAY_LENGTH = 20;
public static final int MAX_DISPLAY_LENGTH = 35;
public static final int MIN_DISPLAY_LENGTH = 11;
private Object oldValue;
@ -109,6 +110,12 @@ public class WNumberEditor extends WEditor implements ContextMenuListener
if (gridField != null)
{
getComponent().setTooltiptext(gridField.getDescription());
int displayLength = gridField.getDisplayLength();
if (displayLength > MAX_DISPLAY_LENGTH)
displayLength = MAX_DISPLAY_LENGTH;
else if (displayLength <= 0 || displayLength < MIN_DISPLAY_LENGTH)
displayLength = MIN_DISPLAY_LENGTH;
getComponent().getDecimalbox().setCols(displayLength);
}
if (!DisplayType.isNumeric(displayType))