Package org.olat.core.logging

Examples of org.olat.core.logging.AssertException


 
  private Versions versions;

  private LocalFileImpl() {
    super(null, null);
    throw new AssertException("Cannot instantiate LocalFileImpl().");
  }
View Full Code Here


   * @param translator must be not null
   * @return DialogController
   */
  public static DialogBoxController createResourceLockedMessage(UserRequest ureq, WindowControl wControl, LockResult lockEntry,String i18nLockMsgKey, Translator translator) {
    if(lockEntry.isSuccess()){
      throw new AssertException("do not create a 'is locked message' if lock was succesfull! concerns lock:"+lockEntry.getOwner());
    }
    String[] i18nParams = new String[] { lockEntry.getOwner().getName(),
        Formatter.getInstance(ureq.getLocale()).formatTime(new Date(lockEntry.getLockAquiredTime())) };
    String lockMsg = translator.translate(i18nLockMsgKey, i18nParams);
   
View Full Code Here

    }
    if(event instanceof ButtonClickedEvent){
      ButtonClickedEvent bce = (ButtonClickedEvent) event;
      return bce.getPosition() == 0;//see createYesNoDialog for order
    }else{
      throw new AssertException("expected a ButtonClickedEvent, but was "+event.getClass().getCanonicalName());
    }
  }
View Full Code Here

  public static int getButtonPos(Event event) {
    if(event instanceof ButtonClickedEvent){
      ButtonClickedEvent bce = (ButtonClickedEvent) event;
      return bce.getPosition();
    }else{
      throw new AssertException("expected a ButtonClickedEvent, but was "+event.getClass().getCanonicalName());
    }
  }
View Full Code Here

   * Set a new i18n key. Translator must be available.
   *
   * @param i18nKey the key or NULL to reset
   */
  public void setI18nKey(String i18nKey) {
    if (i18nKey != null && getTranslator() == null) { throw new AssertException(
        "Can not set i18n key when no translator is available. Use setTranslator() first."); }
    this.i18nKey = i18nKey;
    this.setDirty(true);
  }
View Full Code Here

   * @param controllers
   */
  public LayoutController(Layouter layouter, List controllers) {
    super(null);
    // TODO:fj:b Layoutmanagers which make sense for the web
    if (layouter != null && layouter != Layouts.VERTICAL) throw new AssertException("not implemented yet!");
    this.controllers = controllers;

    myContent = new VelocityContainer("layouter", VELOCITY_ROOT + "/vertical.html", null, null);

    int cnt = controllers.size();
View Full Code Here

   *            true: show sorted folder items first (items with attribute
   *            'isTypeLeaf') and then sorted leafs
   */
  public void setTreeSorting(boolean doSort, boolean asc, boolean foldersFirst) {
    if ((asc || foldersFirst) && !doSort) {
      throw new AssertException("Programming error: can not sort ascending or folderFirst when sorting flag is set to false");
    }
    mainVC.contextPut("doSort", Boolean.valueOf(doSort));
    mainVC.contextPut("sortOrder", (asc ? "asc" : "desc"));
    mainVC.contextPut("foldersFirst", Boolean.valueOf(foldersFirst));   
  }
View Full Code Here

   * @param allowUserInput
   */
  public RatingComponent(String name, float currentRating, int maxRating, boolean allowUserInput) {
    super(name);
    if (currentRating > maxRating)
      throw new AssertException("Current rating set to higher value::" + currentRating + " than the maxRating::" + maxRating);
    this.allowUserInput = allowUserInput;
    this.currentRating = currentRating;
    // use default values for the other stuff
    this.ratingLabels = new ArrayList<String>(maxRating);
    for (int i = 0; i < maxRating; i++) {
View Full Code Here

    return ratingLabels;
  }
 
  public String getRatingLabel(int position) {
    if (position >= ratingLabels.size()) {
      throw new AssertException("Can not get rating at position::" + position + " in rating array of size::" + ratingLabels.size() + " in component::" + getComponentName());
    }
    return ratingLabels.get(position);
  }
View Full Code Here

    return ratingLabels.get(position);
  }

  public void setLevelLabel(int position, String ratingLabel) {
    if (position >= ratingLabels.size()) {
      throw new AssertException("Can not set rating at position::" + position + " in rating array of size::" + ratingLabels.size() + " in component::" + getComponentName());
    }
    this.ratingLabels.set(position, ratingLabel);
    this.setDirty(true);
  }
View Full Code Here

TOP

Related Classes of org.olat.core.logging.AssertException

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.