use of java.awt.CardLayout in project jmeter by apache.
the class LdapExtConfigGui method configure.
/**
* A newly created component can be initialized with the contents of a Test
* Element object by calling this method. The component is responsible for
* querying the Test Element object for the relevant information to display
* in its GUI.
*
* @param element
* the TestElement to configure
*/
@Override
public void configure(TestElement element) {
super.configure(element);
servername.setText(element.getPropertyAsString(LDAPExtSampler.SERVERNAME));
port.setText(element.getPropertyAsString(LDAPExtSampler.PORT));
rootdn.setText(element.getPropertyAsString(LDAPExtSampler.ROOTDN));
scope.setSelectedIndex(element.getPropertyAsInt(LDAPExtSampler.SCOPE));
countlim.setText(element.getPropertyAsString(LDAPExtSampler.COUNTLIM));
timelim.setText(element.getPropertyAsString(LDAPExtSampler.TIMELIM));
attribs.setText(element.getPropertyAsString(LDAPExtSampler.ATTRIBS));
retobj.setSelected(element.getPropertyAsBoolean(LDAPExtSampler.RETOBJ));
deref.setSelected(element.getPropertyAsBoolean(LDAPExtSampler.DEREF));
connto.setText(element.getPropertyAsString(LDAPExtSampler.CONNTO));
parseflag.setSelected(element.getPropertyAsBoolean(LDAPExtSampler.PARSEFLAG));
secure.setSelected(element.getPropertyAsBoolean(LDAPExtSampler.SECURE));
userpw.setText(element.getPropertyAsString(LDAPExtSampler.USERPW));
userdn.setText(element.getPropertyAsString(LDAPExtSampler.USERDN));
comparedn.setText(element.getPropertyAsString(LDAPExtSampler.COMPAREDN));
comparefilt.setText(element.getPropertyAsString(LDAPExtSampler.COMPAREFILT));
modddn.setText(element.getPropertyAsString(LDAPExtSampler.MODDDN));
newdn.setText(element.getPropertyAsString(LDAPExtSampler.NEWDN));
CardLayout cl = (CardLayout) (cards.getLayout());
final String testType = element.getPropertyAsString(LDAPExtSampler.TEST);
if (testType.equals(LDAPExtSampler.UNBIND)) {
unbind.setSelected(true);
cl.show(cards, CARDS_DEFAULT);
} else if (testType.equals(LDAPExtSampler.BIND)) {
bind.setSelected(true);
cl.show(cards, CARDS_BIND);
} else if (testType.equals(LDAPExtSampler.SBIND)) {
sbind.setSelected(true);
cl.show(cards, CARDS_BIND);
} else if (testType.equals(LDAPExtSampler.COMPARE)) {
compare.setSelected(true);
cl.show(cards, CARDS_COMPARE);
} else if (testType.equals(LDAPExtSampler.ADD)) {
addTest.setSelected(true);
add.setText(element.getPropertyAsString(LDAPExtSampler.BASE_ENTRY_DN));
tableAddPanel.configure((TestElement) element.getProperty(LDAPExtSampler.ARGUMENTS).getObjectValue());
cl.show(cards, CARDS_ADD);
} else if (testType.equals(LDAPExtSampler.MODIFY)) {
modifyTest.setSelected(true);
modify.setText(element.getPropertyAsString(LDAPExtSampler.BASE_ENTRY_DN));
tableModifyPanel.configure((TestElement) element.getProperty(LDAPExtSampler.LDAPARGUMENTS).getObjectValue());
cl.show(cards, CARDS_MODIFY);
} else if (testType.equals(LDAPExtSampler.DELETE)) {
deleteTest.setSelected(true);
delete.setText(element.getPropertyAsString(LDAPExtSampler.DELETE));
cl.show(cards, CARDS_DELETE);
} else if (testType.equals(LDAPExtSampler.RENAME)) {
rename.setSelected(true);
cl.show(cards, CARDS_RENAME);
} else if (testType.equals(LDAPExtSampler.SEARCH)) {
searchTest.setSelected(true);
searchbase.setText(element.getPropertyAsString(LDAPExtSampler.SEARCHBASE));
searchfilter.setText(element.getPropertyAsString(LDAPExtSampler.SEARCHFILTER));
cl.show(cards, CARDS_SEARCH);
}
}
use of java.awt.CardLayout in project jmeter by apache.
the class LdapConfigGui method testPanel.
/**
* This will create the user defined test panel for create or modify or
* delete or search based on the panel selected in the itemevent in the
* LdapConfigGui.
*/
private JPanel testPanel() {
cards = new JPanel(new CardLayout());
cards.add(new JPanel(), "");
cards.add(createAddPanel(), "Add");
cards.add(createModifyPanel(), "Modify");
cards.add(createDeletePanel(), "Delete");
cards.add(createSearchPanel(), "Search");
return cards;
}
use of java.awt.CardLayout in project jmeter by apache.
the class LdapConfigGui method configure.
/**
* A newly created component can be initialized with the contents of a Test
* Element object by calling this method. The component is responsible for
* querying the Test Element object for the relevant information to display
* in its GUI.
*
* @param element
* the TestElement to configure
*/
@Override
public void configure(TestElement element) {
super.configure(element);
servername.setText(element.getPropertyAsString(LDAPSampler.SERVERNAME));
port.setText(element.getPropertyAsString(LDAPSampler.PORT));
rootdn.setText(element.getPropertyAsString(LDAPSampler.ROOTDN));
CardLayout cl = (CardLayout) (cards.getLayout());
final String testType = element.getPropertyAsString(LDAPSampler.TEST);
if (testType.equals(LDAPSampler.ADD)) {
addTest.setSelected(true);
add.setText(element.getPropertyAsString(LDAPSampler.BASE_ENTRY_DN));
tableAddPanel.configure((TestElement) element.getProperty(LDAPSampler.ARGUMENTS).getObjectValue());
cl.show(cards, "Add");
} else if (testType.equals(LDAPSampler.MODIFY)) {
modifyTest.setSelected(true);
modify.setText(element.getPropertyAsString(LDAPSampler.BASE_ENTRY_DN));
tableModifyPanel.configure((TestElement) element.getProperty(LDAPSampler.ARGUMENTS).getObjectValue());
cl.show(cards, "Modify");
} else if (testType.equals(LDAPSampler.DELETE)) {
deleteTest.setSelected(true);
delete.setText(element.getPropertyAsString(LDAPSampler.DELETE));
cl.show(cards, "Delete");
} else if (testType.equals(LDAPSampler.SEARCHBASE)) {
searchTest.setSelected(true);
searchbase.setText(element.getPropertyAsString(LDAPSampler.SEARCHBASE));
searchfilter.setText(element.getPropertyAsString(LDAPSampler.SEARCHFILTER));
cl.show(cards, "Search");
}
if (element.getPropertyAsBoolean(LDAPSampler.USER_DEFINED)) {
userDefined.setSelected(true);
} else {
userDefined.setSelected(false);
// $NON-NLS-1$
cl.show(cards, "");
}
}
use of java.awt.CardLayout in project jgnash by ccavanaugh.
the class MainViewPanel method init.
private void init() {
cardLayout = new CardLayout();
contentPanel = new JPanel(cardLayout);
buttonPanel = new ButtonPanel();
layoutPanel();
}
use of java.awt.CardLayout in project jgnash by ccavanaugh.
the class WizardDialog method initComponents.
private void initComponents() {
pagePanel = new JPanel(new CardLayout());
backButton = new JButton(rb.getString("Button.Back"));
backButton.setIcon(IconUtils.getIcon("/jgnash/resource/go-previous.png"));
nextButton = new JButton(rb.getString("Button.Next"));
nextButton.setIcon(IconUtils.getIcon("/jgnash/resource/go-next.png"));
nextButton.setHorizontalTextPosition(SwingConstants.LEADING);
finishButton = new JButton(rb.getString("Button.Finish"));
cancelButton = new JButton(rb.getString("Button.Cancel"));
taskList = new JList<>();
taskList.setBorder(new EtchedBorder());
taskList.addListSelectionListener(WizardDialog.this::selectionAction);
taskList.setCellRenderer(new WizardPageRenderer(taskList.getCellRenderer()));
}
Aggregations