Package org.olat.core.extensions.action

Examples of org.olat.core.extensions.action.ActionExtension


 
  private Controller getContentCtr(Object uobject, UserRequest ureq){
    Controller contentCtr1Tmp = null;
    if (uobject instanceof ActionExtension) {
      ActionExtension ae = (ActionExtension) uobject;
      contentCtr1Tmp = createController(ae, ureq);
    } else {
      contentCtr1Tmp = handleOwnMenuTreeEvent(uobject, ureq);
    }
    if (contentCtr1Tmp == null) { throw new AssertException(
View Full Code Here


   * @param uObj
   * @param activation args null or argument that is passed to child
   */
  private void activateContent(UserRequest ureq, Object uObj, String activationArgs) {
    if (uObj instanceof ActionExtension) {
      ActionExtension ae = (ActionExtension) uObj;
      removeAsListenerAndDispose(resC);
      Controller extC = ae.createController(ureq, getWindowControl(), null);
      content.setContent(extC.getInitialComponent());
      this.resC = extC;
      listenTo(resC);
    } else {
      String cmd = (String) uObj;
View Full Code Here

    Class<? extends HomeMainController> extensionPointMenu = this.getClass();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(extensionPointMenu.getName());
      if (ae != null) {
        gtn = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
        gtn.setTitle(menuText);
        gtn.setUserObject(ae);
        gtn.setAltText(ae.getDescription(getLocale()));
        root.addChild(gtn);
        // inform only once
        if (!extensionLogged) {
          extensionLogged = true;
          extm.inform(extensionPointMenu, anExt, "added menu entry (for locale " + getLocale().toString() + " '" + menuText + "'");
View Full Code Here

  public HelloWorldExtension() {
   
    //we like to have a link in the testing tab menu
    //elements.putExtensionElement(TestingMainController.class.getName(), new ActionExtension() {
    elements.putExtensionElement(HomeMainController.class.getName(), new ActionExtension() {
      //the "alt" text for the link
      public String getDescription(Locale loc) {
        Translator translator = Util.createPackageTranslator(this.getClass(), loc);
        return translator.translate("helloWorld.description");
      }
View Full Code Here

   *
   * @param ureq
   * @param cmd
   */
  private void launchExtensionController(UserRequest ureq, Object cmd) {
    ActionExtension ae = (ActionExtension) cmd;
    removeAsListenerAndDispose(resC);
    ICourse course = CourseFactory.loadCourse(ores);
    this.resC = ae.createController(ureq, getWindowControl(), course);
    listenTo(resC);
    main.setContent(this.resC.getInitialComponent());
  }
View Full Code Here

    Class extensionPointMenu = this.getClass();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(extensionPointMenu.getName());
      if (ae != null) {
        gtn = new GenericTreeNode();
        String menuText = ae.getActionText(locale);
        gtn.setTitle(menuText);
        gtn.setUserObject(ae);
        gtn.setAltText(ae.getDescription(locale));
        root.addChild(gtn);
        // inform only once
        if (!extensionLogged) {
          extensionLogged = true;
          extm.inform(extensionPointMenu, anExt, "added menu entry (for locale " + locale.toString() + " '" + menuText + "'");
View Full Code Here

    } else if(uobject.equals("i18n")){
      return I18nUIFactory.createI18nConfigurationController(ureq, getWindowControl());
    } else if(uobject.equals("versions")){
      return new VersionAdminController(ureq, getWindowControl());
    } else if (uobject instanceof ActionExtension) {
      ActionExtension ae = (ActionExtension) uobject;
      return ae.createController(ureq, getWindowControl(), null);
    }
    return null;
  }
View Full Code Here

    ExtManager extm = ExtManager.getInstance();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // 1) general menu extensions
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(SystemAdminMainController.class.getName());
      if (ae != null) {
        gtnChild = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
        gtnChild.setTitle(menuText);
        gtnChild.setUserObject(ae);
        gtnChild.setAltText(ae.getDescription(getLocale()));
        admin.addChild(gtnChild);
        // inform only once
        if (!extensionLogged) {
          extensionLogged = true;
          extm.inform(SystemAdminMainController.class, anExt, "added menu entry (for locale " + getLocale().toString() + " '" + menuText + "'");
        }
      }
      // 2) check for system configuration submenu extensions
      ae = (ActionExtension) anExt.getExtensionFor(SystemAdminMainController.class.getName() + "_configuration");
      if (ae != null) {
        gtnChild = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
        gtnChild.setTitle(menuText);
        gtnChild.setUserObject(ae);
        gtnChild.setAltText(ae.getDescription(getLocale()));
        confSub.addChild(gtnChild);
        // inform only once
        if (!configExtensionLogged) {
          configExtensionLogged = true;
          extm.inform(SystemAdminMainController.class, anExt, "added configuration submenu entry (for locale " + getLocale().toString() + " '" + menuText + "'");
View Full Code Here

  /**
   * must be public for spring framework
   */
  public SAPCampusMgntExtension() {

    elements.putExtensionElement(ArchiverMainController.class.getName(), new ActionExtension() {
      public String getDescription(Locale loc) {
        Translator trans = new PackageTranslator(PACKAGE, loc);
        return trans.translate("tool.description");
      }

View Full Code Here

  private Component initComponentFromMenuCommand(Object uobject, UserRequest ureq) {
    //in any case release delete user gui lock (reaquired if user deletion is again clicked)
    releaseDeleteUserLock();
   
    if (uobject instanceof ActionExtension) {
      ActionExtension ae = (ActionExtension) uobject;
      contentCtr = ae.createController(ureq, getWindowControl(), null);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
   
   
    //first check if it is node which opens a subtree with further uobject.tree.commands
View Full Code Here

TOP

Related Classes of org.olat.core.extensions.action.ActionExtension

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.