Examples of TemplateControl


Examples of com.cosmo.ui.templates.TemplateControl

   @Override
   public String render(Workspace workspace, PageContext page, String uuid) throws TemplateUnavailableException, PageRenderException
   {
      TemplateScript script;
      TemplateLink link;
      TemplateControl tctrl;
      StringBuilder xhtml = new StringBuilder();

      Template template = workspace.getTemplate();

      try
      {
         // Confecciona la cabecera
         xhtml.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">").append("\n");
         xhtml.append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"es\" lang=\"es\">").append("\n");
         xhtml.append("<head>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<title>").append(page.getTitle()).append("</title>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=").append(page.getCharset()).append("\"></meta>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<meta name=\"generator\" content=\"" + Cosmo.COSMO_NAME + "\"></meta>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<meta name=\"uuid\" content=\"" + uuid + "\"></meta>").append("\n");

         // Inserta Scripts y Links de la p�gina
         Iterator<TemplateLink> itl = template.getLinks();
         while (itl.hasNext())
         {
            link = itl.next();
            xhtml.append(TAB_SEPARATOR + link.render());
         }

         Iterator<TemplateScript> its = template.getScripts();
         while (its.hasNext())
         {
            script = its.next();
            xhtml.append(TAB_SEPARATOR + script.render());
         }

         // Inserta Scripts y Links de los controles
         for (Control ctrl : page.getCenterContents())
         {
            tctrl = template.getControl(ctrl.getControlTypeId());

            if (tctrl != null)
            {
               for (TemplateLink tlink : tctrl.getLinks())
               {
                  xhtml.append(TAB_SEPARATOR + tlink.render());
               }

               for (TemplateScript tscript : tctrl.getScripts())
               {
                  xhtml.append(TAB_SEPARATOR + tscript.render());
               }
            }
         }
View Full Code Here

Examples of com.cosmo.ui.templates.TemplateControl

   public String render() throws TemplateUnavailableException
   {
      String xhtml;
      String xitem;
      ArrayList<MenuItem> menu;
      TemplateControl ctrl;
      Template template;

      try
      {
         // Carga el men� a renderizar
         menu = this.provider.loadMenu(this.getWorkspace(), type);

         // Obtiene la plantilla y la parte del widget
         template = this.getWorkspace().getTemplate();
         ctrl = template.getControl(WIDGET_ID);

         // Renderiza el control
         xhtml = "";
         xhtml += ctrl.getElement(WPART_HEADER);
         for (MenuItem item : menu)
         {
            xitem = ctrl.getElement(WPART_ITEM);
            xitem = xitem.replace(Widget.getTag(TAG_ITEM_HREF), item.getHref());
            xitem = xitem.replace(Widget.getTag(TAG_ITEM_CAPTION), item.getTitle());
            xitem = Control.replaceTag(xitem, TAG_ITEM_ICON, item.getIcon());

            xhtml += xitem;
         }
         xhtml += ctrl.getElement(WPART_FOOTER);

         // Reemplaza los TAGs comunes a todo el widget
         xhtml = xhtml.replace(Widget.getTag(TAG_MENU_NAME), "Opciones");

         return xhtml;
View Full Code Here

Examples of com.cosmo.ui.templates.TemplateControl

    * @return Devuelve una cadena en formato XHTML que representa el control.
    */
   @Override
   public String render()
   {
      TemplateControl ctrl;
      StringBuilder str = new StringBuilder();

      // Si no tiene elementos, no representa el control
      if (items.isEmpty())
      {
         return "<-- BradcrumbsControl placeholder (void) -->\n";
      }

      // Obtiene la plantilla y la parte del control
      ctrl = getWorkspace().getTemplate().getControl(BreadcrumbsControl.CTUID);

      // Genera la cabecera de la barra de navegaci�n
      str.append(ctrl.getElement(CPART_HEADER));

      for (BreadcrumbsItem item : this.items)
      {
         str.append(item.render(ctrl));
      }

      // Genera el pie de la barra de navegaci�n
      str.append(ctrl.getElement(CPART_FOOTER));

      return str.toString();
   }
View Full Code Here

Examples of com.lightcrafts.ui.templates.TemplateControl

        // Don't let the split panes make the editor image too small.
        editor.getImage().setMinimumSize(new Dimension(120, 120));

        history = new DocUndoHistory();

        templates = new TemplateControl(null, this);

        menus = new ComboFrameMenuBar(this);
        setJMenuBar(menus);

        File folder = folders.getSelection();
View Full Code Here

Examples of com.lightcrafts.ui.templates.TemplateControl

        if (doc != null) {
            editor = doc.getEditor();
            history = new DocUndoHistory(doc);
            templates.dispose();
            templates = new TemplateControl(editor, this);
            ScaleModel scale = doc.getScaleModel();
            scale.addScaleListener(this);
            doc.addDocumentListener(this);
            OtherApplication source = (OtherApplication) doc.getSource();
            if ((! isEditorVisible) || (source != null)) {
                showEditorPerspective();
            }
            toolButtonListener =
                new PropertyChangeListener() {
                    public void propertyChange(PropertyChangeEvent event) {
                        String propName = event.getPropertyName();
                        if (propName.equals(ToggleAction.TOGGLE_STATE)) {
                            boolean selected = (Boolean) event.getNewValue();
                            if (selected && (layout instanceof EditorLayout)) {
                               ((EditorLayout) layout).ensureToolsVisible();
                            }
                        }
                    }
                };
            // Don't let the split panes make the editor image too small.
            editor.getImage().setMinimumSize(new Dimension(120, 120));

            doc.getProofAction().addPropertyChangeListener(toolButtonListener);
        }
        else {
            editor = disabledEditor;

            // Don't let the split panes make the editor image too small.
            editor.getImage().setMinimumSize(new Dimension(120, 120));

            String disabledText = getDisabledEditorText();
            editor.setDisabledText(disabledText);

            history = new DocUndoHistory();

            templates.dispose();
            templates = new TemplateControl(null, this);

            // TODO: we come here from showBrowserPerspective...
            if (! isBrowserVisible) {
                showBrowserPerspective();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.