DSWizard.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
/**
* This class defines a Wizard that configures a data store.
*/
/**
* The collection of valid DSConf objects.
*/
/**
* The selected DSConf
*/
/**
* This class is a holder for the set of DSConf objects.
*/
protected class DSConfList extends ArrayList {
/**
* Initializes the set of supported DSConfList.
* @param server handle to a service manager server
*/
try {
} catch (Throwable e) {
// ignore for now
}
for (int i = 0;
try {
} catch (Throwable e) {
e.getMessage()
};
}
}
} // init
/**
* Finds and returns a DSConf by resource.
* @param resource the resource of the DSConf.
* @return the DSConf if found or null if not found.
*/
for (int i = 0; i < size(); i++) {
break;
}
}
return entry;
} // findDSConf
} // DSConfList
/**
* This class is a simple holder for a data store
* and the module used to manage the data store.
*/
protected class DSConf {
/**
* DHCP datastore information.
*/
/**
* The module used to manage the data store.
*/
/**
* Constructs a DSConf from a name and a classname.
* @param ds DHCP data store.
* @param className of the DSModule classname.
*/
throws Exception {
} // constructor
/**
* Returns the DhcpDatastore for this DSConf
* @return the DhcpDatastore for this DSConf
*/
public DhcpDatastore getDS() {
return ds;
} // getDS
/**
* Returns the module used to manage the data store.
* @return the module used to manage the data store.
*/
return dsm;
} // getModule
/**
* Sets the location from the module into the DhcpDatastore.
*/
public void setLocation() {
} // setLocation
/**
* Sets the location from the module into the DhcpDatastore.
*/
public void setConfig() {
} // setConfig
} // DSConf
/**
* This class maps a radio button and a DSConf.
*/
private class DSConfButton extends JRadioButton {
/**
* The data store to link to the radio button.
*/
/**
* Constructs a DSConfButton from a DSConf and determines
* whether the button should be selected using the boolean argument.
* @param dsconf the data store to map to the radio button.
* @param selected select the radio button?
*/
} // constructor
/**
* Returns the DSConf mapped to the radio button.
* @return the DSConf mapped to the radio button.
*/
return dsconf;
} // getDsconf
} // DSConfButton
/**
* This class is the wizard step that presents the choice of
* data stores to the user for selection.
*/
protected class DatastoreStep implements WizardStep {
/**
* The component provided to the wizard.
*/
/**
* The group of DSConfButton objects.
*/
private ButtonGroup buttonGroup;
/**
* The basic constructor for the wizard step.
* @param wizardText the main explanatory text for the wizard.
* @param stepText the explanatory text for the step.
*/
super();
// Explanatory wizard intro text
//
// Explanatory step text
//
// Create button listener, that will set the selected
// data store when the button is selected.
//
public void actionPerformed(ActionEvent e) {
if (button.isSelected()) {
}
}
};
// Create panel that will contain the buttons.
//
// List data store choices.
//
buttonGroup = new ButtonGroup();
new DSConfButton(dsconf, false);
}
// Add the panel to the stepBox component.
//
} // constructor
public String getDescription() {
} // getDescription
public Component getComponent() {
return stepBox;
} // getComponent
setForwardEnabled(true);
} else {
setForwardEnabled(false);
}
} // setActive
public boolean setInactive(int direction) {
return true;
} // setInactive
while (en.hasMoreElements()) {
break;
}
}
}
} // enableButton
} // DatastoreStep
/**
* This class is the wizard step that presents the data store module
* bean to the user for data store configuration.
*/
protected class DatastoreModuleStep implements WizardStep {
/**
* The component provided to the wizard.
*/
/**
* Basic constructor. The component for the step will actually be
* built in the setActive method, as this step is dependant upon
* the data store selection made by the user in the DatastoreStep
* wizard step.
*/
public DatastoreModuleStep() {
} // constructor
public String getDescription() {
} // getDescription
public Component getComponent() {
return stepBox;
} // getComponent
if (direction > 0) {
validate();
}
}
setForwardEnabled(true);
} else {
setForwardEnabled(false);
}
} // setActive
public boolean setInactive(int direction) {
return true;
} // setInactive
} // DatastoreModuleStep
/**
* Simple constructor.
* @param owner frame for wizard.
* @param title title of the wizard.
*/
} // constructor
/**
* Sets dsconf.
* @param dsconf the data store config value.
*/
}
setForwardEnabled(true);
} // setDsconf
/**
* Returns the dsconf.
* @return the dsconf.
*/
return dsconf;
} // getDsconf
/**
* Invoked when the DSModule has changed its state.
* @param e the event.
*/
public void stateChanged(DSModuleEvent e) {
setForwardEnabled(true);
} else {
setForwardEnabled(false);
}
} // stateChanged
} // DSWizard