Search in sources :

Example 36 with CardLayout

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);
    }
}
Also used : CardLayout(java.awt.CardLayout) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement) TestElement(org.apache.jmeter.testelement.TestElement)

Example 37 with CardLayout

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;
}
Also used : JPanel(javax.swing.JPanel) CardLayout(java.awt.CardLayout)

Example 38 with CardLayout

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, "");
    }
}
Also used : CardLayout(java.awt.CardLayout) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement) TestElement(org.apache.jmeter.testelement.TestElement)

Example 39 with CardLayout

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();
}
Also used : CardLayout(java.awt.CardLayout) JPanel(javax.swing.JPanel)

Example 40 with CardLayout

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()));
}
Also used : JPanel(javax.swing.JPanel) CardLayout(java.awt.CardLayout) EtchedBorder(javax.swing.border.EtchedBorder) JButton(javax.swing.JButton)

Aggregations

CardLayout (java.awt.CardLayout)92 JPanel (javax.swing.JPanel)37 BorderLayout (java.awt.BorderLayout)16 JLabel (javax.swing.JLabel)14 JScrollPane (javax.swing.JScrollPane)12 Dimension (java.awt.Dimension)9 GridBagLayout (java.awt.GridBagLayout)8 Insets (java.awt.Insets)8 JButton (javax.swing.JButton)7 ImageIcon (javax.swing.ImageIcon)6 ListSelectionEvent (javax.swing.event.ListSelectionEvent)6 JSplitPane (javax.swing.JSplitPane)5 ListSelectionListener (javax.swing.event.ListSelectionListener)5 FlowLayout (java.awt.FlowLayout)4 Font (java.awt.Font)4 Point (java.awt.Point)4 JList (javax.swing.JList)4 EmptyBorder (javax.swing.border.EmptyBorder)4 AWTException (java.awt.AWTException)3 GridBagConstraints (java.awt.GridBagConstraints)3