Package org.araneaframework.jsp

Examples of org.araneaframework.jsp.UiException


   * Evaluates attribute value and checks that it is not null.
   */
  protected Object evaluateNotNull(String attributeName, String attributeValue, Class classObject) throws JspException {
    Object value = evaluate(attributeName, attributeValue, classObject);
    if (value == null)
      throw new UiException("Attribute '" + attributeName + "' should not evaluate to null");
    return value;
  }
View Full Code Here


    super.before(out);
   
    if (code != null) {
      Info info = (Info)getImageInfo(code);
      if (info == null)
        throw new UiException("Missing image description with code '" + code + "'");
      this.src = info.src;
      this.width = info.width;
      this.height = info.height;
    }
   
View Full Code Here

        widget = UiWidgetUtil.getWidgetFromContext(id, pageContext);
        viewModel = (Standard.WidgetViewModel) widget._getViewable().getViewModel();
    fullId = UiWidgetUtil.getWidgetFullIdFromContext(id, pageContext);   
   
    if (fullId == null)
      throw new UiException("Widget must have an id!");       
       
        scopedFullId = container.scopeWidgetFullId(pageContext, fullId);
   
    // Set variables
    pushAttribute(ID_KEY_REQUEST, id, PageContext.REQUEST_SCOPE);
View Full Code Here

   * Static method to write out image with given code.
   */
  public static void writeImage(Writer out, String code, String styleClass) throws JspException, IOException {
    Info info = (Info)imageInfo.get(code);
    if (info == null)
       throw new UiException("Missing image description with code '" + code + "'");
  
    String imageUrl = ImageFileImporter.getImportString(info.src);
    writeImage(out, imageUrl, info.width, info.height, info.alt, styleClass);
  }
View Full Code Here

    // Prepare   
    viewModel = ((ButtonControl.ViewModel)controlViewModel);
   
    // More checks   
    if (viewModel.isOnClickEventRegistered() && actionId != null)
      throw new UiException("Action ID cannot be set for form element event that has a handler.");
   
    // Check whether access key was specified in the resources
    if (accessKey == null) {
        accessKey = UiUtil.getResourceStringOrNull(pageContext, controlViewModel.getLabel() + ".access-key");
        if (accessKey != null && accessKey.length() != 1) accessKey = null;
View Full Code Here

  public int after(Writer out) throws Exception {
    // Type check
    assertControlType("SelectControl");   
   
    if (!"horizontal".equals(type) && !"vertical".equals(type))
      throw new UiException("Attribute 'type' cna be only either 'horizontal' or 'vertical'!");
   
    // Prepare
    SelectControl.ViewModel viewModel = ((SelectControl.ViewModel)controlViewModel);
   
    UiStdFormRadioSelectItemLabelTag label = new UiStdFormRadioSelectItemLabelTag();
View Full Code Here

   
    // Prepare 
    MultiSelectControl.ViewModel viewModel = ((MultiSelectControl.ViewModel)controlViewModel);
   
    if (viewModel.getSelectItemByValue(value) == null)
      throw new UiException("Value '" + value + "' not found in values list.");   
       
    String label =  viewModel.getSelectItemByValue(value).getDisplayString();   
   
    UiStdFormSimpleLabelTag.writeSelectLabel(
                                out,
View Full Code Here

    String pathStart = NameUtil.getNamePrefix(path);
    String pathEnd = NameUtil.getNameSuffix(path);
   
        Standard.StandardWidgetInterface widget = (Standard.StandardWidgetInterface) container.getWidgets().get(pathStart);
    if (widget == null)
      throw new UiException("Failed to traverse to widget with path '" + path + "' because widget '" + pathStart + "' was not found");
       
    if (!"".equals(pathEnd))
      widget = traverseToSubWidget(widget, pathEnd);
   
    return widget;
View Full Code Here

 
  public static Standard.StandardWidgetInterface traverseToSubWidget(Standard.StandardWidgetInterface root, String path) throws UiException {   
      Standard.StandardWidgetInterface widget = root;
   
    if ("".equals(path))
      throw new UiException("Trying to traverse to a widget with an empty path!");
   
    // Traverse   
    for(StringTokenizer tokenizer = new StringTokenizer(path, "."); tokenizer.hasMoreElements();) {
      String token = tokenizer.nextToken();
         
      widget = (Standard.StandardWidgetInterface) widget._getComposite().getChildren().get(token);
      if (widget == null)
        throw new UiException("Failed to traverse widget with path '" + path + "' because widget '" + token + "' was not found");
    }
   
    // Complete
    return widget;   
 
View Full Code Here

    String selectedValue = viewModel.getSimpleValue();
    boolean selected = (selectedValue == null && value == null) ||
    (selectedValue != null && selectedValue.equals(value));
   
    if (!viewModel.containsItem(value)) {
      throw new UiException("Value '"+value+"' not found in values list.");
    }
   
   
   
    UiUtil.writeOpenStartTag(out, "input");
View Full Code Here

TOP

Related Classes of org.araneaframework.jsp.UiException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.