package de.FeatureModellingTool.Pattern.UI;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.text.PlainDocument;
public class ParameterEditor extends JPanel {
private static final long serialVersionUID = 0L;
public ParameterEditor() {
this.edtParameter = new JTextField(20);
this.edtParameter.setDocument(new PlainDocument());
GridBagLayout gbl = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
this.setLayout(gbl);
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridwidth = 1;
this.add(Box.createHorizontalStrut(10), gbc);
this.add(new JLabel("��������"), gbc);
this.add(Box.createHorizontalStrut(15), gbc);
this.add(this.edtParameter, gbc);
gbc.gridwidth = GridBagConstraints.REMAINDER;
this.add(Box.createHorizontalStrut(15), gbc);
}
protected JTextField edtParameter = null;
public void setParameter(String parameter) {
if ("0".equals(parameter)) {
parameter = "n";
}
this.edtParameter.setText(parameter);
}
public String getParameter() {
return this.edtParameter.getText();
}
}