⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldapconfiggui.java

📁 测试工具
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
				tableModifyPanel.clear();
				modify.setText(""); // $NON-NLS-1$
				searchbase.setText(""); // $NON-NLS-1$
				searchfilter.setText(""); // $NON-NLS-1$
				delete.setText("");
			} else if (deleteTest.isSelected()) {
				cl.show(cards, "Delete");
				tableModifyPanel.clear();
				modify.setText(""); // $NON-NLS-1$
				tableAddPanel.clear();
				add.setText(""); // $NON-NLS-1$
				searchbase.setText(""); // $NON-NLS-1$
				searchfilter.setText(""); // $NON-NLS-1$
			} else if (searchTest.isSelected()) {
				cl.show(cards, "Search");
				delete.setText(""); // $NON-NLS-1$
				tableModifyPanel.clear();
				modify.setText(""); // $NON-NLS-1$
				tableAddPanel.clear();
				add.setText(""); // $NON-NLS-1$
			} else if (modifyTest.isSelected()) {
				cl.show(cards, "Modify");
				tableAddPanel.clear();
				add.setText(""); // $NON-NLS-1$
				searchbase.setText(""); // $NON-NLS-1$
				searchfilter.setText(""); // $NON-NLS-1$
				delete.setText("");
			} else {
				cl.show(cards, ""); // $NON-NLS-1$
				tableAddPanel.clear();
				add.setText(""); // $NON-NLS-1$
				tableModifyPanel.clear();
				modify.setText(""); // $NON-NLS-1$
				searchbase.setText(""); // $NON-NLS-1$
				searchfilter.setText(""); // $NON-NLS-1$
				delete.setText(""); // $NON-NLS-1$
			}
		} else {
			cl.show(cards, ""); // $NON-NLS-1$
			tableAddPanel.clear();
			add.setText(""); // $NON-NLS-1$
			tableModifyPanel.clear();
			modify.setText(""); // $NON-NLS-1$
			searchbase.setText(""); // $NON-NLS-1$
			searchfilter.setText(""); // $NON-NLS-1$
			delete.setText(""); // $NON-NLS-1$
		}
	}

	public LdapConfigGui(boolean displayName) {
		this.displayName = displayName;
		init();
	}

	/**
	 * This will create the servername panel in the LdapConfigGui.
	 */
	private JPanel createServernamePanel() {
		JPanel serverPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("servername")); // $NON-NLS-1$
		label.setLabelFor(servername);
		serverPanel.add(label, BorderLayout.WEST);
		serverPanel.add(servername, BorderLayout.CENTER);
		return serverPanel;
	}

	/**
	 * This will create the port panel in the LdapConfigGui.
	 */
	private JPanel createPortPanel() {
		JPanel portPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("port")); // $NON-NLS-1$
		label.setLabelFor(port);
		portPanel.add(label, BorderLayout.WEST);
		portPanel.add(port, BorderLayout.CENTER);
		return portPanel;
	}

	/**
	 * This will create the Root distinguised name panel in the LdapConfigGui.
	 */
	private JPanel createRootdnPanel() {
		JPanel rootdnPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("dn")); // $NON-NLS-1$
		label.setLabelFor(rootdn);
		rootdnPanel.add(label, BorderLayout.WEST);
		rootdnPanel.add(rootdn, BorderLayout.CENTER);
		return rootdnPanel;
	}

	/**
	 * This will create the Search panel in the LdapConfigGui.
	 */
	private JPanel createSearchPanel() {
		VerticalPanel searchPanel = new VerticalPanel();
		JPanel searchBPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("search_base")); // $NON-NLS-1$
		label.setLabelFor(searchbase);
		searchBPanel.add(label, BorderLayout.WEST);
		searchBPanel.add(searchbase, BorderLayout.CENTER);
		JPanel searchFPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label2 = new JLabel(JMeterUtils.getResString("search_filter")); // $NON-NLS-1$
		label2.setLabelFor(searchfilter);
		searchFPanel.add(label2, BorderLayout.WEST);
		searchFPanel.add(searchfilter, BorderLayout.CENTER);
		searchPanel.add(searchBPanel);
		searchPanel.add(searchFPanel);
		return searchPanel;
	}

	/**
	 * This will create the Delete panel in the LdapConfigGui.
	 */
	private JPanel createDeletePanel() {
		VerticalPanel panel = new VerticalPanel();
		JPanel deletePanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("delete")); // $NON-NLS-1$
		label.setLabelFor(delete);
		deletePanel.add(label, BorderLayout.WEST);
		deletePanel.add(delete, BorderLayout.CENTER);
		panel.add(deletePanel);
		return panel;
	}

	/**
	 * This will create the Add test panel in the LdapConfigGui.
	 */
	private JPanel createAddPanel() {
		JPanel addPanel = new JPanel(new BorderLayout(5, 0));
		JPanel addInnerPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("entry_dn")); // $NON-NLS-1$
		label.setLabelFor(add);
		addInnerPanel.add(label, BorderLayout.WEST);
		addInnerPanel.add(add, BorderLayout.CENTER);
		addPanel.add(addInnerPanel, BorderLayout.NORTH);
		addPanel.add(tableAddPanel, BorderLayout.CENTER);
		return addPanel;
	}

	/**
	 * This will create the Modify panel in the LdapConfigGui.
	 */
	private JPanel createModifyPanel() {
		JPanel modifyPanel = new JPanel(new BorderLayout(5, 0));
		JPanel modifyInnerPanel = new JPanel(new BorderLayout(5, 0));
		JLabel label = new JLabel(JMeterUtils.getResString("entry_dn")); // $NON-NLS-1$
		label.setLabelFor(modify);
		modifyInnerPanel.add(label, BorderLayout.WEST);
		modifyInnerPanel.add(modify, BorderLayout.CENTER);
		modifyPanel.add(modifyInnerPanel, BorderLayout.NORTH);
		modifyPanel.add(tableModifyPanel, BorderLayout.CENTER);
		return modifyPanel;
	}

	/**
	 * 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;
	}

	/**
	 * This will create the test panel in the LdapConfigGui.
	 */
	private JPanel createTestPanel() {
		JPanel testPanel = new JPanel(new BorderLayout());
		testPanel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("test_configuration"))); // $NON-NLS-1$

		testPanel.add(new JLabel(JMeterUtils.getResString("test"))); // $NON-NLS-1$
		JPanel rowPanel = new JPanel();

		rowPanel.add(addTest);
		bGroup.add(addTest);
		rowPanel.add(deleteTest);
		bGroup.add(deleteTest);
		rowPanel.add(searchTest);
		bGroup.add(searchTest);
		rowPanel.add(modifyTest);
		bGroup.add(modifyTest);
		testPanel.add(rowPanel, BorderLayout.NORTH);
		testPanel.add(user_Defined, BorderLayout.CENTER);
		return testPanel;
	}

	/**
	 * This will initialise all the panel in the LdapConfigGui.
	 */
	private void init() {
		setLayout(new BorderLayout(0, 5));

		if (displayName) {
			setBorder(makeBorder());
			add(makeTitlePanel(), BorderLayout.NORTH);
		}
		VerticalPanel mainPanel = new VerticalPanel();
		mainPanel.add(createServernamePanel());
		mainPanel.add(createPortPanel());
		mainPanel.add(createRootdnPanel());
		mainPanel.add(createTestPanel());
		mainPanel.add(testPanel());
		add(mainPanel, BorderLayout.CENTER);

		user_Defined.addItemListener(this);
		addTest.addItemListener(this);
		modifyTest.addItemListener(this);
		deleteTest.addItemListener(this);
		searchTest.addItemListener(this);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -