|
What this is
Other links
The source code/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.modules.xml.core.scenario;
import java.awt.Component;
import java.awt.Container;
import org.openide.DialogDescriptor;
import org.openide.util.HelpCtx;
import org.netbeans.modules.xml.api.scenario.*;
import java.awt.Dialog;
import java.util.HashMap;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.openide.NotifyDescriptor;
import org.openide.DialogDisplayer;
import org.openide.loaders.DataObject;
/**
* This panel allows the user to edit scenarios for a particular DataObject.
*
* @author asgeir@dimonsoftware.com
*/
public class ScenarioPanel extends javax.swing.JPanel {
/** The list model which represents the scenarios */
private DefaultComboBoxModel scenarioModel;
/** The selected scenario, one of the Scenario objects in scenarioModel
* @supplierCardinality 0..**/
private Scenario selectedScenario;
/** The svenario that was selected at startup */
private Scenario selectedScenarioAtStartup;
/** The DataObject which owns the scenarios */
private DataObject dataObject;
/** Mapping from scenario to a UI component for that scenario */
private HashMap uiCompMap = new HashMap();
/** Creates new form ScenarioPanel */
public ScenarioPanel(DataObject dataObject, DefaultComboBoxModel scenarioModel) {
this.scenarioModel = scenarioModel;
this.dataObject = dataObject;
initComponents();
scenarioList.setModel(scenarioModel);
selectedScenarioAtStartup = selectedScenario = (Scenario)scenarioModel.getSelectedItem();
scenarioList.setSelectedValue(selectedScenario, true);
}
public boolean createScenario() {
Scenario s = NewScenarioPanel.createScenario(dataObject, scenarioModel);
if (s != null) {
scenarioList.setSelectedValue(s, true);
enableControls();
m_addedScenarios.add(s);
return true;
}
return false;
}
public void rollBackAddedAndRemovedScenarios() {
for(int i=0; i
|
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.