コード例 #1
0
  public AccessModuleLovBean() {
    AccessModuleRowData.AccessModuleDataFetcher fetcher =
        new AccessModuleRowData.AccessModuleDataFetcher(JsfUtils.getInstance().getLocale());
    // DIGILIBSUITE-4601 HassanaAli Heidari
    Long userId = (Long) JsfUtils.getLoggedInUser().getId();
    if (userId != null
        && userId != 0
        && !Administrator.USER_ADMIN.equalsIgnoreCase(AuthorizationProxy.getInstance().getUserId()))
      fetcher.setUserId(userId);
    JSFTableColumn column = null;
    JSFTableColumnModel columnModel = new JSFTableColumnModel();
    column =
        new JSFTableColumn(
            AccessModuleRowData.COLUMN_CODE_PROPERTY,
            (AccessModuleRowData.COLUMN_CODE_PROPERTY),
            80);
    column.setAlignment(SwingConstants.LEFT);
    column.setSortable(true);
    columnModel.addColumn(column);

    column =
        new JSFTableColumn(
            AccessModuleRowData.COLUMN_TITLE_PROPERTY,
            (AccessModuleRowData.COLUMN_TITLE_PROPERTY),
            200);
    column.setAlignment(SwingConstants.LEFT);
    column.setSortable(true);
    columnModel.addColumn(column);

    column =
        new JSFTableColumn(
            AccessModuleRowData.COLUMN_DESCRIPTION_PROPERTY,
            (AccessModuleRowData.COLUMN_DESCRIPTION_PROPERTY),
            200);
    column.setAlignment(SwingConstants.LEFT);
    column.setSortable(true);
    columnModel.addColumn(column);

    table =
        new JSFTable(
            columnModel,
            fetcher,
            new GridCriteriaModel(),
            new ArrayList(),
            JsfUtils.getInstance().getLocale(),
            true,
            0,
            this.getClass().getName());
  }
コード例 #2
0
  public void init() {
    fetcher = new UserFavoriteSubjectRowData.UserFavoriteSubjectDataFetcher(user, locale);

    JSFTableColumnModel columnModel = new JSFTableColumnModel();
    JSFTableColumn column = null;
    column =
        new JSFTableColumn(UserFavoriteSubjectRowData.TITLE, UserFavoriteSubjectRowData.TITLE, 700);
    column.setAlignment(SwingConstants.LEADING);
    column.setSortable(true);
    columnModel.addColumn(column);

    subjectModel =
        new JSFTable(
            columnModel,
            fetcher,
            new GridCriteriaModel(),
            new ArrayList(),
            JsfUtils.getInstance().getLocale(),
            true,
            25,
            "userSubject");
    subjectModel.getDataModel().setFetcher(fetcher);
    subjectModel.getDataModel().refresh();
  }