Package org.exoplatform.portal.webui.application

Examples of org.exoplatform.portal.webui.application.UIGadget


        addChild(UIDashboardContainer.class, null, null);
    }

    @Override
    public void processRender(WebuiRequestContext context) throws Exception {
        UIGadget uiGadget = this.getMaximizedGadget();
        if (uiGadget != null) {
            if (context.getAttribute(APP_NOT_EXIST) != null || context.getAttribute(UIGadget.SAVE_PREF_FAIL) != null) {
                this.setMaximizedGadget(null);
            }
        }
View Full Code Here


            UIDashboard uiDashboard = event.getSource();
            String objectId = context.getRequestParameter(OBJECTID);
            String minimized = context.getRequestParameter("minimized");

            UIDashboardContainer uiDashboardCont = uiDashboard.getChild(UIDashboardContainer.class);
            UIGadget uiGadget = uiDashboard.getChild(UIDashboardContainer.class).getUIGadget(objectId);
            if (uiGadget.isLossData()) {
                UIPortalApplication uiApp = Util.getUIPortalApplication();
                uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
                context.setAttribute(APP_NOT_EXIST, true);
                context.addUIComponentToUpdateByAjax(uiDashboard);
            } else {
                uiGadget.getProperties().setProperty("minimized", minimized);
                uiDashboardCont.save();
                if (context.getAttribute(UIDashboardContainer.SAVE_FAIL) != null) {
                    return;
                }
                Util.getPortalRequestContext().setResponseComplete(true);
View Full Code Here

            WebuiRequestContext context = event.getRequestContext();
            UIDashboard uiDashboard = event.getSource();
            String objectId = context.getRequestParameter(OBJECTID);
            String maximize = context.getRequestParameter("maximize");
            UIDashboardContainer uiDashboardCont = uiDashboard.getChild(UIDashboardContainer.class);
            UIGadget uiGadget = uiDashboardCont.getUIGadget(objectId);
            if (uiGadget == null || uiGadget.isLossData()) {
                UIPortalApplication uiApp = Util.getUIPortalApplication();
                uiApp.addMessage(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null));
                context.setAttribute(APP_NOT_EXIST, true);
                context.addUIComponentToUpdateByAjax(uiDashboard);
                return;
            }

            // TODO nguyenanhkien2a@gmail.comá
            // We need to expand unminimized state of uiGadget to view all body of
            // gadget, not just a title with no content
            uiGadget.getProperties().setProperty("minimized", "false");
            uiDashboardCont.save();

            if (maximize.equals("maximize") && context.getAttribute(UIDashboardContainer.SAVE_FAIL) == null) {
                uiGadget.setView(UIGadget.CANVAS_VIEW);
                uiDashboard.setMaximizedGadget(uiGadget);
            } else {
                uiGadget.setView(UIGadget.HOME_VIEW);
                uiDashboard.setMaximizedGadget(null);
            }
        }
View Full Code Here

        } else if (model instanceof Application) {
            Application application = (Application) model;

            if (dashboard && application.getType() == ApplicationType.GADGET) {
                Application<Gadget> ga = (Application<Gadget>) application;
                UIGadget uiGadget = uiContainer.createUIComponent(context, UIGadget.class, null, null);
                uiGadget.setStorageId(application.getStorageId());
                toUIGadget(uiGadget, ga);
                uiComponent = uiGadget;
            } else {
                UIPortlet uiPortlet = uiContainer.createUIComponent(context, UIPortlet.class, null, null);
                uiPortlet.setStorageId(application.getStorageId());
View Full Code Here

         Application application = (Application)model;

         if (dashboard && application.getType() == ApplicationType.GADGET)
         {
            Application<Gadget> ga = (Application<Gadget>)application;
            UIGadget uiGadget = uiContainer.createUIComponent(context, UIGadget.class, null, null);
            uiGadget.setStorageId(application.getStorageId());
            toUIGadget(uiGadget, ga);
            uiComponent = uiGadget;
         }
         else
         {
View Full Code Here

      {
         UIPage uiPage = event.getSource();
         String objectId = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
         List<UIGadget> uiGadgets = new ArrayList<UIGadget>();
         uiPage.findComponentOfType(uiGadgets, UIGadget.class);
         UIGadget uiGadget = null;
         for (UIGadget ele : uiGadgets)
         {
            if (ele.getId().equals(objectId))
            {
               uiGadget = ele;
               break;
            }
         }
         if (uiGadget == null)
            return;
         String posX = event.getRequestContext().getRequestParameter("posX");
         String posY = event.getRequestContext().getRequestParameter("posY");
         String zIndex = event.getRequestContext().getRequestParameter(UIApplication.zIndex);

         uiGadget.getProperties().put(UIApplication.locationX, posX);
         uiGadget.getProperties().put(UIApplication.locationY, posY);
         uiGadget.getProperties().put(UIApplication.zIndex, zIndex);

         if (!uiPage.isModifiable())
            return;
         Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
         if (page.getChildren() == null)
View Full Code Here

      List<UIContainer> columns = getColumns();
      for (int iCol = 0; iCol < getColumns().size(); iCol++)
      {
         for (int iRow = 0; iRow < columns.get(iCol).getChildren().size(); iRow++)
         {
            UIGadget gadget = (UIGadget)columns.get(iCol).getChild(iRow);
            if (gadgetId.equals(gadget.getId()))
            {
               return gadget;
            }
         }
      }
View Full Code Here

    * @return <code>UIGadget</code> which deleted<br> <code>null</code> otherwise
    * @see UIGadget
    */
   public UIGadget removeUIGadget(final String gadgetId)
   {
      UIGadget gadget = getUIGadget(gadgetId);
      if (gadget != null)
      {
         UIContainer uiContainer = gadget.getParent();
         gadget.setParent(null);
         uiContainer.getChildren().remove(gadget);
      }
      return gadget;
   }
View Full Code Here

    * @return <code>UIGadget</code> which deleted<br> <code>null</code> otherwise
    * @see UIGadget
    */
   public UIGadget removeUIGadget(final int col, final int row)
   {
      UIGadget gadget = getUIGadget(col, row);
      if (gadget != null)
      {
         removeUIGadget(gadget.getId());
      }
      return gadget;
   }
View Full Code Here

    * @param row      index of destination row
    * @see UIGadget
    */
   public void moveUIGadget(final String gadgetId, final int col, final int row)
   {
      UIGadget gadget = removeUIGadget(gadgetId);
      if (gadget == null)
      {
         return;
      }
      addUIGadget(gadget, col, row);
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.webui.application.UIGadget

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.