Package java.io

Examples of java.io.Writer


   public void processRender(WebuiRequestContext context) throws Exception
   {
      if (getChildren() == null || getChildren().size() < 1)
         createUIFormInput(0);

      Writer writer = context.getWriter();

      UIForm uiForm = getAncestorOfType(UIForm.class);
      int size = getChildren().size();
      //    ResourceBundle res = context.getApplicationResourceBundle() ;

      for (int i = 0; i < size; i++)
      {
         UIFormInputBase uiInput = getChild(i);
         writer.append("<div class=\"MultiValueContainer\">");

         uiInput.setEditable(!readonly_);
         uiInput.setEnable(enable_);

         uiInput.processRender(context);

         if ((size >= 2) || ((size == 1) && (uiInput.getValue() != null)))
         {
            writer.append("<img onclick=\"");
            writer.append(uiForm.event("Remove", uiInput.getId())).append("\" title=\"Remove Item\" alt=\"\"");
            writer
               .append(" class=\"MultiFieldAction Remove16x16Icon\" src=\"/eXoResources/skin/sharedImages/Blank.gif\" />");
         }
         if (i == size - 1)
         {

            writer.append("<img onclick=\"");
            writer.append(uiForm.event("Add", getId())).append("\" title=\"Add Item\" alt=\"\"");
            writer
               .append(" class=\"MultiFieldAction AddNewNodeIcon\" src=\"/eXoResources/skin/sharedImages/Blank.gif\" />");
         }
         writer.append("</div>");
      }
   }
View Full Code Here


      }
   }

   public void processRender(WebuiRequestContext context) throws Exception
   {
      Writer w = context.getWriter();
      w.write("<input type='checkbox' name='");
      w.write(name);
      w.write("'");
      w.write(" value='");
      if (value_ != null)
         w.write(String.valueOf(value_));
      w.write("' ");
      if (onchange_ != null)
      {
         UIForm uiForm = getAncestorOfType(UIForm.class);
         w.append(" onclick=\"").append(renderOnChangeEvent(uiForm)).append("\"");
      }
      if (checked)
         w.write(" checked ");
      if (!enable_)
         w.write(" disabled ");
      w.write(" class='checkbox'/>");
      if (this.isMandatory())
         w.write(" *");
   }
View Full Code Here

   }

   public void processRender(WebuiRequestContext context) throws Exception
   {
      context.getJavascriptManager().addJavascript("eXo.webui.UICombobox.init('" + getId() + "');");
      Writer w = context.getWriter();
      String options = "[";
      String text =
         "<div class='UIComboboxComponent'><div class='UIComboboxList'><div class='UIComboboxContainer'><div class='UIComboboxItemContainer'>";
      for (SelectItemOption item : options_)
      {
         options += "'" + item.getLabel() + "',";
         text +=
            "<a href='javascript:void(0);' onclick='eXo.webui.UICombobox.getValue(this);' value='" + item.getValue()
               + "' class='UIComboboxItem'>";
         text += "<div class='UIComboboxIcon'>";
         text += "<div class='UIComboboxLabel'>" + item.getLabel() + "</div>";
         text += "</div>";
         text += "</a>";
      }
      text += "</div></div></div>";
      options = options.substring(0, options.length() - 1) + "]";
      text += "<input type='hidden'  name='" + getName() + "' id='" + getId() + "'";
      if (value_ != null && value_.trim().length() > 0)
      {
         text += " value='" + encodeValue(value_).toString() + "'";
      }
      text += " />";
      text +=
         "<input class='UIComboboxInput' options=\"" + options
            + "\" onkeyup='eXo.webui.UICombobox.complete(this,event);' type='text' " + renderJsActions();
      if(value_ != null && value_.trim().length() > 0)
      {
         text += "value='" + encodeValue(value_).toString() + "'"
      }
     
      text += " /></div>";
      w.write(text);
   }
View Full Code Here

            for (String model : models) {
                Matcher m = p.matcher(model);
                if (m.find()) {
                    String className = m.group().substring("class".length()).trim();
                    File classFile = new File(parentFile, className + ".java");
                    Writer o = new FileWriter(classFile, false);
                    PrintWriter writer = new PrintWriter(new BufferedWriter(o));
                    writer.write(model);
                    writer.close();
                    System.out.println("Generated " + classFile.getAbsolutePath());
                }
View Full Code Here

   public void processRender(WebuiApplication app, WebuiRequestContext context) throws Exception
   {
      WebuiRequestContext pContext = (WebuiRequestContext)context.getParentAppRequestContext();
      if (context.useAjax() && !pContext.getFullRender())
      {
         Writer w = context.getWriter();

         Set<UIComponent> list = context.getUIComponentToUpdateByAjax();
         //      if(list == null) list = app.getDefaultUIComponentToUpdateByAjax(context) ;
         if (list != null)
         {
View Full Code Here

   {
      //TODO: Tung.Pham edded
      //-------------------------
      refresh();
      //-------------------------
      Writer w = context.getWriter();
      w.write("<div class=\"UIUserInGroup\">");
      renderChildren();
      w.write("</div>");
   }
View Full Code Here

      getChild(UIGrid.class).getUIPageIterator().setPageList(new FindMembershipTypesPageList(5));
   }

   public void processRender(WebuiRequestContext context) throws Exception
   {
      Writer w = context.getWriter();
      w.write("<div class=\"UIListMembershipType\">");
      renderChildren();
      w.write("</div>");
   }
View Full Code Here

   }

   @SuppressWarnings("unused")
   public void processRender(WebuiRequestContext context) throws Exception
   {
      Writer w = context.getWriter();
      w.write("<div id=\"UIMembershipManagement\" class=\"UIMembershipManagement\">");
      renderChildren();
      w.write("</div>");
   }
View Full Code Here

      addChild(UIUserInfo.class, null, null).setRendered(false);
   }

   public void processRender(WebuiRequestContext context) throws Exception
   {
      Writer w = context.getWriter();
      w.write("<div id=\"UIUserManagement\" class=\"UIUserManagement\">");
      renderChildren();
      w.write("</div>");
   }
View Full Code Here

  public void unloadSessions(ServletContext servletContext) {
    if (sessions == null)
      return;
    File store = getPersistentFile(servletContext);

    Writer w = null;
    try {
      if (store != null) {
        w = new FileWriter(store);
      }
      // TODO consider moving implementation to HttpSessionContextImpl
      Enumeration e = sessions.elements();
      while (e.hasMoreElements()) {
        AcmeSession session = (AcmeSession) e.nextElement();
        if (session.getServletContext() == servletContext) {
          if (w != null)
            try {
              session.save(w);
            } catch (Throwable t) {
              if (t instanceof ThreadDeath)
                throw (ThreadDeath) t;
              log("TJWS: problem in session serialization for "+servletContext+" / "+
                  session, t);
            }
          session.invalidate();
        }
      }
    } catch (IOException ioe) {
      log("TJWS: problem in persisting sessions for  "+servletContext, ioe);
    } finally {
      if (w != null)
        try {
          w.close();
        } catch (Exception e) {
        }
    }
  }
View Full Code Here

TOP

Related Classes of java.io.Writer

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.