public VoteListGrid() {
    super();

    // initialize the List Grid fields
    ListGridField iconField = new ListGridField(ICON, ICON_DISPLAY_NAME, ICON_COLUMN_LENGTH);
    iconField.setImageSize(16);
    iconField.setAlign(Alignment.CENTER);
    iconField.setType(ListGridFieldType.IMAGE);
    iconField.setImageURLPrefix(URL_PREFIX);
    iconField.setImageURLSuffix(URL_SUFFIX);

    ListGridField voteCodeField = new ListGridField(VOTE_CODE, VOTE_CODE_DISPLAY);
    voteCodeField.setWidth("20%");
    ListGridField voteNameField = new ListGridField(VOTE_NAME, VOTE_NAME_DISPLAY);
    voteNameField.setWidth("20%");
    ListGridField voteIDField = new ListGridField(VOTE_ID, VOTE_ID_DISPLAY);
    voteIDField.setHidden(true);
    ListGridField createdByField = new ListGridField(CREATED_BY, CREATED_BY_DISPLAY);
    createdByField.setWidth("20%");
    ListGridField changedByField = new ListGridField(CHANGED_BY, CHANGED_BY_DISPLAY);
    changedByField.setWidth("20%");
    ListGridField emptyField = new ListGridField(EMPTY_FIELD, EMPTY_FIELD_DISPLAY_NAME);

    this.setCanPickFields(false);
    this.setShowRowNumbers(true);
    this.setFields(voteIDField, voteNameField, voteCodeField, createdByField, changedByField);
  }
  public ProjectViewTreeGrid() {
    super();

    ListGridField projectId = new ListGridField(PROJECT_ID, PROJECT_ID_DISPLAY);
    projectId.setHidden(true);

    ListGridField projectName = new ListGridField(PROJECT_NAME, PROJECT_NAME_DISPLAY);
    projectId.setHidden(true);

    ListGridField projectOwner = new ListGridField(OWNER, OWNER_DISPLAY);

    ListGridField startDate = new ListGridField(STARTED, STARTED_DISPLAY);

    ListGridField closingDate = new ListGridField(ENDED, ENDED_DISPLAY);

    ListGridField projectProgress = new ListGridField(PROGRESS, PROGRESS_DISPLAY);

    ListGridField status = new ListGridField(STATUS, STATUS_DISPLAY);

    ListGridField nextActor = new ListGridField(NEXT_ACTOR, NEXT_ACTOR_DISPLAY);

    ListGridField latestComment = new ListGridField(LATEST_COMMENT, LATEST_COMMENT_DISPLAY);

    this.setBaseStyle("myBoxedGridCell");
    this.setFields(
        projectId,
        projectName,
        status,
        projectOwner,
        startDate,
        closingDate,
        projectProgress,
        nextActor,
        latestComment);

    this.setSelectionAppearance(SelectionAppearance.ROW_STYLE);
    this.setSelectionType(SelectionStyle.SIMPLE);
    this.setWrapCells(true);
    this.setFixedRecordHeights(false);
    this.setCanExpandRecords(false);
  }
    @Override
    public ArrayList<ListGridField> getListGridFields() {
      ArrayList<ListGridField> fields = super.getListGridFields();

      // hide the created/modified fields, we don't need to show them by default
      // add cell formatter on the name field so we can make it a link
      for (ListGridField field : fields) {
        String fieldName = field.getName();
        if (fieldName.equals(FIELD_CTIME) || fieldName.equals(FIELD_MTIME)) {
          field.setHidden(true);
        } else if (fieldName.equals(FIELD_NAME)) {
          field.setCellFormatter(
              new CellFormatter() {
                @Override
                public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                  AlertDefinition alertDef = copyValues(record);
                  int resourceId = alertDef.getResource().getId();
                  int alertDefId = alertDef.getId();
                  String link = LinkManager.getSubsystemAlertDefinitionLink(resourceId, alertDefId);
                  return "<a href=\""
                      + link
                      + "\">"
                      + StringUtility.escapeHtml(alertDef.getName())
                      + "</a>";
                }
              });
        }
      }

      // add more columns
      ListGridField parentField = new ListGridField(FIELD_PARENT, MSG.view_alerts_field_parent());
      parentField.setWidth(100);
      parentField.setShowHover(true);
      parentField.setHoverCustomizer(
          new HoverCustomizer() {
            @Override
            public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
              if (record.getAttribute(FIELD_PARENT) != null) {
                return MSG.view_reports_alertDefinitions_parentHover();
              }
              return MSG.common_val_na();
            }
          });
      parentField.addRecordClickHandler(
          new RecordClickHandler() {
            @Override
            public void onRecordClick(RecordClickEvent event) {
              // we only do something if we really have a parent.
              // if we have a template parent, we have to get the resource's type and go to the
              // template page for that type
              // if we have a group parent, we can directly go to the group's alert def page
              Record record = event.getRecord();
              AlertDefinition alertDef = copyValues(record);
              if (alertDef.getParentId() != null && alertDef.getParentId().intValue() > 0) {
                final Integer templateId = alertDef.getParentId().intValue();
                final Integer resourceId = alertDef.getResource().getId();

                ResourceCriteria resCriteria = new ResourceCriteria();
                resCriteria.addFilterId(resourceId);
                resCriteria.fetchResourceType(true);

                GWTServiceLookup.getResourceService()
                    .findResourcesByCriteria(
                        resCriteria,
                        new AsyncCallback<PageList<Resource>>() {
                          @Override
                          public void onSuccess(PageList<Resource> result) {
                            if (result == null || result.size() != 1) {
                              CoreGUI.getErrorHandler()
                                  .handleError(
                                      MSG.view_reports_alertDefinitions_resTypeLoadError());
                            } else {
                              int typeId = result.get(0).getResourceType().getId();
                              CoreGUI.goToView(
                                  LinkManager.getAdminTemplatesLink()
                                      + "/Alert/"
                                      + typeId
                                      + "/"
                                      + templateId);
                            }
                          }

                          @Override
                          public void onFailure(Throwable caught) {
                            CoreGUI.getErrorHandler()
                                .handleError(
                                    MSG.view_reports_alertDefinitions_resTypeLoadError(), caught);
                          }
                        });
              } else if (alertDef.getGroupAlertDefinition() != null) {
                AlertDefinition groupAlertDef = alertDef.getGroupAlertDefinition();
                CoreGUI.goToView(
                    LinkManager.getEntityTabLink(
                            EntityContext.forGroup(groupAlertDef.getResourceGroup()),
                            "Alert",
                            "Definitions")
                        + "/"
                        + groupAlertDef.getId());
              }
            }
          });
      fields.add(parentField);

      ListGridField resourceField = new ListGridField(FIELD_RESOURCE, MSG.common_title_resource());
      resourceField.setCellFormatter(
          new CellFormatter() {
            public String format(Object value, ListGridRecord listGridRecord, int i, int i1) {
              String url =
                  LinkManager.getResourceLink(
                      listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
              return SeleniumUtility.getLocatableHref(
                  url, StringUtility.escapeHtml(value.toString()), null);
            }
          });
      resourceField.setShowHover(true);
      resourceField.setHoverCustomizer(
          new HoverCustomizer() {
            public String hoverHTML(
                Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
              return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
            }
          });
      fields.add(resourceField);

      ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
      fields.add(ancestryField);

      return fields;
    }