Package org.lazan.t5.stitch.demo.pages

Examples of org.lazan.t5.stitch.demo.pages.GridCollapseDemo$Country


     * @exception   displays an error box containing the exception error message
     */
    private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
             
        try {
            Country country = Country.fromValue(jTextField1.getText());
            ArrayOfHolidayCode dates = getHolidaysAvailable(country);
           
            int dateSize = dates.getHolidayCode().size();
       
            System.out.println("Holidays for " + country + ":");
View Full Code Here


       
        String holiday;
        int year;
       
        try {
            Country countryCode = Country.fromValue(jTextField2.getText());
            holiday = jTextField3.getText();
            year = Integer.parseInt(jTextField4.getText());
       
            XMLGregorianCalendar date = getHolidayDate(countryCode, holiday, year);
        
View Full Code Here

       
        String start, end;
        Date startDate, endDate;
       
        try {
            Country coCode = Country.fromValue(jTextField5.getText());
            start = jTextField6.getText();
            end = jTextField7.getText();
            startDate = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH) {}.parse(start);
            endDate = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH).parse(end);
           
View Full Code Here

    private void jCheckBox5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox5ActionPerformed
       
        int holidayYear;
       
        try {
            Country cCode = Country.fromValue(jTextField8.getText());
            holidayYear = Integer.parseInt(jTextField9.getText());
       
            ArrayOfHoliday holidays = getHolidaysForYear(cCode, holidayYear);
            int holidaySize = holidays.getHoliday().size();
       
View Full Code Here

    private void jCheckBox6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox6ActionPerformed
       
        int holiYear, holiMonth;
       
        try {
            Country cCode = Country.fromValue(jTextField10.getText());
            holiYear = Integer.parseInt(jTextField11.getText());
            holiMonth = Integer.parseInt(jTextField12.getText());
       
            ArrayOfHoliday holidayByMonth = getHolidaysForMonth(cCode, holiYear, holiMonth);
            int holiSize = holidayByMonth.getHoliday().size();
View Full Code Here

  }

  private void addCategories(Map<String, Category> catCache, String[] categories) {
    for (String categoryEntry : categories) {
      String[] hierarchy = categoryEntry.split("/");
      Category parentCategory = null;
      for (String categoryName : hierarchy) {
        Category category = catCache.get(categoryName);
        if (category == null) {
          category = new Category();
          category.setName(categoryName);
          category.setParentCategory(parentCategory);
          session.save(category);
         
          catCache.put(categoryName, category);
        }
        parentCategory = category;
View Full Code Here

  private void addItems(Map<String, Category> catCache, String[] items) {
    for (String itemString : items) {
      String[] row = itemString.split("\\|");

      Category category = catCache.get(row[0]);
      Item item = new Item();
      item.setCategory(category);
      item.setName(row[1]);
      item.setPrice(new BigDecimal(row[2]));
      item.setDescription(row[3]);
View Full Code Here

   */
  public List<ItemTreeNode> getChildren(ItemTreeNode value) {
    if (value.isLeaf()) {
      return Collections.emptyList();
    }
    Category category = value.getCategory();
    List<ItemTreeNode> children = new ArrayList<ItemTreeNode>();

    // add the categories
    children.addAll(findCategoryNodes(category, null));
   
    // lookup the child items
    for (Item item : category.getItems()) {
      children.add(new ItemTreeNode(item));
    }

    return children;
  }
View Full Code Here

    return String.valueOf(value.getCategory().getCategoryId());
  }
 
  public ItemTreeNode toValue(String clientValue) {
    Long categoryId = Long.parseLong(clientValue);
    Category category = (Category) session.get(Category.class, categoryId);
    List<ItemTreeNode> nodes = findCategoryNodes(null,  category);
    if (nodes.size() == 1) {
      return nodes.get(0);
    }
    throw new IllegalStateException(
View Full Code Here

      "group by " +
        "childCategory.categoryId, childCategory.name, childCategory.parentCategory " +
      "order by childCategory.name";
   
    String whereClause;
    Category param = null;
    if (childCategory != null) {
      whereClause = "childCategory = ?";
      param = childCategory;
    } else if (parentCategory != null) {
      whereClause = "childCategory.parentCategory = ?";
      param = parentCategory;
    } else {
      whereClause = "childCategory.parentCategory is null";
    }
    String hql = String.format(hqlTemplate, whereClause);
    Query query = session.createQuery(hql);
    if (param != null) {
      query.setParameter(0, param);
    }
    List<Object[]> results = query.list();
    for (Object[] row : results) {
      Category current = (Category) row[0];
      int grandChildCategoryCount = ((Number) row[1]).intValue();
      int itemCount = ((Number) row[2]).intValue();
     
      ItemTreeNode treeNode =
          new ItemTreeNode(current, grandChildCategoryCount, itemCount);
View Full Code Here

TOP

Related Classes of org.lazan.t5.stitch.demo.pages.GridCollapseDemo$Country

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.