001    /*
002     * Copyright 2002-2006 the original author or authors.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005     * use this file except in compliance with the License. You may obtain a copy of
006     * the License at
007     * 
008     * http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013     * License for the specific language governing permissions and limitations under
014     * the License.
015     */
016    package org.springframework.richclient.samples.showcase;
017    
018    import java.awt.BorderLayout;
019    
020    import javax.swing.BorderFactory;
021    import javax.swing.JComponent;
022    import javax.swing.JLabel;
023    import javax.swing.JPanel;
024    
025    import org.springframework.richclient.application.support.AbstractView;
026    
027    /**
028     * This class defines the initial view to be presented in the archetypeapplication. It is
029     * constructed automatically by the platform and configured according to the bean
030     * specification in the application context.
031     * 
032     * @author Larry Streepy
033     * 
034     */
035    public class InitialView extends AbstractView {
036    
037        /**
038         * Create the actual UI control for this view. It will be placed into the window
039         * according to the layout of the page holding this view.
040         */
041        protected JComponent createControl() {
042            // In this view, we're just going to use standard Swing to place a
043            // few controls.
044    
045    
046            JLabel lblMessage = getComponentFactory().createLabel("initialView.message");
047            lblMessage.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
048    
049            JPanel panel = getComponentFactory().createPanel(new BorderLayout());
050            panel.add(lblMessage);
051    
052            return panel;
053        }
054    }