org.efaps.mobile.wicket.pages.main.MainPage.java Source code

Java tutorial

Introduction

Here is the source code for org.efaps.mobile.wicket.pages.main.MainPage.java

Source

/*
 * 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$
 * Last Changed:    $Date$
 * Last Changed By: $Author$
 */

package org.efaps.mobile.wicket.pages.main;

import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.resource.CssResourceReference;
import org.efaps.db.Context;
import org.efaps.mobile.wicket.pages.ISecuredPage;
import org.efaps.util.EFapsException;

/**
 * TODO comment!
 *
 * @author The eFaps Team
 * @version $Id$
 */
public class MainPage extends WebPage implements ISecuredPage {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    public MainPage() {
        try {
            add(new Label("username", Context.getThreadContext().getPerson().getFirstName() + " "
                    + Context.getThreadContext().getPerson().getLastName()));
            add(new Label("company", Context.getThreadContext().getCompany().getName()));
        } catch (final EFapsException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    @Override
    public void renderHead(final IHeaderResponse _response) {
        super.renderHead(_response);
        _response.render(CssHeaderItem.forReference(new CssResourceReference(MainPage.class, "MainPage.css")));
    }
}