1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * ident        "%Z%%M% %I%     %E% SMI"
  24  *
  25  * Copyright (c) 2001 by Sun Microsystems, Inc.
  26  * All rights reserved.
  27  */
  28 package com.sun.dhcpmgr.client.SUNWbinfiles;
  29 
  30 import java.awt.*;
  31 
  32 import javax.swing.*;
  33 import javax.swing.text.*;
  34 import javax.swing.event.*;
  35 
  36 import com.sun.dhcpmgr.client.*;
  37 import com.sun.dhcpmgr.ui.*;
  38 
  39 /**
  40  * This class makes the SUNWbinfiles data store manageable by the dhcpmgr.
  41  */
  42 public class SUNWbinfiles extends SUNWModule {
  43 
  44     private static final String DEFAULT_PATH = "/var/dhcp";
  45 
  46     /**
  47      * The constructor for the SUNWbinfiles module.
  48      */
  49     public SUNWbinfiles() {
  50 
  51         // Initialize the path and description attributes.
  52         //
  53         path = new String(DEFAULT_PATH);
  54         description = ResourceStrings.getString("description");
  55 
  56         box = Box.createVerticalBox();
  57 
  58         // Explanatory text.
  59         //
  60         JComponent c = Wizard.createTextArea(
  61             ResourceStrings.getString("explanation"), 3, 45);
  62         box.add(c);
  63         box.add(Box.createVerticalStrut(5));
  64 
  65         // Path entry field.
  66         //
  67         JPanel fieldPanel = new JPanel(new FieldLayout());
  68         fieldPanel.add(FieldLayout.LABEL,
  69             new JLabel(ResourceStrings.getString("path_label")));
  70         directory = new JTextField(path, 20);
  71         fieldPanel.add(FieldLayout.FIELD, directory);
  72         box.add(fieldPanel);
  73 
  74         // Add a listener to set forward button (or not).
  75         //
  76         directory.getDocument().addDocumentListener(new PathListener());
  77 
  78         // By default forward button is enabled for this data store.
  79         //
  80         setForwardEnabled(true);
  81 
  82     } // constructor
  83 
  84 } // SUNWbinfiles