Package org.jallinone.scheduler.activities.java

Examples of org.jallinone.scheduler.activities.java.GridScheduledActivityVO


             * Method invoked when the user has clicked on delete button and the grid is in READONLY mode.
             * @param persistentObjects value objects to delete (related to the currently selected rows)
             * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
             */
            public Response deleteRecords(ArrayList persistentObjects) throws Exception {
              GridScheduledActivityVO vo = null;
              ScheduledActivityPK pk = null;
              ArrayList pks = new ArrayList();
              for(int i=0;i<persistentObjects.size();i++) {
                vo = (GridScheduledActivityVO)persistentObjects.get(i);
                pk = new ScheduledActivityPK(vo.getCompanyCodeSys01SCH06(),vo.getProgressiveSCH06());
                pks.add(pk);
              }
              Response response = ClientUtils.getData("deleteScheduledActivities",pks);
              return response;
            }


            /**
             * Method used to define the background color for each cell of the grid.
             * @param rowNumber selected row index
             * @param attributedName attribute name related to the column currently selected
             * @param value object contained in the selected cell
             * @return background color of the selected cell
             */
            public Color getBackgroundColor(int row,String attributedName,Object value) {
              GridScheduledActivityVO vo = (GridScheduledActivityVO)panel.getGrid().getVOListTableModel().getObjectForRow(row);
              if (attributedName.equals("activityStateSCH06")) {
                Color color = null;
                if (vo.getActivityStateSCH06().equals(ApplicationConsts.CLOSED) ||
                    vo.getActivityStateSCH06().equals(ApplicationConsts.INVOICED))
                  return super.getBackgroundColor(row,attributedName,value);
                else return new Color(241,143,137);
              }
              else if (attributedName.equals("prioritySCH06")) {
                Color color = null;
                if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_HIGHEST))
                  color = new Color(241,123,137);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_HIGH))
                  color = new Color(248,176,181);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_NORMAL))
                  color = new Color(191,246,207);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_LOW))
                  color = new Color(191,226,207);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_TRIVIAL))
                  color = new Color(191,206,207);
                return color;
              }
              else
                return super.getBackgroundColor(row,attributedName,value);
View Full Code Here


             * Method invoked when the user has clicked on delete button and the grid is in READONLY mode.
             * @param persistentObjects value objects to delete (related to the currently selected rows)
             * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
             */
            public Response deleteRecords(ArrayList persistentObjects) throws Exception {
              GridScheduledActivityVO vo = null;
              ScheduledActivityPK pk = null;
              ArrayList pks = new ArrayList();
              for(int i=0;i<persistentObjects.size();i++) {
                vo = (GridScheduledActivityVO)persistentObjects.get(i);
                pk = new ScheduledActivityPK(vo.getCompanyCodeSys01SCH06(),vo.getProgressiveSCH06());
                pks.add(pk);
              }
              Response response = ClientUtils.getData("deleteScheduledActivities",pks);
              return response;
            }


            /**
             * Method used to define the background color for each cell of the grid.
             * @param rowNumber selected row index
             * @param attributedName attribute name related to the column currently selected
             * @param value object contained in the selected cell
             * @return background color of the selected cell
             */
            public Color getBackgroundColor(int row,String attributedName,Object value) {
              GridScheduledActivityVO vo = (GridScheduledActivityVO)panel.getGrid().getVOListTableModel().getObjectForRow(row);
              if (attributedName.equals("activityStateSCH06")) {
                Color color = null;
                if (vo.getActivityStateSCH06().equals(ApplicationConsts.CLOSED) ||
                    vo.getActivityStateSCH06().equals(ApplicationConsts.INVOICED))
                  return super.getBackgroundColor(row,attributedName,value);
                else return new Color(241,143,137);
              }
              else if (attributedName.equals("prioritySCH06")) {
                Color color = null;
                if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_HIGHEST))
                  color = new Color(241,123,137);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_HIGH))
                  color = new Color(248,176,181);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_NORMAL))
                  color = new Color(191,246,207);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_LOW))
                  color = new Color(191,226,207);
                else if (vo.getPrioritySCH06().equals(ApplicationConsts.PRIORITY_TRIVIAL))
                  color = new Color(191,206,207);
                return color;
              }
              else
                return super.getBackgroundColor(row,attributedName,value);
View Full Code Here

TOP

Related Classes of org.jallinone.scheduler.activities.java.GridScheduledActivityVO

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.