/** * Initialize the GUI components and layout. */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) setLayout(new BorderLayout(5, 0)); // The label for the text field. JLabel nameLabel = new JLabel(JMeterUtils.getResString("name")); // $NON-NLS-1$ nameLabel.setName("name"); nameLabel.setLabelFor(nameField); add(nameLabel, BorderLayout.WEST); add(nameField, BorderLayout.CENTER); }
@Override public void clearGui() { setName(getStaticLabel()); }
/** * Provides a default implementation for the name property. It's unlikely * developers will need to override. */ @Override public String getName() { if (getNamePanel() != null) { return getNamePanel().getName(); } return ""; // $NON-NLS-1$ }
/** * Provides a default implementation for setting the name property. It's unlikely * developers will need to override. */ @Override public void setName(String name) { namePanel.setName(name); }
/** {@inheritDoc} */ @Override public void setName(String name) { _setName(name); }
/** {@inheritDoc} */ @Override public TestElement createTestElement() { WorkBench wb = new WorkBench(); modifyTestElement(wb); return wb; }
/** {@inheritDoc} */ @Override public String getStaticLabel() { return JMeterUtils.getResString(getLabelResource()); }
/** * When constructing a new component, this takes care of basic tasks like * setting up the Name Panel and assigning the class's static label as the * name to start. */ public AbstractJMeterGuiComponent() { namePanel = new NamePanel(); commentPanel=new CommentPanel(); initGui(); }
/** {@inheritDoc} */ @Override public void modifyTestElement(TestElement wb) { wb.setName(getName()); wb.setProperty(new StringProperty(TestElement.GUI_CLASS, this.getClass().getName())); wb.setProperty(new StringProperty(TestElement.TEST_CLASS, WorkBench.class.getName())); }
/** {@inheritDoc} */ @Override public void configure(TestElement testElement) { setName(testElement.getName()); }
graphTitle.setText(namePanel.getName()); } else if (eventSource == dynamicGraphSize) {
graphTitle.setText(namePanel.getName()); } else if (eventSource == dynamicGraphSize) { enableDynamicGraph(dynamicGraphSize.isSelected());