/** * 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$ }
/** * 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(); }
private static void refreshUI() { long ts = System.currentTimeMillis(); if (ts - lastUpdate < 1000) { return; // throttle down updates } lastUpdate = ts; GuiPackage gp = GuiPackage.getInstance(); if (gp != null) {// check there is a GUI gp.getMainFrame().updateCounts(); } }
@Override public void mouseReleased(MouseEvent e) { GuiPackage.getInstance().getMainFrame().repaint(); }
private JMeterTreeModel getJmeterTreeModel() { if (this.nonGuiTreeModel == null) { return GuiPackage.getInstance().getTreeModel(); } return this.nonGuiTreeModel; }
@Override public void doAction(ActionEvent e) { GuiPackage instance = GuiPackage.getInstance(); List<Stoppable> stopables = instance.getStoppables(); for (Stoppable element : stopables) { instance.unregister(element); element.stopServer(); } } }
private void initGui() { setName(getStaticLabel()); commentPanel.clearGui(); }
/** * Update the GUI for the currently selected node. The GUI component is * configured to reflect the settings in the current tree node. */ public void updateCurrentGui() { updateCurrentNode(); refreshCurrentGui(); }
/** * Provides a default implementation for the comment property. It's unlikely * developers will need to override. * * @return The comment for the property */ public String getComment() { if (getCommentPanel() != null) { return getCommentPanel().getText(); } return ""; // $NON-NLS-1$ }
/** * Create the scope settings panel. * @param enableVariable set true to enable the variable panel * @return the scope settings panel */ protected JPanel createScopePanel(boolean enableVariable) { return createScopePanel(enableVariable, true, true); }
/** * Show the scope settings from the test element. * * @param testElement * the test element from which the settings should be shown */ protected void showScopeSettings(AbstractScopedTestElement testElement) { showScopeSettings(testElement, false); }
/** * @return true if history contains redo item */ public boolean canRedo() { return undoHistory.canRedo(); }
/** * End a group of actions modeled as 1 undo */ public void endUndoTransaction() { undoHistory.endUndoTransaction(); }
/** * create the target server panel. * <ul> * <li>Server IP</li> * <li>Server Port</li> * <li>Connect Timeout</li> * <li>Response Timeout</li> * </ul> */ public ServerPanel() { init(); }
/** * @return true if history contains undo item */ public boolean canUndo() { return undoHistory.canUndo(); }
/** * Get an icon which has previously been registered for this class object. * * @param elementClass * the class object which we want to get an icon for * * @return the associated icon, or null if this class or its superclass has * not been registered */ public static ImageIcon getIcon(Class<?> elementClass) { return getIcon(elementClass, true); }
/** * Provides a default implementation for setting the comment property. It's * unlikely developers will need to override. * * @param comment * The comment for the property */ public void setComment(String comment) { commentPanel.setText(comment); }
/** * Provides a default implementation that resets the name field to the value of * getStaticLabel(), reset comment and sets enabled to true. Your GUI may need more things * cleared, in which case you should override, clear the extra fields, and * still call super.clearGui(). */ @Override public void clearGui() { initGui(); enabled = true; }
/** * Navigate back through undo history */ public void undo() { undoHistory.undo(); }