1 239 stephen /* 2 239 stephen * CDDL HEADER START 3 239 stephen * 4 239 stephen * The contents of this file are subject to the terms of the 5 239 stephen * Common Development and Distribution License (the "License"). 6 239 stephen * You may not use this file except in compliance with the License. 7 239 stephen * 8 239 stephen * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 239 stephen * or http://www.opensolaris.org/os/licensing. 10 239 stephen * See the License for the specific language governing permissions 11 239 stephen * and limitations under the License. 12 239 stephen * 13 239 stephen * When distributing Covered Code, include this CDDL HEADER in each 14 239 stephen * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 239 stephen * If applicable, add the following below this CDDL HEADER, with the 16 239 stephen * fields enclosed by brackets "[]" replaced with your own identifying 17 239 stephen * information: Portions Copyright [yyyy] [name of copyright owner] 18 239 stephen * 19 239 stephen * CDDL HEADER END 20 239 stephen */ 21 239 stephen 22 239 stephen /* 23 239 stephen * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 239 stephen * Use is subject to license terms. 25 239 stephen */ 26 239 stephen 27 239 stephen package org.opensolaris.os.vp.panels.example.time1.client.swing; 28 239 stephen 29 239 stephen import java.awt.Component; 30 239 stephen import java.util.Date; 31 239 stephen import org.opensolaris.os.vp.panel.swing.control.SwingControl; 32 239 stephen 33 239 stephen public class TimeControl extends SwingControl<TimePanelDescriptor, TimePanel> { 34 239 stephen // 35 239 stephen // Constructors 36 239 stephen // 37 239 stephen 38 239 stephen public TimeControl(TimePanelDescriptor descriptor) { 39 239 stephen super(descriptor.getId(), descriptor.getName(), descriptor); 40 239 stephen } 41 239 stephen 42 239 stephen // 43 239 stephen // SwingControl methods 44 239 stephen // 45 239 stephen 46 239 stephen @Override 47 244 stephen protected TimePanel createComponent() { 48 244 stephen return new TimePanel(); 49 239 stephen } 50 239 stephen 51 239 stephen @Override 52 239 stephen protected void initComponent() { 53 239 stephen Date date = new Date(); 54 239 stephen getComponent().getSpinnerDateModel().setValue(date); 55 239 stephen } 56 239 stephen } 57