Package org.olat.core.logging

Examples of org.olat.core.logging.AssertException


  /**
   * @see org.olat.core.gui.control.generic.tool.ToolController#remove(java.lang.String)
   */
  public void remove(String ident) {
    int pos = getToolEntryPosition(ident);
    if (pos == -1) throw new AssertException("Trying to remove a ToolEntry that does not exist.");
    entries.remove(pos);
  }
View Full Code Here


   *      org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == content) {
      String action = event.getCommand();
      if (action == null) throw new AssertException("no action for a tool command");
      // hack check: make sure we only fire clicks that are indeed listed
      boolean isInBox = false;
      int entCnt = entries.size();
      for (int i = 0; i < entCnt; i++) {
        ToolEntry entry = (ToolEntry) entries.get(i);
        String entryAction = entry.getAction();
        if (entryAction != null && entryAction.equals(action)) {
          isInBox = true;
          break;
        }
      }
      if (!isInBox) throw new AssertException("trying to fire a command which is not in the tool: action=" + action);
      // must be links, forward event to controllerlistener(s)
      fireEvent(ureq, event);
    }
    else if (myLinks.contains(source)){
      fireEvent(ureq, event);
View Full Code Here

   * @see org.olat.core.gui.control.generic.tool.ToolController#setEnabled(java.lang.String,
   *      boolean)
   */
  public void setEnabled(String ident, boolean enabled) {
    int pos = getToolEntryPosition(ident);
    if (pos == -1) throw new AssertException("Trying to enable/disable a ToolEntry that does not exist.");
    ToolEntry entry = (ToolEntry) entries.get(pos);
    boolean wasEnabled = entry.isEnabled();
    entry.setEnabled(enabled);

    if (wasEnabled ^ enabled) {
View Full Code Here

            return;
          }
         
        }
      } else {
        throw new AssertException("no droppable defined, but a request dispatched to the panel: ureq=" + ureq);
      }
    } else {
      throw new AssertException("a panel should never dispatch a request (unless it has droppables, which it has not), ureq = "+ureq);
    }
  }
View Full Code Here

  /**
   * @see org.olat.core.gui.components.Container#put(org.olat.core.gui.components.Component)
   */
  public void put(Component component) {
    throw new AssertException("please don't use put(comp) in a panel, but setContent(component) or pushContent(component)");
  }
View Full Code Here

  /**
   *
   */
  public void popContent() {
    int stackHeight = stackList.size();
    if (stackHeight < 1) throw new AssertException("stack was empty!");
    if (curContent == null) throw new AssertException("stackHeight not zero, but curContent was null!");
    // remove the current active component as the containers child
    super.remove(curContent);
    stackList.remove(stackHeight - 1); // remove the top component
    if (stackHeight == 1) { // after pop, the content is null
      curContent = null;
View Full Code Here

    }
  }

  private void renderRadioButtonGroup(Form f, RadioButtonGroupElement rbge, Translator translator, StringOutput sb) {
    int cnt = rbge.getSize();
    if (rbge.getSelected() == -1) throw new AssertException("no selection at render time");
    sb.append("<div id=\"").append(JSELEMENTID+rbge.hashCode()).append("\">");
    if (f.isDisplayOnly()) {
      int sel = rbge.getSelected();
      String val = rbge.getValue(sel);
      if (val == null) throw new AssertException("value in readonly mode of radiobutton group (" + rbge.getName() + ") was null, selPos = "
          + rbge.getSelected());
      sb.append(StringEscapeUtils.escapeHtml(val).toString());
     
    } else {
      String subStrName = "name=\"" + rbge.getName() + "\"";
View Full Code Here

    int cnt = sse.getSize();
    sb.append("<div id=\"").append(JSELEMENTID+sse.hashCode()).append("\">");
    if (f.isDisplayOnly()) {
      int sel = sse.getSelected();
      String val = sse.getValue(sel);
      if (val == null) throw new AssertException("value in readonly mode of drop-down list (" + sse.getName() + ") was null, selPos = "
          + sse.getSelected());
      sb.append(StringEscapeUtils.escapeHtml(val).toString());
     
    } else {
      sb.append("<select name=\"");
View Full Code Here

     */
    boolean flexiformlink = (presentation - Link.FLEXIBLEFORMLNK) >= 0;
    if (flexiformlink) {
      presentation = presentation - Link.FLEXIBLEFORMLNK;
      if (link.tooltipContent != null) {
        throw new AssertException("Form link does not support long transaction, tooltip yet!");
      }
    }
    boolean nontranslated = (presentation - Link.NONTRANSLATED) >= 0;
    if (nontranslated) {
      presentation = presentation - Link.NONTRANSLATED;
View Full Code Here

    };
    if (taskExecutor != null) {
      taskExecutor.runTask(safetask);
    } else {
      Tracing.logError("taskExecutor is not initialized (taskExecutor=null). Do not call 'runTask' before TaskExecutorModule is initialized.", TaskExecutorManager.class);
      throw new AssertException("taskExecutor is not initialized");
    }
  }
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.