Package com.adito.core

Examples of com.adito.core.Panel


  String generateFragment() throws JspException {
    String framePosition = CoreUtil.getCookieValue("frame_" + getStyleId() + "_pos",
      (HttpServletRequest) pageContext.getRequest(),
      "");
    StringBuffer buf = new StringBuffer();
    Panel p = panelId == null ? null : PanelManager.getInstance().getPanel(panelId);
    if (p == null && getStyleId() == null) {
      throw new JspException("Frame tag requires either panelId or styleId attributes");
    }
    String frameState = CoreUtil.getCookieValue("frame_" + getStyleId(),
      (HttpServletRequest) pageContext.getRequest(),
      p != null ? p.getDefaultFrameState() : FRAME_NORMAL);
    buf.append("<div ");
    buf.append("id=\"");
    buf.append(getStyleId());
    buf.append("\"");
    if (getStyleClass() != null) {
      buf.append(" class=\"");
      buf.append(getStyleClass());
      buf.append("\"");
    }
    if (!framePosition.equals("") || frameState.equals(FRAME_CLOSED)) {
      buf.append(" style=\"");
      if (!framePosition.equals("")) {
        try {
          StringTokenizer t = new StringTokenizer(framePosition, ",");
          int x = Integer.parseInt(t.nextToken());
          int y = Integer.parseInt(t.nextToken());
          buf.append("left: ");
          buf.append(x);
          buf.append("px; top: ");
          buf.append(y);
          buf.append("px;");
        } catch (Exception e) {
        }
      }
      if (frameState.equals("closed") && (p == null || p.isCloseable())) {
        buf.append("display: none;");
      }
      buf.append("\" ");
    }
    buf.append(">");
    buf.append("<div id=\"");
    buf.append(getStyleId());
    buf.append("Container\"");
    if (frameState.equals(FRAME_COLLAPSED)) {
      buf.append(" style=\"position: relative; left: -17.2em\"");
    }
    buf.append(">");

    if (titleKey != null) {
      title = TagUtils.getInstance().message(pageContext, getBundle(), getLocale(), titleKey, new String[] {});
    }

    if (title != null && !title.equals("")) {
      buf.append("<div class=\"titleBar\"");
      if (p != null && p.isDragable()) {
        if (p.isDropable()) {
          buf.append(" onmousedown=\"registerDragAndDrop(event,'");
        } else {
          buf.append(" onmousedown=\"registerDrag(event, \'");
        }
        buf.append(getStyleId());
        buf.append("')\"");
      }
      buf.append(">");
      buf.append("<div class=\"titleInner\">");
      if (expander && (p == null || p.isCloseable())) {
        buf.append("<div class=\"expander\">");
        buf.append("<img id=\"");
        buf.append(getStyleId());
        buf.append("_collapse");
        buf.append("\" onclick=\"frameCollapse('");
        buf.append(getStyleId());
        buf.append("');\" src=\"");
        buf.append(CoreUtil.getThemePath(pageContext.getSession()) + "/images/collapse.gif");
        buf.append("\"/>");
        buf.append("</div>");
      }
      buf.append("<div class=\"");
      buf.append(titleClass != null ? titleClass : "title");
      buf.append("\"");
      if (titleId != null) {
        buf.append(" id=\"");
        buf.append(titleId);
        buf.append("\"");
      }
      buf.append(">");
      buf.append(title);
      buf.append("</div>");
      if (p == null || p.isCloseable() || p.isMinimizable()) {
        buf.append("<div class=\"actions\">");
        if (p == null || p.isMinimizable()) {
          buf.append("<img id=\"");
          buf.append(getStyleId());
          buf.append("_minimize");
          buf.append("\" onclick=\"frameMinimize('");
          buf.append(getStyleId());
          buf.append("');\" src=\"");
          buf.append(CoreUtil.getThemePath(pageContext.getSession()) + "/images/minimize.gif");
          if (frameState.equals(FRAME_MINIMIZED)) {
            buf.append("\" style=\"display: none");
          }
          buf.append("\"/>");
          buf.append("<img id=\"");
          buf.append(getStyleId());
          buf.append("_restore");
          buf.append("\" onclick=\"frameRestore('");
          buf.append(getStyleId());
          buf.append("');\" src=\"");
          buf.append(CoreUtil.getThemePath(pageContext.getSession()) + "/images/maximize.gif");
          if (frameState.equals(FRAME_NORMAL)) {
            buf.append("\" style=\"display: none");
          }
          buf.append("\"/>");
        }
        if (p == null || p.isCloseable()) {
          buf.append("<img id=\"");
          buf.append(getStyleId());
          buf.append("_close");
          buf.append("\" onclick=\"frameClose('");
          buf.append(getStyleId());
View Full Code Here

TOP

Related Classes of com.adito.core.Panel

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.