Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.UiException


    return _zclass == null ? "z-horpanel" : _zclass;
  }
 
  public void beforeParentChanged(Component parent) {
    if (parent != null && !(parent instanceof Horbox))
      throw new UiException("Wrong parent: "+parent);
    super.beforeParentChanged(parent);
  }
View Full Code Here


    final String cmd = request.getCommand();
    if (cmd.equals(Events.ON_SELECT)) {
      SelectEvent evt = SelectEvent.getSelectEvent(request);
      Set selItems = evt.getSelectedItems();
      if (selItems == null || selItems.size() != 1)
        throw new UiException("Exactly one selected tab is required: " + selItems); // debug purpose
      final Horbox horbox = getHorbox();
      if (horbox != null)
        horbox.selectPanelDirectly((Horpanel) selItems.iterator().next(), true);
      Events.postEvent(evt);
    } else
View Full Code Here

  // helper //
  /*package*/ void selectPanelDirectly(Horpanel horpanel, boolean byClient){
    if (horpanel == null)
      throw new IllegalArgumentException("null tab");
    if (horpanel.getHorbox() != this)
      throw new UiException("Not my child: " + horpanel);
    if (horpanel != _selPanel) {
      if (_selPanel != null)
        _selPanel.setSelectedDirectly(false);

      _selPanel = horpanel;
View Full Code Here

    return _zclass == null ? "z-horbox" : _zclass;
  }
 
  public void beforeChildAdded(Component child, Component refChild) {
    if (!(child instanceof Horpanel))
      throw new UiException("Unsupported child for tabs: "+child);
    super.beforeChildAdded(child, refChild);
  }
View Full Code Here

   * @return
   */
  public static final WireEvent getOnWireEvent(AuRequest request) {
    final Component comp = request.getComponent();
    if (comp == null)
      throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, request);
    final Map data = request.getData();

    String drawmethod = (String) data.get("drawmethod");
    Wirebox inbox = (Wirebox) request.getDesktop().getComponentByUuidIfAny((String) data.get("inbox"));
    Wirebox outbox = (Wirebox) request.getDesktop().getComponentByUuidIfAny((String) data.get("outbox"));
    if (inbox == null || outbox == null || !data.containsKey("joint"))
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] { data, request });

    Wire wire = new Wire();
    wire.setIn(inbox);
    wire.setOut(outbox);
    wire.setConfig("drawingMethod="+drawmethod);
View Full Code Here

   * @return
   */
  public static final WireEvent getUnWireEvent(AuRequest request) {
    final Component comp = request.getComponent();
    if (comp == null)
      throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, request);
    final Map data = request.getData();

    Wirebox targetbox = (Wirebox) request.getDesktop().getComponentByUuidIfAny((String) data.get("boxid"));

    if (targetbox == null  && !data.containsKey("joint"))
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] { data, request });


    String joint = (String) data.get("joint");

    ArrayList list = targetbox.getAvailableWires(joint);
    Wire unwiredWire = (Wire) list.get(0);
    if(unwiredWire == null )
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA, new Object[] { data, request });
    unwiredWire.setParent(null);
    return new WireEvent(request.getCommand(), unwiredWire.getOut(), unwiredWire, null);
  }
View Full Code Here

  //-- super --//
  protected void process(AuRequest request) {
    final Component comp = request.getComponent();
    if (comp == null)
      throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, this);
    final String[] data = request.getData();
   
    String type = data[1];
    if("top".equals(type)){
      processTopHeader((Spreadsheet)comp,data);
    }else if("left".equals(type)){
      processLeftHeader((Spreadsheet)comp,data);
    }else{
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
          new Object[] {"Type:"+type, this});
    }
  }
View Full Code Here

      if(Events.isListened(spreadsheet,org.zkoss.zss.ui.event.Events.ON_HEADER_SIZE,true)){
        HeaderEvent he = new HeaderEvent(org.zkoss.zss.ui.event.Events.ON_HEADER_SIZE, spreadsheet,sheet,HeaderEvent.TOP_HEADER,index,new Integer(newsize));
        Events.postEvent(he);
      }
    }else{
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
          new Object[] {"Event:"+event, this});
    }
   
  }
View Full Code Here

      if(Events.isListened(spreadsheet,org.zkoss.zss.ui.event.Events.ON_HEADER_SIZE,true)){
        HeaderEvent he = new HeaderEvent(org.zkoss.zss.ui.event.Events.ON_HEADER_SIZE, spreadsheet,sheet,HeaderEvent.LEFT_HEADER,index,new Integer(newsize));
        Events.postEvent(he);
      }
    }else{
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
          new Object[] {"Event:"+event, this});
    }
  }
View Full Code Here

  //-- super --//
  protected void process(AuRequest request) {
    final Component comp = request.getComponent();
    if (comp == null)
      throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, this);
    final String[] data = request.getData();
    if (data == null || data.length != 5)
      throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
        new Object[] {Objects.toString(data), this});
    String token = data[0];
    String sheetId = data[1];
    int row = Integer.parseInt(data[2]);
    int col = Integer.parseInt(data[3]);
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.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.