/** * @param sizeUnit * @return */ public static Unit getUnit(String sizeUnit) { Unit unit; if (!StringUtils.isEmpty(sizeUnit)) { unit = Unit.valueOf(sizeUnit); } else { unit = Unit.PX; } return unit; }
@Override protected DockLayoutPanel instanciate( Class<? extends DockLayoutPanel> clazz, Map<String, Object> attributes, Object owner) { if (clazz == DockLayoutPanel.class) { String unit = (String) attributes.get("unit"); Unit styleUnit = unit != null ? Unit.valueOf(unit) : Unit.PX; return new DockLayoutPanel(styleUnit); } // use default instanciation system return super.instanciate(clazz, attributes, owner); }