wanjidong / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

Unable to check if the view has been initialized in subclasses TableFacadeImpl #166

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I'm trying to do something like this:

    public View getView() {
        if (view != null) {
            return view;
        }

        if (getLimit().isExported() &&
getLimit().getExportType().equals(ExportType.PDF)) {
            return new MyPdfView((HtmlTable) getTable(), getToolbar(),
getWebContext(), getCoreContext());
        } else {
            return super.getView();
        }
    }

in a subclass of TableFacadeImpl, the 'view' instance variable is not
visible.  private is probably the appropriate modifier for the variable,
but perhaps protected methods named view(), table(), toolbar(), etc. could
be added to allow subclasses to read the value of the variable without
initializing it.  I can create a patch if you think that is alright.

Original issue reported on code.google.com by bgo...@e1b.org on 3 Dec 2008 at 3:31

GoogleCodeExporter commented 8 years ago
This has been something I have been wanting to take care of for some time now. 
After
thinking about it for awhile I think the simplest approach would be to have 
protected
methods for the exports. There are now a few new protected methods in the
TableFacadeImpl...

protected Table getExportTable(ExportType exportType);
protected View getExportView(ExportType exportType);
protected void renderExport(ExportType exportType, View view)

These are checked in on the trunk...let me know if this works for you!

Original comment by jeff.johnston.mn@gmail.com on 4 Dec 2008 at 5:28

GoogleCodeExporter commented 8 years ago

Original comment by jeff.johnston.mn@gmail.com on 6 Dec 2008 at 10:51