Adds PartySearchForm which is needed by BaseRoleItemPane

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4340 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
baka 2016-10-01 11:35:23 +00:00
parent 62999e0f38
commit 0b6ea7e4f2
1 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,63 @@
/*
* Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.cms.ui;
import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.Page;
import com.arsdigita.bebop.form.Submit;
import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.util.Assert;
/**
* Form to search for parties to be added to a staff group.
*
* @author Scott Seago <sseago@redhat.com>
* @version $Id: PartySearchForm.java 1942 2009-05-29 07:53:23Z terry $
*/
public class PartySearchForm extends BaseForm {
private final static String SEARCH_LABEL = "Search";
private final TextField m_search;
public PartySearchForm() {
super("SearchParties", gz("cms.ui.search"));
addComponent(new Label(gz("cms.ui.search_prompt")));
m_search = new TextField(new StringParameter("query"));
m_search.setSize(40);
addComponent(m_search);
addAction(new Submit("finish", gz("cms.ui.search")));
addAction(new Cancel());
}
public final void register(final Page page) {
super.register(page);
Assert.isTrue(page.stateContains(this));
}
public TextField getSearchWidget() {
return m_search;
}
}