Changeset 3946


Ignore:
Timestamp:
Nov 4, 2010, 4:02:25 PM (13 years ago)
Author:
Gregory Vincic
Message:

Refs #698. Removed method addTableRow from FormFactory, also implemented Cell content translation if translate is set to true.

Location:
trunk/client/servlet/src/org/proteios/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java

    r3945 r3946  
    11/*
    22    $Id$
    3                                        
     3                                           
    44    Copyright (C) 2006, 2007 Fredrik Levander, Gregory Vincic, Olle Mansson
    5                                        
     5                                           
    66    Files are copyright by their respective authors. The contributions to
    77    files where copyright is not explicitly stated can be traced with the
    88    source code revision system.
    9                                        
     9                                           
    1010    This file is part of Proteios.
    1111    Available at http://www.proteios.org/
    12                                        
     12                                           
    1313    proteios-2.x is free software; you can redistribute it and/or
    1414    modify it under the terms of the GNU General Public License
    1515    as published by the Free Software Foundation; either version 2
    1616    of the License, or (at your option) any later version.
    17                                        
     17                                           
    1818    Proteios is distributed in the hope that it will be useful,
    1919    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2020    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2121    GNU General Public License for more details.
    22                                        
     22                                           
    2323    You should have received a copy of the GNU General Public License
    2424    along with this program; if not, write to the Free Software
     
    6868    private HttpServletRequest request = null;
    6969    private SessionControl sc = null;
    70                        
     70                           
    7171    private Localizer locale = null;
    7272    private String forwardActionId = null;
     
    160160    private static final org.apache.log4j.Logger log = org.apache.log4j.LogManager
    161161    .getLogger("org.proteios.gui.form");
    162                                        
     162                                           
    163163    public void setActionFactory(ActionFactory af)
    164164    {
    165165        this.actionFactory = af;
    166166    }
    167                                        
     167                                           
    168168    public String getForwardActionId()
    169169    {
    170170        return this.forwardActionId;
    171171    }
    172                                        
     172                                           
    173173    public void setForwardActionId(String forwardActionId)
    174174    {
    175175        this.forwardActionId = forwardActionId;
    176176    }
    177                                        
     177                                           
    178178    public HttpServletRequest getRequest()
    179179    {
    180180        return request;
    181181    }
    182                                        
     182                                           
    183183    public void setRequest(HttpServletRequest request)
    184184    {
    185185        this.request = request;
    186186    }
    187                                        
     187                                           
    188188    public void modifyForPopup(Fieldset fs)
    189189    {
    190190        actionFactory.modifyForPopup(fs);
    191191    }
    192                                        
     192                                           
    193193    private FileField newFileField()
    194194    {
     
    197197        return fileF;
    198198    }
    199                                        
     199                                           
    200200    public TextField<Integer> newIdField()
    201201    {
     
    205205        return idF;
    206206    }
    207                                        
     207                                           
    208208    public TextField<String> newValueField(String setValueMethodName,
    209209    Class<?> valueClass)
     
    237237        return valueF;
    238238    }
    239                                        
     239                                           
    240240    public TextField<Integer> newHiddenItemIdField()
    241241    {
     
    243243        return field;
    244244    }
    245                                        
     245                                           
    246246    private TextField<Integer> newHiddenIntegerField(VInteger vInteger)
    247247    {
     
    250250        return field;
    251251    }
    252                                        
     252                                           
    253253    private TextField<String> newHiddenStringField(VString vString)
    254254    {
     
    257257        return field;
    258258    }
    259                                        
     259                                           
    260260    public <D extends BasicItem<?>, E extends ProteiosAction<?>> Form getAnnotationsForm(
    261261    DbControl dc, D item, Class<E> forwardAction)
     
    307307        return form;
    308308    }
    309                                        
     309                                           
    310310    /**
    311311        @return Hidden
     
    317317        return field;
    318318    }
    319                                        
     319                                           
    320320    /**
    321321        Form for user preferences configuration settings. Arguments
     
    323323        holders for current values for the notification configuration and table
    324324        preferences configuration form fields.
    325                                                                                
     325                                                                                       
    326326        @param nc NotificationConfiguration object (need not be stored in
    327327        database) with default field values.
     
    341341        return form;
    342342    }
    343                                        
     343                                           
    344344    /**
    345345        Fieldset for notification configuration settings. Argument
    346346        NotificationConfiguration is place holder for current values for the
    347347        notification configuration form fields.
    348                                                                                
     348                                                                                       
    349349        @param nc NotificationConfiguration object (need not be stored in
    350350        database) with default field values.
     
    398398        return properties;
    399399    }
    400                                        
     400                                           
    401401    /**
    402402        Creates a select box for notification mode.
    403                                                                                
     403                                                                                       
    404404        @param modeValue int Mode value for default selection.
    405405        @return Select<VInteger> Select box for notification mode selection
     
    426426        return modeS;
    427427    }
    428                                        
     428                                           
    429429    /**
    430430        Fieldset for table preferences configuration settings. Argument
    431431        TablePreferencesConfiguration is place holder for current values for the
    432432        table preferences configuration form fields.
    433                                                                                
     433                                                                                       
    434434        @param tpc TablePreferencesConfiguration object (need not be stored in
    435435        database) with default field values.
     
    461461        return properties;
    462462    }
    463                                        
     463                                           
    464464    /**
    465465        Creates a select box for table preferences mode.
    466                                                                                
     466                                                                                       
    467467        @param modeValue int Mode value for default selection.
    468468        @return Select<VInteger> Select box for table preferences mode selection
     
    489489        return modeS;
    490490    }
    491                                        
     491                                           
    492492    /**
    493493        @param a annotation
     
    502502        return sb.toString();
    503503    }
    504                        
     504                           
    505505    /**
    506506        This will probably be removed when fixint #691
     
    601601        return form;
    602602    }
    603                                        
     603                                           
    604604    /**
    605605        @param hit Current Hit
     
    817817        return form;
    818818    }
    819                                        
     819                                           
    820820    /**
    821821        Returns a form for selecting spectrum mass range limits.
    822                                                                                
     822                                                                                       
    823823        @param massCutoffLow String The lower cutoff mass value.
    824824        @param massCutoffHigh String The upper cutoff mass value.
     
    866866        return form;
    867867    }
    868                                        
     868                                           
    869869    /**
    870870        Returns a form with spectrum properties for a spectrum obtained from a
    871871        spectrum file.
    872                                                                                
     872                                                                                       
    873873        @param spectrumFile File Core file with spectrum.
    874874        @param spectrumId String Spectrum id string.
     
    897897            peakListFileName = spectrumFile.getName();
    898898        }
    899         addTableRow(propertiesTable, "Filename", peakListFileName, null, 0);
     899        propertiesTable.addRow( new PropertyRow(0, "Filename", peakListFileName));
    900900        /*
    901901            File type
     
    909909            }
    910910        }
    911         addTableRow(propertiesTable, "FileType", spectrumFileType, null, 0);
     911        propertiesTable.addRow( new PropertyRow(0, "FileType", spectrumFileType));
    912912        /*
    913913            SpectrumId
     
    918918            spectrumIdStr = spectrumId;
    919919        }
    920         addTableRow(propertiesTable, "SpectrumId", spectrumIdStr, null, 0);
     920        propertiesTable.addRow( new PropertyRow(0, "SpectrumId", spectrumIdStr));
    921921        /*
    922922            Retention time in minutes
     
    936936            }
    937937        }
    938         addTableRow(propertiesTable, "RetentionTimeInMinutes",
    939         timeInMinutesStr, null, 0);
     938        propertiesTable.addRow( new PropertyRow(0, "RetentionTimeInMinutes",
     939        timeInMinutesStr));
    940940        /***********************************************************************
    941941            Optional spectrum fieldset
     
    969969                        for (PrecursorSelectedIon selectedIon : selectedIonList)
    970970                        {
    971                             addTableRow(precursorTable, "charge state",
    972                             selectedIon.getCharge(), null, 0);
    973                             addTableRow(precursorTable, "m/z", selectedIon
    974                             .getMassToChargeRatio(), null, 0);
    975                             addTableRow(precursorTable, "intensity",
    976                             selectedIon.getIntensity(), null, 0);
     971                            precursorTable.addRow( new PropertyRow(0, "charge state",
     972                            selectedIon.getCharge()));
     973                            precursorTable.addRow( new PropertyRow(0, "m/z", selectedIon
     974                            .getMassToChargeRatio()));
     975                            precursorTable.addRow( new PropertyRow(0, "intensity",
     976                            selectedIon.getIntensity()));
    977977                            // Selected ion extra data
    978978                            List<StringPairInterface> dataList = selectedIon
     
    989989                                        if (name != null && !name.equals(""))
    990990                                        {
    991                                             addTableRow(precursorTable, name,
    992                                             value, null, 0);
     991                                            precursorTable.addRow( new PropertyRow(0, name,
     992                                            value));
    993993                                        }
    994994                                    }
     
    999999                    else
    10001000                    {
    1001                         addTableRow(precursorTable, "charge state", pc
    1002                         .getCharge(), null, 0);
    1003                         addTableRow(precursorTable, "m/z", pc
    1004                         .getMassToChargeRatio(), null, 0);
    1005                         addTableRow(precursorTable, "intensity", pc
    1006                         .getIntensity(), null, 0);
     1001                        precursorTable.addRow( new PropertyRow(0, "charge state", pc
     1002                        .getCharge()));
     1003                        precursorTable.addRow( new PropertyRow(0, "m/z", pc
     1004                        .getMassToChargeRatio()));
     1005                        precursorTable.addRow( new PropertyRow(0, "intensity", pc
     1006                        .getIntensity()));
    10071007                    }
    10081008                    /*
     
    10211021                                if (name != null && !name.equals(""))
    10221022                                {
    1023                                     addTableRow(precursorTable, name, value,
    1024                                     null, 0);
     1023                                    precursorTable.addRow( new PropertyRow(0, name, value,
     1024                                    null));
    10251025                                }
    10261026                            }
     
    10341034                    String fragmentationTypeStr = new String(
    10351035                    "FragmentationType");
    1036                     addTableRow(precursorTable, fragmentationTypeStr,
    1037                     fragmentationType, null, 0);
     1036                    precursorTable.addRow( new PropertyRow(0, fragmentationTypeStr,
     1037                    fragmentationType));
    10381038                    //
    10391039                    propertiesFS.add(precursorTable);
     
    10631063                            if (name != null && !name.equals(""))
    10641064                            {
    1065                                 addTableRow(extraDataTable, name, value, null,
    1066                                 0);
     1065                                extraDataTable.addRow( new PropertyRow(0, name, value));
    10671066                            }
    10681067                        }
     
    10791078        return form;
    10801079    }
    1081                                        
    1082     /**
    1083         Adds a table row to a table. A "value" argument that is null will be
    1084         represented as an empty string, otherwise by its toString() value.
    1085                                                                                
    1086         @param table Table The table to add a row to.
    1087         @param nameKey String Property key string.
    1088         @param value Object Property value object.
    1089         @param actionClass Class<E extends ProteiosAction> Optional value cell
    1090         action.
    1091         @param itemId int The item id to use for an optional action.
    1092     */
    1093     private void addTableRow(Table table, String nameKey, Object value,
    1094     Class<? extends ProteiosAction> actionClass, int itemId)
    1095     {
    1096         // Convert value to string, with empty string for null value
    1097         String valueStr = new String("");
    1098         if (value != null)
    1099         {
    1100             // Convert value to string
    1101             valueStr = "" + value;
    1102         }
    1103         //
    1104         // Construct row
    1105         String rowTitle = new String(nameKey);
    1106         Row row = new Row(rowTitle);
    1107         Cell<String> nameCell = new Cell<String>(locale.get(nameKey));
    1108         Cell<String> valueCell = new Cell<String>(valueStr);
    1109         // Check if value cell should be coupled to action
    1110         if (actionClass != null)
    1111         {
    1112             // Add action link to value cell
    1113             ActionLink cellAction = actionFactory.getActionLink(
    1114             actionClass, actionClass.getName());
    1115             cellAction.addParameter(ItemIdField.VPARAM, itemId);
    1116             valueCell.setActionLink(cellAction);
    1117         }
    1118         row.addCell(nameCell);
    1119         row.addCell(valueCell);
    1120         table.addRow(row);
    1121     }
    1122                                        
     1080                                           
    11231081    /**
    11241082        Returns a form with spectrum file contact data for a spectrum file.
    1125                                                                                
     1083                                                                                       
    11261084        @param spectrumContact Spectrum file contact
    11271085        data.
     
    11531111            name = spectrumContact.getName();
    11541112        }
    1155         addTableRow(contactTable, "Name", name, null, 0);
     1113        contactTable.addRow(new PropertyRow(0 , "Name", name));
    11561114        /*
    11571115            Institution
     
    11621120            institution = spectrumContact.getInstitution();
    11631121        }
    1164         addTableRow(contactTable, "Institution", institution, null, 0);
     1122        contactTable.addRow( new PropertyRow(0, "Institution", institution));
    11651123        /*
    11661124            ContactInfo
     
    11711129            contactInfo = spectrumContact.getContactInfo();
    11721130        }
    1173         addTableRow(contactTable, "ContactInfo", contactInfo, null, 0);
     1131        contactTable.addRow( new PropertyRow(0, "ContactInfo", contactInfo));
    11741132        /*
    11751133            Address
     
    11801138            address = spectrumContact.getAddress();
    11811139        }
    1182         addTableRow(contactTable, "Address", address, null, 0);
     1140        contactTable.addRow( new PropertyRow(0, "Address", address));
    11831141        /*
    11841142            URL
     
    11891147            url = spectrumContact.getUrl();
    11901148        }
    1191         addTableRow(contactTable, "URL", url, null, 0);
     1149        contactTable.addRow( new PropertyRow(0, "URL", url));
    11921150        /*
    11931151            Email
     
    11981156            email = spectrumContact.getEmail();
    11991157        }
    1200         addTableRow(contactTable, "Email", email, null, 0);
     1158        contactTable.addRow( new PropertyRow(0, "Email", email));
    12011159        /***********************************************************************
    12021160            Form
     
    12061164        return form;
    12071165    }
    1208                                            
     1166                                               
    12091167    /**
    12101168        Returns a form for adding spectrum file sample data for a spectrum file.
    1211                                                                                
     1169                                                                                       
    12121170        @param project Project The project in whose directory a new output
    12131171        directory is created.
     
    12991257        return form;
    13001258    }
    1301                                        
     1259                                           
    13021260    private <D extends Object> TextField<D> newTextField(String name, D value)
    13031261    {
     
    13081266        return field;
    13091267    }
    1310                                        
     1268                                           
    13111269    public Form getPeakListSetForm(PeakListSet pls)
    13121270    {
     
    13761334        return form;
    13771335    }
    1378                                        
     1336                                           
    13791337    private void addAnnotationsAsFields(Fieldset to, Annotatable item,
    13801338    DbControl dc)
     
    13911349        }
    13921350    }
    1393                                        
     1351                                           
    13941352    public Fieldset getProteinAssemblyFieldset(Project project)
    13951353    {
     
    14141372        return properties;
    14151373    }
    1416                                        
     1374                                           
    14171375    public Select<VString> selectLocalSampleIdWithAllOption(DbControl dc,
    14181376    Project project)
     
    14281386        return select;
    14291387    }
    1430                                        
     1388                                           
    14311389    private Select<VInteger> newSelectLabel(LabeledExtract le, DbControl dc)
    14321390    {
     
    14491407        return select;
    14501408    }
    1451                                        
     1409                                           
    14521410    /**
    14531411        Creates and adds a hidden field with an Integer value to the given form.
     
    14611419        form.getFieldsets().get(0).add(field);
    14621420    }
    1463                                        
     1421                                           
    14641422    /**
    14651423        Creates and adds a hidden field with an Integer value to the given table.
     
    14731431        table.add(field);
    14741432    }
    1475                                        
     1433                                           
    14761434    public Fieldset getUsedSampleFieldset(Sample sample)
    14771435    {
     
    14911449        return fs;
    14921450    }
    1493                                        
     1451                                           
    14941452    public Fieldset getUsedExtractFieldset(Extract extract)
    14951453    {
     
    15061464        return fs;
    15071465    }
    1508                                        
     1466                                           
    15091467    public Fieldset getUsedLabeledExtractFieldset(LabeledExtract extract)
    15101468    {
     
    15241482        return fs;
    15251483    }
    1526                                        
     1484                                           
    15271485    public Form getSecondaryLabeledExtractForm(LabeledExtract extract,
    15281486    DbControl dc, LabeledExtract fromExtract)
     
    15871545        return form;
    15881546    }
    1589                
     1547                   
    15901548    public TextField<Float> newOriginalQuantityField()
    15911549    {
     
    15951553        return field;
    15961554    }
    1597                                        
     1555                                           
    15981556    public TextField<Float> newRemainingQuantityField(Float remainingQuantity)
    15991557    {
     
    16061564        return field;
    16071565    }
     1566                                           
     1567    private Localizer getLocale()
     1568    {
     1569        return locale;
     1570    }
     1571                                           
     1572    public void setLocale(Localizer locale)
     1573    {
     1574        this.locale = locale;
     1575    }
     1576                                           
     1577    //Cleaning up from here       
    16081578                                       
    1609     private Localizer getLocale()
    1610     {
    1611         return locale;
    1612     }
    1613                                        
    1614     public void setLocale(Localizer locale)
    1615     {
    1616         this.locale = locale;
    1617     }
    1618                                        
    1619     //Cleaning up from here       
    1620                                    
    16211579    /**
    16221580        Form for new Protocol item. The difference between calling
     
    16291587        a convenient place holder for default values for the Protocol form
    16301588        fields.
    1631                                                                                
     1589                                                                                       
    16321590        @param protocol Protocol object (need not be stored in database) with
    16331591        default field values.
     
    17141672        return form;
    17151673    }
    1716                                        
     1674                                           
    17171675    public Form getForm(Class<?> cls)
    17181676    {
     
    18041762            loginF.setDisabled(true);
    18051763            fs.add(fs.size()-2, loginF); // After the itemId field
    1806                                                                                                            
     1764                                                                                                                       
    18071765            TextField<String> emailF = new EmailField();
    18081766            fs.add(fs.size()-1, emailF);
    1809                                                                                                                        
     1767                                                                                                                                   
    18101768            TextField<String> phoneF = new PhoneField();
    18111769            fs.add(phoneF);
    1812                                                                                                                        
     1770                                                                                                                                   
    18131771            TextField<String> addressF = new AddressField();
    18141772            fs.add(addressF);
    1815                                                                                                                        
     1773                                                                                                                                   
    18161774            TextField<String> organisationF = new OrganisationField();
    18171775            fs.add(organisationF);
    1818                                                                                                                        
     1776                                                                                                                                   
    18191777            if (obj != null)
    18201778            {
     
    21472105        return form;
    21482106    }
    2149                                        
     2107                                           
    21502108    /**
    21512109        Creates a select box for protocols. If the class for which the protocol
     
    21552113        if the protocol is tagged to be removed. However, no other protocols
    21562114        tagged to be removed should be included in the list.
    2157                                                                                
     2115                                                                                       
    21582116        @param cls Class Class for which a protocol should be selected.
    21592117        @param obj Object Optional object with attached protocol for setting
     
    22622220        return protocolS;
    22632221    }
    2264                                        
     2222                                           
    22652223    public void setSc(SessionControl sc)
    22662224    {
  • trunk/client/servlet/src/org/proteios/gui/table/PropertyRow.java

    r3945 r3946  
    11/*
    22    $Id$
    3        
     3           
    44    Copyright (C) 2010 Gregory Vincic
    5        
     5           
    66    Files are copyright by their respective authors. The contributions to
    77    files where copyright is not explicitly stated can be traced with the
    88    source code revision system.
    9        
     9           
    1010    This file is part of Proteios.
    1111    Available at http://www.proteios.org/
    12        
     12           
    1313    Proteios is free software; you can redistribute it and/or
    1414    modify it under the terms of the GNU General Public License
    1515    as published by the Free Software Foundation; either version 2
    1616    of the License, or (at your option) any later version.
    17        
     17           
    1818    Proteios is distributed in the hope that it will be useful,
    1919    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2020    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    2121    GNU General Public License for more details.
    22        
     22           
    2323    You should have received a copy of the GNU General Public License
    2424    along with this program; if not, write to the Free Software
     
    3838public final class PropertyRow extends Row
    3939{
    40     public PropertyRow(int id, String name, String value, ActionLink action)
     40    public PropertyRow(int id, String name, Object value, ActionLink action)
    4141    {
    4242        super(id);
     
    4646        nameCell = new Cell<String>(name);
    4747        nameCell.setTranslate(true);
    48        
     48               
    4949        valueStr = (value != null) ? value.toString() : "";
    5050        valueCell = new Cell<String>(valueStr);
    51        
     51               
    5252        if (action != null)
    5353        {
     
    5858        addCell(valueCell);
    5959    }
     60   
     61    public PropertyRow(int id, String name, Object value )
     62    {
     63        this(id, name, value, null);
     64    }
    6065}
    6166
  • trunk/client/servlet/src/org/proteios/gui/web/GUIConverter.java

    r3943 r3946  
    11/*
    22    $Id$
    3        
     3           
    44    Copyright (C) 2006 Gregory Vincic
    55    Copyright (C) 2007 Gregory Vincic, Olle Mansson
    6        
     6           
    77    Files are copyright by their respective authors. The contributions to
    88    files where copyright is not explicitly stated can be traced with the
    99    source code revision system.
    10        
     10           
    1111    This file is part of Proteios.
    1212    Available at http://www.proteios.org/
    13        
     13           
    1414    Proteios-2.x is free software; you can redistribute it and/or
    1515    modify it under the terms of the GNU General Public License
    1616    as published by the Free Software Foundation; either version 2
    1717    of the License, or (at your option) any later version.
    18        
     18           
    1919    Proteios is distributed in the hope that it will be useful,
    2020    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2121    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2222    GNU General Public License for more details.
    23        
     23           
    2424    You should have received a copy of the GNU General Public License
    2525    along with this program; if not, write to the Free Software
     
    8181import org.proteios.gui.table.Row;
    8282import org.proteios.gui.table.TreeRow;
     83import se.lu.thep.waf.constraints.VParameter;
    8384import se.lu.thep.waf.constraints.VString;
    84 import se.lu.thep.waf.constraints.VParameter;
    8585import se.lu.thep.waf.dom.html.A;
    8686import se.lu.thep.waf.dom.html.Area;
     
    133133    private String currentFormId = null;
    134134    private TypeUtil typeUtil = new TypeUtil();
    135        
     135           
    136136    public HttpServletRequest getRequest()
    137137    {
    138138        return request;
    139139    }
    140        
     140           
    141141    public void setRequest(HttpServletRequest request)
    142142    {
     
    144144        hf.setRequest(request);
    145145    }
    146        
     146           
    147147    public GUIConverter(String contextPath)
    148148    {
     
    152152        this.hf = new HtmlFactory(contextPath);
    153153    }
    154        
     154           
    155155    private Random r = new Random();
    156        
     156           
    157157    public Tag convert(Image img)
    158158    {
     
    239239        return div;
    240240    }
    241        
     241           
    242242    public Tag convert(IFrame obj)
    243243    {
     
    251251        return tag;
    252252    }
    253        
     253           
    254254    public Tag convert(Listing list)
    255255    {
     
    286286        return layout;
    287287    }
    288        
     288           
    289289    /**
    290290        * @param action
     
    298298            String jsMethod = "goToLocation";
    299299            sb.append(jsMethod + "('");
    300       sb.append(this.contextPath);
    301       sb.append("?action=");
     300            sb.append(this.contextPath);
     301            sb.append("?action=");
    302302            sb.append(action.toString());
    303303            sb.append("')");
     
    305305        return sb.toString();
    306306    }
    307        
     307           
    308308    public Tag convert(org.proteios.gui.TreeMenu menu)
    309309    {
     
    317317        return layout.getRoot();
    318318    }
    319        
     319           
    320320    public Tag convert(org.proteios.gui.MainMenu menu)
    321321    {
    322322        Tag div, ul;
    323                
     323                       
    324324        div = hf.newLayoutDiv();
    325325        ul = convert((org.proteios.gui.TreeMenu) menu);
    326                
     326                       
    327327        div.add(ul);
    328328        return div;
    329329    }
    330        
     330           
    331331    public String convert(ClosePopup button)
    332332    {
    333333        return "closeAllVisiblePopups()";
    334334    }
    335        
     335           
    336336    public Tag<?> convert(ActionLink pageLink, String formId, boolean localize)
    337337    {
     
    350350        return tag;
    351351    }
    352        
     352           
    353353    /**
    354354        * Converts an ActionLink such that each parameter of the ActionLink is a
     
    386386        return js.toString();
    387387    }
    388        
     388           
    389389    public Tag convert(Scroller scroller, String formId)
    390390    {
     
    449449        return scrollBar.getRoot();
    450450    }
    451        
     451           
    452452    /**
    453453        * @param table to convert
     
    489489                    }
    490490                }
    491                                
     491                                               
    492492            }
    493493            scroller = table.getScroller();
     
    583583                        // Column display order select box
    584584                        Integer colDisplayOrder = col.getDisplayOrder();
    585                                                
     585                                                                       
    586586                        if (ad.getKey().equals("Id"))
    587587                        {
     
    611611                            tr.newTd().add(displayOrderSelectBox);
    612612                        }
    613                                                            
     613                                                                                   
    614614                        // Order by
    615615                        if (col.getDisplayFilter())
     
    896896        return layout.getRoot();
    897897    }
    898        
     898           
    899899    public Tag convert(org.proteios.gui.table.FolderTable table)
    900900    {
     
    946946        return layout.getRoot();
    947947    }
    948        
     948           
    949949    public Tr convert(Row row)
    950950    {
     
    965965        return tr;
    966966    }
    967        
     967           
    968968    public Tr convert(TreeRow row)
    969969    {
     
    992992        return tr;
    993993    }
    994        
     994           
    995995    public Tag convert(Separator sep)
    996996    {
    997997        return new Hr();
    998998    }
    999        
     999           
    10001000    public <D extends Object> Tag convert(Cell<D> cell)
    10011001    {
     
    10351035        {
    10361036            strValue = String.valueOf(value);
     1037            if(cell.getTranslate())
     1038            {
     1039                strValue = locale.get(strValue);
     1040            }
    10371041        }
    10381042        // Fixes empty td tags displaying border
     
    10721076        return td;
    10731077    }
    1074        
     1078           
    10751079    public Tag convert(Column col)
    10761080    {
     
    10811085        return th;
    10821086    }
    1083        
     1087           
    10841088    public Tag convert(Column col, org.proteios.gui.table.Table table)
    10851089    {
     
    11021106        return th;
    11031107    }
    1104        
     1108           
    11051109    public Tag convert(Text txt)
    11061110    {
     
    11101114        return layout;
    11111115    }
    1112        
     1116           
    11131117    public Tag convert(TitledWindow win)
    11141118    {
     
    11531157        return window.getRoot();
    11541158    }
    1155        
     1159           
    11561160    @SuppressWarnings("unused")
    11571161    public Tag convert(Space space)
     
    11591163        return new Div().setClass("space");
    11601164    }
    1161        
     1165           
    11621166    public Tag convert(Message msg)
    11631167    {
     
    11661170        return layout.getRoot();
    11671171    }
    1168        
     1172           
    11691173    int idCounter = 0;
    11701174    String lastId = "";
    1171        
     1175           
    11721176    public String nextId()
    11731177    {
     
    11761180        return lastId;
    11771181    }
    1178        
     1182           
    11791183    public String getLastId()
    11801184    {
    11811185        return lastId;
    11821186    }
    1183        
     1187           
    11841188    public Tag convert(org.proteios.gui.Error err)
    11851189    {
     
    11881192        return layout.getRoot();
    11891193    }
    1190        
     1194           
    11911195    public Tag convert(org.proteios.gui.form.Form w)
    11921196    {
     
    11971201        Input field;
    11981202        AbstractLink defaultAction;
    1199                
     1203                       
    12001204        layout = hf.newLayoutDiv();
    12011205        clearForm = false;
     
    12421246        return layout.getRoot();
    12431247    }
    1244        
     1248           
    12451249    public Tag convert(org.proteios.gui.form.Fieldset fs)
    12461250    {
    12471251        return convertFieldset(fs, null, false);
    12481252    }
    1249        
     1253           
    12501254    private int fieldsetId = 0;
    12511255    private int nextFieldsetId() { fieldsetId++; return fieldsetId; }
    1252    
     1256       
    12531257    private Tag convertFieldset(org.proteios.gui.form.Fieldset fs, Form form, Boolean useToggle)
    12541258    {
     
    12731277            btn.setSrc(fs.isOpen() ? "static/img/minus.gif" : "static/img/plus.gif");
    12741278        }
    1275        
     1279               
    12761280        if (fs.getTitle()!= null)
    12771281        {
     
    12861290        }
    12871291        legend.add(title.getRoot());
    1288                
     1292                       
    12891293        fields = fieldset.newDiv().setClass("fields");
    12901294        fields.setId(id);
     
    12971301        return fieldset;
    12981302    }
    1299    
     1303       
    13001304    private Tag addFieldAsRow(Tag table, org.proteios.gui.GUIElement f, Form form)
    13011305    {
     
    13461350                input = convert((org.proteios.gui.form.Checkbox) f, false);
    13471351            }
    1348                                
    1349       VParameter param = field.getParam();
    1350  
     1352                                          
     1353            VParameter param = field.getParam();
     1354            
    13511355            if (param != null && (param.isRequired() ||
    13521356            (param instanceof VString && ((VString) param).getMinCharacterLength() > 0)))
     
    13581362                row.newTd().add(input);
    13591363            }
    1360                            
     1364                                       
    13611365            // Help and error field
    13621366            helpC = row.newTd();
     
    13761380            {
    13771381                Tag subRow = addFieldAsRow(table, subf, form);
    1378           Tag labeltd = (Tag) subRow.getElements().get(0); // the td tag
    1379         labeltd.addClass("subfield");
     1382                Tag labeltd = (Tag) subRow.getElements().get(0); // the td tag
     1383                labeltd.addClass("subfield");
    13801384            }
    13811385            table.newTr().newTd().setAttribute(new Attribute("colspan", "2")).setClass("subend").newBr();
     
    13831387        return row;
    13841388    }
    1385        
     1389           
    13861390    private Tag convert(FileField f)
    13871391    {
     
    13941398        return in;
    13951399    }
    1396        
     1400           
    13971401    public Tag convert(org.proteios.gui.form.Select<?> select)
    13981402    {
     
    14561460        return field;
    14571461    }
    1458        
     1462           
    14591463    public Tag convert(ColumnContainer container)
    14601464    {
     
    14811485        return layout;
    14821486    }
    1483        
     1487           
    14841488    public Tag convert(org.proteios.gui.Empty empty)
    14851489    {
    14861490        return new Span().newCData("&nbsp;");
    14871491    }
    1488        
     1492           
    14891493    public Tag convert(RowContainer container)
    14901494    {
     
    15091513        return span;
    15101514    }
    1511        
     1515           
    15121516    private int treeLevel = 0;
    1513        
     1517           
    15141518    public Tag convert(Node node)
    15151519    {
     
    15821586                    childHref.addClass("last");
    15831587                }
    1584                                
     1588                                               
    15851589                if (first)
    15861590                first = false;
     
    15911595        return li;
    15921596    }
    1593        
     1597           
    15941598    /**
    15951599        * Convenience method for getting path to a bullet/spacer image file marking
     
    16201624        return iconPath;
    16211625    }
    1622        
     1626           
    16231627    /**
    16241628        * Converts a toolbar so that button clicks post the form referenced by
     
    16891693        return new CData("");
    16901694    }
    1691        
     1695           
    16921696    public Tag convert(org.proteios.gui.TabSet set)
    16931697    {
     
    17161720        return layout;
    17171721    }
    1718        
     1722           
    17191723    private Tag convert(org.proteios.gui.Tab tab, boolean convertTabContent)
    17201724    {
     
    17351739        return li;
    17361740    }
    1737        
     1741           
    17381742    private Tag convert(org.proteios.gui.form.TextArea f)
    17391743    {
     
    17521756        return in;
    17531757    }
    1754        
     1758           
    17551759    private String formatedValue(TextField<?> f)
    17561760    {
     
    17661770        return value;
    17671771    }
    1768        
     1772           
    17691773    private <D extends Object> Tag<?> convert(
    17701774    org.proteios.gui.form.TextField<D> f)
     
    17741778        Input in;
    17751779        Tag<?> field;
    1776                
     1780                       
    17771781        // Format the value
    17781782        value = formatedValue(f);
    17791783        container = new CData("");
    1780                
     1784                       
    17811785        in = null;
    17821786        type = "text";
     
    17911795            value = "";
    17921796        }
    1793     VParameter param = f.getParam();
    1794 
     1797        VParameter param = f.getParam();
     1798       
    17951799        if (param != null && (param.isRequired() ||
    17961800        (param instanceof VString && ((VString) param).getMinCharacterLength() > 0)))
     
    18071811        return container;
    18081812    }
    1809        
     1813           
    18101814    private Tag<?> convert(org.proteios.gui.form.PasswordField f)
    18111815    {
     
    18181822        return in;
    18191823    }
    1820        
     1824           
    18211825    public Tag<?> convert(org.proteios.gui.form.Checkbox<?> checkbox)
    18221826    {
    18231827        return convert(checkbox, false);
    18241828    }
    1825        
     1829           
    18261830    private Tag<?> convert(org.proteios.gui.form.Checkbox<?> checkbox,
    18271831    boolean inForm)
     
    18441848        return cbF;
    18451849    }
    1846        
     1850           
    18471851    public Tag<?> convert(org.proteios.gui.Toolbar toolbar)
    18481852    {
     
    19101914        return layout.getRoot();
    19111915    }
    1912        
     1916           
    19131917    public Tag<?> convert(org.proteios.gui.Button button)
    19141918    {
     
    19771981        return layout.getRoot();
    19781982    }
    1979        
     1983           
    19801984    public Tag<?> convert(org.proteios.gui.ButtonSet toolbar)
    19811985    {
     
    19841988        return layout;
    19851989    }
    1986        
     1990           
    19871991    public Tag<?> convert(org.proteios.gui.Title title)
    19881992    {
     
    20042008        return hx.getRoot();
    20052009    }
    2006        
     2010           
    20072011    @Override
    20082012    public Tag missingConverter(ConvertableElement obj)
     
    20142018        return div;
    20152019    }
    2016        
     2020           
    20172021    public void setLocale(Localizer locale)
    20182022    {
     
    20242028        }
    20252029    }
    2026        
     2030           
    20272031    public void setIconSet(Properties iconSet)
    20282032    {
Note: See TracChangeset for help on using the changeset viewer.