Package org.olat.core.gui.components.panel

Examples of org.olat.core.gui.components.panel.Panel


  public BaseChiefController(UserRequest ureq) {
    setLoggingUserRequest(ureq);
    translator = Util.createPackageTranslator(this.getClass(), ureq.getLocale());

    // main layout/structure
    mainPanel = new Panel("brasatoMainPanel");
    mainPanel.setDomReplaceable(false);

    mainvc = new VelocityContainer("baseccvc", VELOCITY_ROOT + "/body.html", translator, this);
    // disallow wrapping of divs around the panel and the main velocity page
    // (since it contains the "<html><head... intro of the html page,
    // and thus has better to be replaced as a whole (new page load) instead of
    // a dom replacement)
    mainvc.setDomReplaceable(false);

    // component-id of mainPanel for the window id
    mainvc.contextPut("o_winid", String.valueOf(mainPanel.getDispatchID()));
    // add jsMath library
    mainvc.contextPut("jsMathEnabled", Boolean.valueOf(jsMathEnabled));
    mainPanel.setContent(mainvc);

    WindowManager winman = Windows.getWindows(ureq).getWindowManager();
    wbo  = winman.createWindowBackOffice("basechiefwindow", this);
    Window w = wbo.getWindow();
   
    // part that builds the css and javascript lib includes (<script src="..."> and <rel link
    // e.g.
    // <script type="text/javascript" src="/demo/g/2/js/jscalendar/calendar.js"></script>

    mainvc.put("jsCssRawHtmlHeader", w.getJsCssRawHtmlHeader())
   
    // control part for ajax-communication. returns an empty panel if ajax is not enabled, so that ajax can be turned on on the fly for development mode
    jsServerC = wbo.createAJAXController(ureq);
    mainvc.put("jsServer", jsServerC.getInitialComponent())
   
    // init with no bookmark (=empty bc)
    mainvc.contextPut("o_bc", "");
   
    // the current language; used e.g. by screenreaders
    mainvc.contextPut("lang", ureq.getLocale().toString());

    // the current GUI theme and the global settings that contains the
    // font-size. both are pushed as objects so that window.dirty always reads
    // out the correct value
    mainvc.contextPut("theme", w.getGuiTheme());   
    mainvc.contextPut("globalSettings", winman.getGlobalSettings());   
   
    // content panel
    contentPanel = new Panel("olatContentPanel");
    mainvc.put("olatContentPanel", contentPanel);
    mainvc.contextPut("o_winid", Long.valueOf(w.getDispatchID()));
    Version v = (Version) CoreSpringFactory.getBean("org.olat.core.Version");
    mainvc.contextPut("buildversion", v.getVersion());
   
View Full Code Here


    // slow bandwidth simulation
    SlowBandWidthSimulator sbs = Windows.getWindows(ureq).getSlowBandWidthSimulator();
    bandwithController = sbs.createAdminGUI().createController(ureq, getWindowControl());
    myContent.put("bandwidth",bandwithController.getInitialComponent());

    mainpanel = new Panel("developermainpanel");
    Component protectedMainPanel = DebugHelper.createDebugProtectedWrapper(mainpanel);
   
    devToolLink = LinkFactory.createCustomLink("devTool", "devTool", "", Link.NONTRANSLATED, myContent, this);
    devToolLink.setCustomEnabledLinkCSS("b_dev");
    devToolLink.setTitle(translate("devTool"));
View Full Code Here

  public FloatingResizableDialogController(UserRequest ureq, WindowControl wControl,
      Component content, String title, int initialWidth, int initialHeight, int offsetX, int offsetY,
      Component collabsibleContent, String collabsibleContentPanelTitel, boolean resizable, boolean autoScroll, boolean constrain, String uniquePanelName) {
   
    super(ureq, wControl);
    main = new Panel("extjsPanel");
    main.setContent(wrapper);
   
    wrapper.put("panelContent", content);
    if (collabsibleContent != null) wrapper.put("collapsibleContent", collabsibleContent);
   
View Full Code Here

  }

  public FormItemImpl(String name, boolean asInlineEditingElement){
    this.name = name;
    this.isInlineEditingElement = asInlineEditingElement;
    itemPanel = new Panel(name);
    /*
     * prepare three panels as placeholder for label, example, error
     */
    errorPanel = new Panel(PREFIX + name + FormItem.ERRORC);
    examplePanel = new Panel(PREFIX + name + FormItem.EXAMPLEC);
    labelPanel = new Panel(PREFIX + name + FormItem.LABELC);
   
  }
View Full Code Here

    return new VelocityContainer("vc_" + page, velocity_root + "/" + page
        + ".html", translator, this);
  }

  protected Panel putInitialPanel(Component initialContent) {
    Panel p = new Panel("mainPanel");
    p.setContent(initialContent);
    super.setInitialComponent(p);
    return p;
  }
View Full Code Here

    super(ureq, wControl, fallBackTranslator);
    this.tableDataModel = tableDataModel;
    this.sortedItems = sortedItems; //select the items in table!!!
   
    mainVC = this.createVelocityContainer("manualSorting");
    tablePanel = new Panel("table");
    mainVC.put("table", tablePanel);
   
    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableConfig.setMultiSelect(true);
    tableConfig.setSortingEnabled(true);
View Full Code Here

   * used only by e.g. the development controller
   *
   * @return a protected panel
   */
  public static Component createDebugProtectedWrapper(Component comp) {
    Panel p = new Panel(MAGIC_KEY);
    p.setContent(comp);
    return p;
  }
View Full Code Here

   * @param wControl
   */
  ClipboardTrayController(UserRequest ureq, WindowControl wControl, ClipboardServiceImpl cbs) {
    super(ureq, wControl);
    this.cbs = cbs;
    expandedP = new Panel("trayExpanded");

    mainVc = createVelocityContainer("tray");
    ComponentUtil.registerForValidateEvents(mainVc, this);
    openDetail = LinkFactory.createLink("opendetail", mainVc, this);
    mainVc.put("expanded", expandedP);
View Full Code Here

    *
    */
  public SinglePageController(UserRequest ureq, WindowControl wControl, boolean inIframe, VFSContainer rootContainer, String fileName, String currentUri, boolean allowRelativeLinks, boolean showHomeLink, OLATResourceable contextResourcable) {
    super(wControl);
    trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    Panel mainP = new Panel("iframemain");
    myContent = new VelocityContainer("singlepagecontent", VELOCITY_ROOT + "/index.html", trans, this);
   
    homeLinkP = new Panel("homelink");
    homeLinkContent = new VelocityContainer("homelinkcontent", VELOCITY_ROOT + "/homelink.html", trans, this);
    homeLinkContent.contextPut("showHomeLink",showHomeLink?Boolean.TRUE:Boolean.FALSE);   
    homeLink = LinkFactory.createCustomLink("command.home", "command.home", "", Link.NONTRANSLATED, homeLinkContent, this);
    homeLink.setCustomEnabledLinkCSS("b_content_reset");
    homeLink.setTooltip(trans.translate("command.home"), false);
   
    myContent.put("homelinkpanel", homeLinkP);
    // remember values in case of later cloning
    // g_fileName : initial file name given (no root correction), e.g. bla.html or f/g/blu.html
    // always use non-iframe mode for screenreaders
    this.g_inIframe = (inIframe && (! getWindowControl().getWindowBackOffice().getWindowManager().isForScreenReader()));
    this.g_showHomeLink = showHomeLink;
    this.g_allowRelativeLinks = allowRelativeLinks;
    this.g_fileName = fileName;
    this.g_rootContainer = rootContainer;
    boolean jumpIn = false;
   
    // strip beginning slash
    String startURI = ( (fileName.charAt(0) == '/')? fileName.substring(1) : fileName);

    // jump (e.g. from search) to the path if the business-launch-path says so.
    BusinessControl bc = getWindowControl().getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    if ( ce != null ) { // a context path is left for me
      Tracing.logDebug("businesscontrol (for further jumps) would be:"+bc, SinglePageController.class);
      OLATResourceable ores = ce.getOLATResourceable();
      Tracing.logDebug("OLATResourceable=" + ores, SinglePageController.class);
      String typeName = ores.getResourceableTypeName();
      // typeName format: 'path=/test1/test2/readme.txt'
      // First remove prefix 'path='
      String path = typeName.substring("path=".length());
      if  (path.length() > 0) {
        Tracing.logDebug("direct navigation to container-path=" + path, SinglePageController.class);
        jumpIn = true;
        currentUri = path;
        startURI = path;
      }
    }
   
    // adjust root folder if security does not allow using ../.. etc.
    if (!allowRelativeLinks && !jumpIn) {
      // start uri is filename without relative path.
      // the relative path of the file is added to the vfs rootcontainer
      int sla = startURI.lastIndexOf('/');
      if (sla != -1) {
        String root = startURI.substring(0,sla);
        startURI = startURI.substring(sla+1);
        VFSContainer newroot = (VFSContainer)rootContainer.resolve(root);
        this.g_new_rootContainer = newroot;
      } else {
        this.g_new_rootContainer = rootContainer;       
      }
    } else {
      this.g_new_rootContainer = rootContainer;
    }
    this.g_initialUri = startURI;
    setCurURI(startURI);
   
    // startURI and g_new_rootContainer set
    // g_curURI   : the current uri (relative to the (evt. corrected) rootcontainer)
    // g_new_rootContainer : the given rootcontainer or adjusted in case when relativelinks are not allowed   
   
    // Display in iframe when
    // a) configured as to be displayed in iframe and not in braille mode
    // b) page is a direct jump in (unclear why not in this case, code was like that)
    // c) when page type can not be inline rendered (e.g. when page is a pdf file)
    if (g_inIframe || jumpIn || !HtmlStaticPageComponent.isFileTypeSupported(startURI)) {
      idc = new IFrameDisplayController(ureq, getWindowControl(), g_new_rootContainer, contextResourcable);
      idc.addControllerListener(this);
      idc.setCurrentURI(startURI);
      myContent.put("content", idc.getInitialComponent());
    } else
      // in inline mode
      // create single page root file now and start component for display dispathing
      cpc = new HtmlStaticPageComponent("content", g_new_rootContainer);
      cpc.addListener(this);
      myContent.put("content", cpc);

      if (currentUri != null) {
        if (currentUri.charAt(0) == '/') {
          //strip beginning slash
          currentUri = currentUri.substring(1);
        }
        setCurURI(currentUri);
        cpc.setCurrentURI(currentUri);
      } else {
        // no bookmarked uri given
        setCurURI(startURI);
        cpc.setCurrentURI(startURI);
      }     
    } 
         
    mainP.setContent(myContent);
    setInitialComponent(mainP);
  }
View Full Code Here

        return deliverFile(relPath, isPopUp);
      }     
    };
    baseURI = registerMapper(contentMapper);
    myContent.contextPut("baseURI", baseURI);
    newUriEventPanel = new Panel("newUriEvent");
    newUriEventPanel.setContent(eventVC);
   
    this.rootDir = rootDir;
    this.frameId = frameId;
    main = new Panel("iframemain");
    if (frameId == null) this.frameId = "ifdc" + hashCode();
    main.setContent(myContent);
    myContent.contextPut("frameId", this.frameId);
    myContent.put("newUriEvent", newUriEventPanel);
    // add default iframe height
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.panel.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.