org.efaps.ui.wicket.pages.company.CompanyPage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of efaps-webapp Show documentation
Show all versions of efaps-webapp Show documentation
eFaps WebApp provides a web interface as the User Interface for eFaps
which can be easily expanded and altered.
/*
* Copyright 2003 - 2012 The eFaps Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Revision: $Rev:1490 $
* Last Changed: $Date:2007-10-15 18:04:02 -0500 (Mon, 15 Oct 2007) $
* Last Changed By: $Author:jmox $
*/
package org.efaps.ui.wicket.pages.company;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
import org.apache.wicket.RestartResponseException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.WindowClosedCallback;
import org.apache.wicket.extensions.markup.html.form.select.IOptionRenderer;
import org.apache.wicket.extensions.markup.html.form.select.Select;
import org.apache.wicket.extensions.markup.html.form.select.SelectOptions;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.util.io.IClusterable;
import org.efaps.admin.dbproperty.DBProperties;
import org.efaps.admin.user.Company;
import org.efaps.db.Context;
import org.efaps.ui.wicket.components.LabelComponent;
import org.efaps.ui.wicket.components.button.Button;
import org.efaps.ui.wicket.components.modalwindow.ModalWindowContainer;
import org.efaps.ui.wicket.pages.AbstractMergePage;
import org.efaps.ui.wicket.pages.error.ErrorPage;
import org.efaps.ui.wicket.pages.main.MainPage;
import org.efaps.ui.wicket.resources.EFapsContentReference;
import org.efaps.ui.wicket.resources.AbstractEFapsHeaderItem;
import org.efaps.util.EFapsException;
/**
* Class renders the page that is used as a dialog to select the current
* company. On close of the page the current company in the context will be set
* and written to the user properties.
*
* @author The eFaps Team
* @version $Id: CompanyPage.java 7613 2012-06-09 17:34:55Z [email protected] $
*/
public class CompanyPage
extends AbstractMergePage
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Reference to the StyleSheet for this Page.
*/
private static final EFapsContentReference CSS = new EFapsContentReference(CompanyPage.class, "CompanyPage.css");
/**
* Modal window this page is opened in.
*/
private final PageReference calledByReference;
/**
* Constructor adding all Components to this Page.
*
* @param _modal modal window
*/
public CompanyPage(final PageReference _calledByReference)
{
super();
this.calledByReference = _calledByReference;
// set the title for the Page
add(new Label("pageTitle", DBProperties.getProperty("Logo.Version.Label")));
add(new LabelComponent("title",
DBProperties.getProperty("org.efaps.ui.wicket.pages.company.title.Label")));
final Form