private void updateGrid() {

    // probeDataCleared is called after closing a editor part and the next one is not initialized
    // on gcode loading the probe data are always reseted
    if (gcodeProgram != null) {

      int xSteps = toolbox.parseIntegerField(scanStepXText, 1);
      int ySteps = toolbox.parseIntegerField(scanStepYText, 1);

      gcodeProgram.prepareAutolevelScan(xSteps, ySteps); // resets scan completed
      scanStepWidthXLabel.setText(
          String.format(IConstant.FORMAT_COORDINATE, gcodeProgram.getStepWidthX()));
      scanStepWidthYLabel.setText(
          String.format(IConstant.FORMAT_COORDINATE, gcodeProgram.getStepWidthY()));
    }

    redrawGcode(); // redraw gcode every time, if gcodeProgram is null, then the view is "cleared"
  }
  private void setGridFields() {

    if (gcodeProgram == null) return;

    ignoreStepTextModifyListener = true;
    if (scanStepXText != null && !scanStepXText.isDisposed())
      scanStepXText.setText("" + gcodeProgram.getXSteps());
    if (scanStepYText != null && !scanStepYText.isDisposed())
      scanStepYText.setText("" + gcodeProgram.getYSteps());
    ignoreStepTextModifyListener = false;

    if (scanStepWidthXLabel != null && !scanStepWidthXLabel.isDisposed())
      scanStepWidthXLabel.setText(
          String.format(IConstant.FORMAT_COORDINATE, gcodeProgram.getStepWidthX()));
    if (scanStepWidthYLabel != null && !scanStepWidthYLabel.isDisposed())
      scanStepWidthYLabel.setText(
          String.format(IConstant.FORMAT_COORDINATE, gcodeProgram.getStepWidthY()));
  }