Changeset 3924


Ignore:
Timestamp:
Oct 29, 2010, 2:38:01 PM (13 years ago)
Author:
Gregory Vincic
Message:

Refs #698. Fixed plugin selection form for import, convert and analyse extensions. Related classes now use one view class SelectPluginView?.

Location:
trunk/client/servlet/src
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/locale/en/dictionary

    r3907 r3924  
    6969AssociatedFiles=Associated Files
    7070Attribute=Attribute
     71Attributes=Attributes
    7172AvailableGels=Available gels
    7273Basic=Basic
     
    556557Owner=Owner
    557558Own=Own
     559Parameters=Parameters
    558560ParentPeakListSet=Parent peaklistset
    559561Password=Password
     
    755757SeparationMethod=Separation Method
    756758SeparationMethods=Separation Methods
     759SessionAttributes=Session Attributes
    757760Sequence=Sequence
    758761ServerDescription=Server description
  • trunk/client/servlet/src/org/proteios/action/file/AnalyzeFilesForm.java

    r3807 r3924  
    11/*
    2  Copyright (C) 2006 Gregory Vincic
    3 
    4  This file is part of Proteios.
    5  Available at http://www.proteios.org/
    6 
    7  Proteios is free software; you can redistribute it and/or modify it
    8  under the terms of the GNU General Public License as published by
    9  the Free Software Foundation; either version 2 of the License, or
    10  (at your option) any later version.
    11 
    12  Proteios is distributed in the hope that it will be useful, but
    13  WITHOUT ANY WARRANTY; without even the implied warranty of
    14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    15  General Public License for more details.
    16 
    17  You should have received a copy of the GNU General Public License
    18  along with this program; if not, write to the Free Software
    19  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    20  02111-1307, USA.
    21  */
     2    Copyright (C) 2006 Gregory Vincic
     3    Copyright (C) 2010 Gregory Vincic
     4   
     5    This file is part of Proteios.
     6    Available at http://www.proteios.org/
     7   
     8    Proteios is free software; you can redistribute it and/or modify it
     9    under the terms of the GNU General Public License as published by
     10    the Free Software Foundation; either version 2 of the License, or
     11    (at your option) any later version.
     12   
     13    Proteios is distributed in the hope that it will be useful, but
     14    WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16    General Public License for more details.
     17   
     18    You should have received a copy of the GNU General Public License
     19    along with this program; if not, write to the Free Software
     20    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     21    02111-1307, USA.
     22*/
    2223package org.proteios.action.file;
    2324
     25import java.util.ArrayList;
     26import java.util.List;
    2427import org.proteios.ActionLink;
    2528import org.proteios.Context;
     
    3336import org.proteios.gui.form.Fieldset;
    3437import org.proteios.gui.form.Form;
     38import org.proteios.gui.form.FormFactory;
    3539import org.proteios.gui.form.SelectPluginForm;
    36 import org.proteios.gui.form.FormFactory;
    3740import org.proteios.gui.form.TextField;
    3841import org.proteios.gui.layout.RowLayout;
    39 
    4042import se.lu.thep.waf.ActionException;
    4143import se.lu.thep.waf.constraints.InvalidParameterValue;
    4244
    43 import java.util.ArrayList;
    44 import java.util.List;
    45 
    4645/**
    47  * This action presents a form where the user can select an analysis plugin to run on selected files.
    48  *
    49  * @author fredrik
    50  */
     46    This action presents a form where the user can select an analysis plugin to run on selected files.
     47*/
    5148public class AnalyzeFilesForm
    52     extends ProteiosAction<AnalyzeFilesForm>
    53     implements ContextEnabled
     49extends ProteiosAction<AnalyzeFilesForm>
     50implements ContextEnabled
    5451{
    55 
    56   @Override
    57   protected void runMe()
    58       throws ActionException, InvalidParameterValue
    59   {
    60     /*
    61      * Get the id's of all selected files. FormFactory.VID is the valid
    62      * identifier used when rendering the list of files, thus we use it to
    63      * get the valid list of item ids.
    64      */
    65     List<Integer> files = getValidIntegerList(FormFactory.VID);
    66     /*
    67      * Make sure at least one file has been selected
    68      */
    69     if (files == null || files.size() == 0)
    70     {
    71       setError("Please select at least one file to analyze");
    72       return;
    73     }
    74     /*
    75      * Create a form for selection of plugin.
    76      */
    77     DbControl dc = newDbControl();
    78     SelectPluginForm impForm = new SelectPluginForm(dc, Plugin.MainType.ANALYZE);
    79     Fieldset fieldSet = impForm.fs;
    80     /*
    81      * First add the selected file id's as hidden fields. If you don't
    82      * do this the selected file id's will be lost when clicking on the
    83      * next button.
    84      */
    85     for (Integer fileId : files)
    86     {
    87       TextField<Integer> field = new TextField<Integer>(
    88         FormFactory.VID).setHidden(true);
    89       field.setValue(fileId);
    90       fieldSet.add(field);
    91     }
    92     /*
    93      * Add the toolbar with one button labeled 'Next' to the form.
    94      */
    95     Toolbar toolbar = new Toolbar();
    96     ActionLink next = getActionFactory().getActionLink(
    97       CreateFileJobs.class, "Next");
    98     toolbar.add(next);
    99     impForm.setToolbar(toolbar);
    100     /*
    101      * Build and set the layout used to display our form
    102      */
    103     RowLayout layout = getLayoutFactory().getRowLayout();
    104     layout.add(new Title("Select the analysis plugin to use"));
    105     layout.add(impForm);
    106     setLayout(layout);
    107   }
    108 
    109 
    110   /**
    111    * Tell the application in which context this action should be available
    112    */
    113   public List<Context> listContexts()
    114   {
    115     List<Context> contexts = new ArrayList<Context>(1);
    116     /*
    117      * We want our action to appear as an extension when viewing files. Do
    118      * this by adding a FileContext to the list of contexts.
    119      */
    120     FileContext files = new FileContext("analyzefiles", "Run analysis plugin on file[s]",
    121       AnalyzeFilesForm.class);
    122     contexts.add(files);
    123     return contexts;
    124   }
     52   
     53    @Override
     54    protected void runMe()
     55    throws ActionException, InvalidParameterValue
     56    {
     57        setAttribute("mainType", Plugin.MainType.ANALYZE);
     58        setForwardTo(SelectPluginView.class);
     59    }
     60   
     61    /**
     62        Tell the application in which context this action should be available
     63    */
     64    public List<Context> listContexts()
     65    {
     66        List<Context> contexts = new ArrayList<Context>(1);
     67        FileContext files = new FileContext("analyzefiles", "Run analysis plugin on file[s]",
     68        AnalyzeFilesForm.class);
     69        contexts.add(files);
     70        return contexts;
     71    }
    12572}
  • trunk/client/servlet/src/org/proteios/action/file/ConvertFilesForm.java

    r3807 r3924  
    11/*
    2  Copyright (C) 2006 Gregory Vincic
    3 
    4  This file is part of Proteios.
    5  Available at http://www.proteios.org/
    6 
    7  Proteios is free software; you can redistribute it and/or modify it
    8  under the terms of the GNU General Public License as published by
    9  the Free Software Foundation; either version 2 of the License, or
    10  (at your option) any later version.
    11 
    12  Proteios is distributed in the hope that it will be useful, but
    13  WITHOUT ANY WARRANTY; without even the implied warranty of
    14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    15  General Public License for more details.
    16 
    17  You should have received a copy of the GNU General Public License
    18  along with this program; if not, write to the Free Software
    19  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    20  02111-1307, USA.
    21  */
     2    Copyright (C) 2006 Gregory Vincic
     3    Copyright (C) 2010 Gregory Vincic
     4   
     5    This file is part of Proteios.
     6    Available at http://www.proteios.org/
     7   
     8    Proteios is free software; you can redistribute it and/or modify it
     9    under the terms of the GNU General Public License as published by
     10    the Free Software Foundation; either version 2 of the License, or
     11    (at your option) any later version.
     12   
     13    Proteios is distributed in the hope that it will be useful, but
     14    WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16    General Public License for more details.
     17   
     18    You should have received a copy of the GNU General Public License
     19    along with this program; if not, write to the Free Software
     20    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     21    02111-1307, USA.
     22*/
    2223package org.proteios.action.file;
    2324
    24 import org.proteios.ActionLink;
     25import java.util.ArrayList;
     26import java.util.List;
    2527import org.proteios.Context;
    2628import org.proteios.ContextEnabled;
    2729import org.proteios.FileContext;
    2830import org.proteios.action.ProteiosAction;
    29 import org.proteios.core.DbControl;
    3031import org.proteios.core.plugin.Plugin;
    31 import org.proteios.gui.Toolbar;
    32 import org.proteios.gui.form.Fieldset;
    33 import org.proteios.gui.form.Form;
    34 import org.proteios.gui.form.SelectPluginForm;
    35 import org.proteios.gui.form.FormFactory;
    36 import org.proteios.gui.form.TextField;
    3732import org.proteios.gui.layout.RowLayout;
    38 
    3933import se.lu.thep.waf.ActionException;
    4034import se.lu.thep.waf.constraints.InvalidParameterValue;
    4135
    42 import java.util.ArrayList;
    43 import java.util.List;
    44 
    4536/**
    46  * This action presents a form to the user where he/she can select a conversion
    47  * plugin to run on the input files.
    48  *
    49  * @author gregory
    50  */
     37    This action presents a form to the user where he/she can select a conversion
     38    plugin to run on the input files. 
     39*/
    5140public class ConvertFilesForm
    52     extends ProteiosAction<ConvertFilesForm>
    53     implements ContextEnabled
     41extends ProteiosAction<ConvertFilesForm>
     42implements ContextEnabled
    5443{
    55   @Override
    56   protected void runMe()
    57       throws ActionException, InvalidParameterValue
    58   {
    59     /*
    60      * Get the id's of all selected files. FormFactory.VID is the valid
    61      * identifier used when rendering the list of files, thus we use it to
    62      * get the valid list of item ids.
    63      */
    64     List<Integer> files = getValidIntegerList(FormFactory.VID);
    65     /*
    66      * Make sure at least one file has been selected
    67      */
    68     if (files == null || files.size() == 0)
    69     {
    70       setError("Please select at least one file to convert");
    71       return;
    72     }
    73     /*
    74      * Create a form for selection of plugin.
    75      */
    76     DbControl dc = newDbControl();
    77     SelectPluginForm impForm = new SelectPluginForm(dc, Plugin.MainType.CONVERT);
    78     Fieldset fieldSet = impForm.fs;
    79     /*
    80      * First add the selected file id's as hidden fields. If you don't
    81      * do this the selected file id's will be lost when clicking on the
    82      * next button.
    83      */
    84     for (Integer fileId : files)
    85     {
    86       TextField<Integer> field = new TextField<Integer>(
    87         FormFactory.VID).setHidden(true);
    88       field.setValue(fileId);
    89       fieldSet.add(field);
    90     }
    91     /*
    92      * Add the toolbar with one button labeled 'Next' to the form.
    93      */
    94     Toolbar toolbar = new Toolbar();
    95     ActionLink next = getActionFactory().getActionLink(
    96       CreateFileJobs.class, "Next");
    97     toolbar.add(next);
    98     impForm.setToolbar(toolbar);
    99     /*
    100      * Build and set the layout used to display our form
    101      */
    102     RowLayout layout = getLayoutFactory().getRowLayout();
    103     layout.add(impForm);
    104     setLayout(layout);
    105   }
    106 
    107 
    108   /**
    109    * Tell the application in which context this action should be available
    110    */
    111   public List<Context> listContexts()
    112   {
    113     List<Context> contexts = new ArrayList<Context>(1);
    114     /*
    115      * We want our action to appear as an extension when viewing files. Do
    116      * this by adding a FileContext to the list of contexts.
    117      */
    118     FileContext files = new FileContext("convertfiles", "Convert file[s]",
    119       ConvertFilesForm.class);
    120     contexts.add(files);
    121     return contexts;
    122   }
     44    @Override
     45    protected void runMe()
     46    throws ActionException, InvalidParameterValue
     47    {
     48        setAttribute("mainType", Plugin.MainType.CONVERT);
     49        setForwardTo(SelectPluginView.class);
     50    }
     51   
     52    /**
     53        Tell the application in which context this action should be available
     54    */
     55    public List<Context> listContexts()
     56    {
     57        List<Context> contexts = new ArrayList<Context>(1);
     58        FileContext files = new FileContext("convertfiles", "Convert file[s]", ConvertFilesForm.class);
     59        contexts.add(files);
     60        return contexts;
     61    }
    12362}
  • trunk/client/servlet/src/org/proteios/action/file/ImportFilesForm.java

    r3807 r3924  
    11/*
    2  Copyright (C) 2006 Gregory Vincic
    3 
    4  This file is part of Proteios.
    5  Available at http://www.proteios.org/
    6 
    7  Proteios is free software; you can redistribute it and/or modify it
    8  under the terms of the GNU General Public License as published by
    9  the Free Software Foundation; either version 2 of the License, or
    10  (at your option) any later version.
    11 
    12  Proteios is distributed in the hope that it will be useful, but
    13  WITHOUT ANY WARRANTY; without even the implied warranty of
    14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    15  General Public License for more details.
    16 
    17  You should have received a copy of the GNU General Public License
    18  along with this program; if not, write to the Free Software
    19  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    20  02111-1307, USA.
    21  */
     2    Copyright (C) 2006 Gregory Vincic
     3    Copyright (C) 2010 Gregory Vincic
     4   
     5    This file is part of Proteios.
     6    Available at http://www.proteios.org/
     7   
     8    Proteios is free software; you can redistribute it and/or modify it
     9    under the terms of the GNU General Public License as published by
     10    the Free Software Foundation; either version 2 of the License, or
     11    (at your option) any later version.
     12   
     13    Proteios is distributed in the hope that it will be useful, but
     14    WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16    General Public License for more details.
     17   
     18    You should have received a copy of the GNU General Public License
     19    along with this program; if not, write to the Free Software
     20    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     21    02111-1307, USA.
     22*/
    2223package org.proteios.action.file;
    2324
    24 import org.proteios.ActionLink;
     25import java.util.ArrayList;
     26import java.util.List;
    2527import org.proteios.Context;
    2628import org.proteios.ContextEnabled;
     
    2931import org.proteios.core.DbControl;
    3032import org.proteios.core.plugin.Plugin;
    31 import org.proteios.gui.Toolbar;
    32 import org.proteios.gui.form.Fieldset;
    33 import org.proteios.gui.form.Form;
    34 import org.proteios.gui.form.SelectPluginForm;
    35 import org.proteios.gui.form.FormFactory;
    36 import org.proteios.gui.form.TextField;
    37 import org.proteios.gui.layout.RowLayout;
    38 
    3933import se.lu.thep.waf.ActionException;
    4034import se.lu.thep.waf.constraints.InvalidParameterValue;
    4135
    42 import java.util.ArrayList;
    43 import java.util.List;
    44 
    4536/**
    46  * This action presents a form to the user where he/she can select an import
    47  * plugin to run on the input files.
    48  *
    49  * @author gregory
    50  */
     37    This action presents a form to the user where he/she can select an import
     38    plugin to run on the input files.
     39*/
    5140public class ImportFilesForm
    52     extends ProteiosAction<ImportFilesForm>
    53     implements ContextEnabled
     41extends ProteiosAction<ImportFilesForm>
     42implements ContextEnabled
    5443{
    55   @Override
    56   protected void runMe()
    57       throws ActionException, InvalidParameterValue
    58   {
    59     /*
    60      * Get the id's of all selected files. FormFactory.VID is the valid
    61      * identifier used when rendering the list of files, thus we use it to
    62      * get the valid list of item ids.
    63      */
    64     List<Integer> files = getValidIntegerList(FormFactory.VID);
    65     /*
    66      * Make sure at least one file has been selected
    67      */
    68     if (files == null || files.size() == 0)
    69     {
    70       setError("Please select at least one file to import");
    71       return;
    72     }
    73     /*
    74      * Create a form for selection of plugin.
    75      */
    76     DbControl dc = newDbControl();
    77     SelectPluginForm impForm = new SelectPluginForm(dc, Plugin.MainType.IMPORT);
    78     Fieldset fieldSet = impForm.fs;
    79     /*
    80      * First add the selected file id's as hidden fields. If you don't
    81      * do this the selected file id's will be lost when clicking on the
    82      * next button.
    83      */
    84     for (Integer fileId : files)
    85     {
    86       TextField<Integer> field = new TextField<Integer>(
    87         FormFactory.VID).setHidden(true);
    88       field.setValue(fileId);
    89       fieldSet.add(field);
    90     }
    91     /*
    92      * Add the toolbar with one button labeled 'Next' to the form.
    93      */
    94     Toolbar toolbar = new Toolbar();
    95     ActionLink next = getActionFactory().getActionLink(
    96       CreateFileJobs.class, "Next");
    97     toolbar.add(next);
    98     impForm.setToolbar(toolbar);
    99     /*
    100      * Build and set the layout used to display our form
    101      */
    102     RowLayout layout = getLayoutFactory().getRowLayout();
    103     layout.add(impForm);
    104     setLayout(layout);
    105   }
    106 
    107 
    108   /**
    109    * Tell the application in which context this action should be available
    110    */
    111   public List<Context> listContexts()
    112   {
    113     List<Context> contexts = new ArrayList<Context>(1);
    114     /*
    115      * We want our action to appear as an extension when viewing files. Do
    116      * this by adding a FileContext to the list of contexts.
    117      */
    118     FileContext files = new FileContext("Importfiles", "Import file[s]",
    119       ImportFilesForm.class);
    120     contexts.add(files);
    121     return contexts;
    122   }
     44    @Override
     45    protected void runMe()
     46    throws ActionException, InvalidParameterValue
     47    {
     48        setAttribute("mainType", Plugin.MainType.IMPORT);
     49        setForwardTo(SelectPluginView.class);
     50    }
     51   
     52    /**
     53        Tell the application in which context this action should be available
     54    */
     55    public List<Context> listContexts()
     56    {
     57        List<Context> contexts = new ArrayList<Context>(1);
     58        FileContext files = new FileContext("Importfiles", "Import file[s]", ImportFilesForm.class);
     59        contexts.add(files);
     60        return contexts;
     61    }
    12362}
  • trunk/client/servlet/src/org/proteios/gui/form/PluginSelect.java

    r3811 r3924  
    11/*
    2  $Id$
    3 
    4  Copyright (C) 2010 Gregory Vincic
    5 
    6  Files are copyright by their respective authors. The contributions to
    7  files where copyright is not explicitly stated can be traced with the
    8  source code revision system.
    9 
    10  This file is part of Proteios.
    11  Available at http://www.proteios.org/
    12 
    13  Proteios is free software; you can redistribute it and/or
    14  modify it under the terms of the GNU General Public License
    15  as published by the Free Software Foundation; either version 2
    16  of the License, or (at your option) any later version.
    17 
    18  Proteios is distributed in the hope that it will be useful,
    19  but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    21  GNU General Public License for more details.
    22 
    23  You should have received a copy of the GNU General Public License
    24  along with this program; if not, write to the Free Software
    25  Foundation, Inc., 59 Temple Place - Suite 339.
    26  Boston, MA 02111-1307, USA.
    27  */
     2    $Id$
     3   
     4    Copyright (C) 2010 Gregory Vincic
     5   
     6    Files are copyright by their respective authors. The contributions to
     7    files where copyright is not explicitly stated can be traced with the
     8    source code revision system.
     9   
     10    This file is part of Proteios.
     11    Available at http://www.proteios.org/
     12   
     13    Proteios is free software; you can redistribute it and/or
     14    modify it under the terms of the GNU General Public License
     15    as published by the Free Software Foundation; either version 2
     16    of the License, or (at your option) any later version.
     17   
     18    Proteios is distributed in the hope that it will be useful,
     19    but WITHOUT ANY WARRANTY; without even the implied warranty of
     20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     21    GNU General Public License for more details.
     22   
     23    You should have received a copy of the GNU General Public License
     24    along with this program; if not, write to the Free Software
     25    Foundation, Inc., 59 Temple Place - Suite 339.
     26    Boston, MA 02111-1307, USA.
     27*/
    2828package org.proteios.gui.form;
    2929
    30 import se.lu.thep.waf.constraints.VInteger;
    3130import org.proteios.core.DbControl;
     31import org.proteios.core.Include;
     32import org.proteios.core.ItemQuery;
    3233import org.proteios.core.PluginDefinition;
    33 import org.proteios.core.ItemQuery;
    34 import org.proteios.core.Include;
     34import org.proteios.core.plugin.Plugin.MainType;
    3535import org.proteios.core.plugin.Plugin;
    36 import org.proteios.core.plugin.Plugin.MainType;
    37 import org.proteios.core.query.Restrictions;
     36import org.proteios.core.query.Expression;
     37import org.proteios.core.query.Expressions;
    3838import org.proteios.core.query.Hql;
    3939import org.proteios.core.query.Orders;
    40 import org.proteios.core.query.Expression;
    41 import org.proteios.core.query.Expressions;
     40import org.proteios.core.query.Restrictions;
     41import se.lu.thep.waf.constraints.VInteger;
    4242
    4343/**
    44  Select box for selecting an import plugin
     44    Select box for selecting a plugin of one or more given MainTypes
    4545*/
    4646public class PluginSelect extends Select<VInteger>
    4747{
    48   public static final VInteger VPARAM = new VInteger("definitionId", 1, true);
    49 
    50   public PluginSelect(DbControl dc, Plugin.MainType... types)
    51   {
    52     super(PluginSelect.VPARAM);
    53   ItemQuery<PluginDefinition> query;
    54   Expression[] exp;
    55   int i;
    56   Option o;
    57 
    58     setLabel("Plugin");
    59     if (dc != null && dc.isConnected())
    60     {
    61       query = PluginDefinition.getQuery();
    62       query.include(Include.SHARED);
    63      exp = new Expression[types.length];
    64     i = 0;
    65       for (MainType type : types)
    66       {
    67         exp[i] = Expressions.integer(type.getValue());
    68         i++;
    69       }
    70       query.restrict(Restrictions.in(Hql.property("mainType"), exp));
    71       query.order(Orders.asc(Hql.property("mainType")));
    72       for (PluginDefinition pd : query.list(dc))
    73       {
    74         o = new Option(pd.getId(), pd.getName());
    75         addOption(o);
    76       }
    77     }
    78   }
    79 
    80   public PluginSelect()
    81  {
    82   this(null);
    83  }
     48    public static final VInteger VPARAM = new VInteger("definitionId", 1, true);
     49   
     50    public PluginSelect(DbControl dc, Plugin.MainType... types)
     51    {
     52        super(PluginSelect.VPARAM);
     53        ItemQuery<PluginDefinition> query;
     54        Expression[] exp;
     55        int i;
     56       
     57        setLabel("Plugin");
     58        if (dc != null && dc.isConnected())
     59        {
     60            query = PluginDefinition.getQuery();
     61            query.include(Include.OTHERS);
     62            query.include(Include.SHARED);
     63            query.include(Include.NOT_REMOVED);
     64            exp = new Expression[types.length];
     65            i = 0;
     66            for (MainType type : types)
     67            {
     68                exp[i] = Expressions.integer(type.getValue());
     69                i++;
     70            }
     71            query.restrict(Restrictions.in(Hql.property("mainType"), exp));
     72            query.order(Orders.asc(Hql.property("mainType")));
     73            for (PluginDefinition pd : query.list(dc))
     74            {
     75                Option o = new Option(pd.getId(), pd.getName());
     76                addOption(o);
     77            }
     78        }
     79    }
     80   
     81    public PluginSelect()
     82    {
     83        this(null);
     84    }
    8485}
  • trunk/client/servlet/src/org/proteios/gui/form/SelectPluginForm.java

    r3842 r3924  
    11/*
    2  $Id$
    3 
    4  Copyright (C) 2010 Gregory Vincic
    5 
    6  Files are copyright by their respective authors. The contributions to
    7  files where copyright is not explicitly stated can be traced with the
    8  source code revision system.
    9 
    10  This file is part of Proteios.
    11  Available at http://www.proteios.org/
    12 
    13  Proteios is free software; you can redistribute it and/or
    14  modify it under the terms of the GNU General Public License
    15  as published by the Free Software Foundation; either version 2
    16  of the License, or (at your option) any later version.
    17 
    18  Proteios is distributed in the hope that it will be useful,
    19  but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    21  GNU General Public License for more details.
    22 
    23  You should have received a copy of the GNU General Public License
    24  along with this program; if not, write to the Free Software
    25  Foundation, Inc., 59 Temple Place - Suite 339.
    26  Boston, MA 02111-1307, USA.
    27  */
     2    $Id$
     3   
     4    Copyright (C) 2010 Gregory Vincic
     5   
     6    Files are copyright by their respective authors. The contributions to
     7    files where copyright is not explicitly stated can be traced with the
     8    source code revision system.
     9   
     10    This file is part of Proteios.
     11    Available at http://www.proteios.org/
     12   
     13    Proteios is free software; you can redistribute it and/or
     14    modify it under the terms of the GNU General Public License
     15    as published by the Free Software Foundation; either version 2
     16    of the License, or (at your option) any later version.
     17   
     18    Proteios is distributed in the hope that it will be useful,
     19    but WITHOUT ANY WARRANTY; without even the implied warranty of
     20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     21    GNU General Public License for more details.
     22   
     23    You should have received a copy of the GNU General Public License
     24    along with this program; if not, write to the Free Software
     25    Foundation, Inc., 59 Temple Place - Suite 339.
     26    Boston, MA 02111-1307, USA.
     27*/
    2828package org.proteios.gui.form;
    2929
     30import org.proteios.core.DbControl;
    3031import org.proteios.core.plugin.Plugin.MainType;
    31 import org.proteios.core.DbControl;
    3232
    3333/**
    34  Users may select a plugin conforming to the list of plugin types
     34    Users may select a plugin conforming to the list of plugin types
    3535*/
    3636public final class SelectPluginForm extends Form
    3737{
    38  public final Fieldset fs;
    39  public final PluginSelect typeS;
    40 
    41  public SelectPluginForm(DbControl dc, MainType... types)
    42  {
    43   super("pluginsForm");
    44     fs = new Fieldset();
    45     fs.setTitle("SelectPlugin");
    46     typeS = new PluginSelect(dc,    types);
    47     fs.add(typeS);
    48  }
    49 
    50  public SelectPluginForm()
    51  {
    52   super("pluginsForm");
    53     fs = new Fieldset();
    54     fs.setTitle("SelectPlugin");
    55     typeS = new PluginSelect();
    56     fs.add(typeS);
    57  }
    58 
     38    public final Fieldset fs;
     39    public final PluginSelect typeS;
     40   
     41    public SelectPluginForm(DbControl dc, MainType... types)
     42    {
     43        super("pluginsForm");
     44        fs = new Fieldset();
     45        fs.setTitle("Plugins");
     46        typeS = new PluginSelect(dc,    types);
     47        fs.add(typeS);
     48    addFieldset(fs);
     49    }
     50    
     51    public SelectPluginForm()
     52    {
     53        super("pluginsForm");
     54        fs = new Fieldset();
     55        fs.setTitle("Plugins");
     56        typeS = new PluginSelect();
     57        fs.add(typeS);
     58    }   
    5959}
Note: See TracChangeset for help on using the changeset viewer.