public int compareTo(Object o) { if (!(o instanceof Path)) throw new WrongValueException(o + " is not Path object"); int length = path.length; Path toCompared = (Path) o; int[] toPath = toCompared.path; int toLength = toCompared.path.length; int smaller = (length < toLength ? length : toLength); for (int i = 0; i < smaller; i++) { if (path[i] != toPath[i]) return path[i] - toPath[i]; } return length - toLength; }
value = unmarshall(clientv); } catch (NumberFormatException ex) { throw new WrongValueException(this, MZul.NUMBER_REQUIRED, clientv); Events.postEvent(evt); } catch (WrongValueException ex) { initAuxInfo().errmsg = ex.getMessage(); throw ex; //No need to go through onWrongValue since UiEngine will do it
for (WrongValueException wve : ((WrongValuePropertyImpl) p).getWrongValueExceptions()) { Component wvc = wve.getComponent(); if (wvc != null) { wve = ((ComponentCtrl) wvc).onWrongValue(wve); if (wve != null) { Component c = wve.getComponent(); if (c == null) c = wvc; Clients.wrongValue(c, wve.getMessage());
final Component comp = wve.getComponent(); if (comp != null) { wve = ((ComponentCtrl) comp).onWrongValue(wve); if (wve != null) { Component c = wve.getComponent(); if (c == null) c = comp; final LinkedList<String> infs = new LinkedList<String>(); for (WrongValueException wve1 : wves) { final Component comp = wve1.getComponent(); if (comp != null) { WrongValueException wve = ((ComponentCtrl) comp).onWrongValue(wve1); if (wve != null) { Component c = wve.getComponent(); if (c == null) c = comp;
private WrongValueException wrongValue(Component comp, int errcode) { return _errmsg != null ? new WrongValueException(comp, _errmsg) : new WrongValueException(comp, errcode); }
public void setTag(String tagname) throws WrongValueException { if (tagname == null || tagname.length() == 0) throw new WrongValueException("A tag name is required"); _tagnm = tagname; } }
private WrongValueException outOfRangeValue(Component comp) { final String errmsg = getErrorMessage(comp); if (errmsg != null) return new WrongValueException(comp, errmsg); final String s = _min != null ? _max != null ? _min + " ~ " + _max : ">= " + _min : "<= " + _max; return new WrongValueException(comp, MZul.OUT_OF_RANGE, s); }
private WrongValueException outOfRangeValue(Component comp) { final String errmsg = getErrorMessage(comp); if (errmsg != null) return new WrongValueException(comp, errmsg); final String s = _min != null ? _max != null ? _min + " ~ " + _max : ">= " + _min : "<= " + _max; return new WrongValueException(comp, MZul.OUT_OF_RANGE, s); } }
/** Sets the rows. * <p>Note: if both {@link #setHeight} is specified with non-empty, * {@link #setRows} is ignored */ public void setRows(int rows) throws WrongValueException { if (rows < 0) throw new WrongValueException("Illegal rows: " + rows); if (_rows != rows) { _rows = rows; smartUpdate("rows", _rows); } }
/** * Sets the start position of the scrollbar. * <p> Default: 0 * @param start the column number */ public void setStart(int start) { if (start < 0) throw new WrongValueException("Positive only"); if (_start != start) { _start = start; smartUpdate("start", _start); } }
/** * Sets the number of columns to freeze.(from left to right) * @param columns positive only */ public void setColumns(int columns) { if (columns < 0) throw new WrongValueException("Positive only"); if (_columns != columns) { _columns = columns; smartUpdate("columns", _columns); } }
/** Sets the cols. */ public void setCols(int cols) throws WrongValueException { if (cols <= 0) throw new WrongValueException("Illegal cols: " + cols); if (_cols != cols) { _cols = cols; smartUpdate("cols", _cols); } }
public void setDynamicProperty(String name, Object value) throws WrongValueException { if (name == null) throw new WrongValueException("name required"); if (value == null) { if (_props != null) _props.remove(name); } else { if (_props == null) _props = new LinkedHashMap<String, Object>(); if ("sclass".equals(name)) _props.put("class", value); else _props.put(name, value); } }
/** Sets the number of columns. */ public void setColumns(int columns) throws WrongValueException { if (columns <= 0) throw new WrongValueException("Positive only"); if (_columns != columns) { _columns = columns; invalidate(); } }
/** Sets the item height of {@link Fisheye}. */ public void setItemHeight(int itemhgh) throws WrongValueException { if (itemhgh <= 0) throw new WrongValueException("Positive is required: "+itemhgh); if (_itemhgh != itemhgh) { _itemhgh = itemhgh; smartUpdate("z.itemheight", itemhgh); } }
/** * Sets the number of page list icon when mold is "os" */ public void setPageIncrement(int pginc) throws WrongValueException { if (pginc <= 0) throw new WrongValueException("Nonpositive is not allowed: " + pginc); if (_pginc != pginc) { _pginc = pginc; smartUpdate("pageIncrement", pginc); } }
/** Sets the number of columns to span this header. * <p>It is the same as the colspan attribute of HTML TD tag. */ public void setColspan(int colspan) throws WrongValueException { if (colspan <= 0) throw new WrongValueException("Positive only"); if (_colspan != colspan) { _colspan = colspan; smartUpdate("colspan", _colspan); } }
/** Sets the item width of {@link Fisheye}. */ public void setItemWidth(int itemwd) throws WrongValueException { if (itemwd <= 0) throw new WrongValueException("Positive is required: "+itemwd); if (_itemwd != itemwd) { _itemwd = itemwd; smartUpdate("z.itemwidth", itemwd); } } /** Returns the item height of {@link Fisheye}.
/** Sets the item maximal height of {@link Fisheye}. */ public void setItemMaxHeight(int itemmaxhgh) throws WrongValueException { if (itemmaxhgh <= 0) throw new WrongValueException("Positive is required: "+itemmaxhgh); if (_itemmaxhgh != itemmaxhgh) { _itemmaxhgh = itemmaxhgh; smartUpdate("z.itemmaxheight", itemmaxhgh); } }
/** Sets the orient. * @param orient either "horizontal" or "vertical". */ public void setOrient(String orient) throws WrongValueException { if (!"horizontal".equals(orient) && !"vertical".equals(orient)) throw new WrongValueException("orient cannot be " + orient); setMold(orient); }