<commit_before>package org.mwc.cmap.TimeController.properties;

import java.beans.*;

import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.*;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.mwc.cmap.core.property_support.DurationHelper;

import MWC.GUI.Properties.DateFormatPropertyEditor;
import MWC.GenericData.Duration;

public class StepperProperties extends java.beans.PropertyChangeSupport implements IPropertySource2
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * the small step size
	 */
	private Duration _smallStep, _defaultSmallStep;

	/**
	 * and the large step size
	 */
	private Duration _largeStep, _defaultLargeStep;

	/**
	 * and the time interval between auto-steps
	 */
	private Duration _autoInterval, _defaultAutoInterval;
	
	/** and the format for the DTG
	 * 
	 */
	private Integer _dtgFormat, _defaultFormat;

	static private String[] DTG_FORMAT_STRINGS; 

	/**
	 * the property names
	 */
	public static String LARGE_STEP_ID = "Large Step";

	public static String SMALL_STEP_ID = "Small Step";

	public static String STEP_INTERVAL_ID = "Step Interval";

	public static String DTG_FORMAT_ID = "DTG Format";

	/**
	 * static instances of our properties
	 */
	private static PropertyDescriptor LARGE_STEP = null;

	private static PropertyDescriptor SMALL_STEP = null;

	private static PropertyDescriptor AUTO_STEP = null;

	private static PropertyDescriptor DTG_FORMAT = null;

	private static PropertyDescriptor[] PROPERTY_DESCRIPTORS = null;

	// //////////////////////////////////////////////////////////////
	// constructor
	// ///////////////////////////////////////////////////////////////

	/**
	 * create/initialise our set of properties
	 */
	public StepperProperties()
	{
		super(LARGE_STEP_ID);

		// ok, set the default values
		_smallStep = _defaultSmallStep = new Duration(1, Duration.MINUTES);
		_largeStep = _defaultLargeStep = new Duration(10, Duration.MINUTES);
		_autoInterval = _defaultAutoInterval = new Duration(1, Duration.SECONDS);
		_dtgFormat = _defaultFormat = new Integer(0);
		
		// see if our tags need declaring
		if(DTG_FORMAT_STRINGS == null)
			DTG_FORMAT_STRINGS = DateFormatPropertyEditor.getTagList();

	}

	public boolean isPropertyResettable(Object id)
	{
		return true;
	}


	public Object getEditableValue()
	{
		return this;
	}

	public IPropertyDescriptor[] getPropertyDescriptors()
	{
		if (LARGE_STEP == null)
		{

			// ok, better create our property descriptors

			LARGE_STEP = new PropertyDescriptor(LARGE_STEP_ID, LARGE_STEP_ID)
			{
				public CellEditor createPropertyEditor(Composite parent)
				{
					return new DurationHelper.DurationCellEditor(parent);
				}
			};
			LARGE_STEP.setAlwaysIncompatible(true);
			LARGE_STEP.setDescription("The size of the large time step");

			SMALL_STEP = new PropertyDescriptor(SMALL_STEP_ID, SMALL_STEP_ID)
			{
				public CellEditor createPropertyEditor(Composite parent)
				{
					return new DurationHelper.DurationCellEditor(parent);
				}
			};
			SMALL_STEP.setAlwaysIncompatible(true);
			SMALL_STEP.setDescription("The size of the small time step");

			AUTO_STEP = new PropertyDescriptor(STEP_INTERVAL_ID, STEP_INTERVAL_ID)
			{
				public CellEditor createPropertyEditor(Composite parent)
				{
					return new DurationHelper.DurationCellEditor(parent);
				}
			};
			AUTO_STEP.setAlwaysIncompatible(true);
			AUTO_STEP.setDescription("The interval between automatic time steps");

			DTG_FORMAT = new ComboBoxPropertyDescriptor(DTG_FORMAT_ID, DTG_FORMAT_ID,DTG_FORMAT_STRINGS)
			{
			};
			DTG_FORMAT.setAlwaysIncompatible(true);
			DTG_FORMAT.setDescription("The format to use to display the DTG");

			PROPERTY_DESCRIPTORS = new PropertyDescriptor[] { LARGE_STEP, SMALL_STEP,
					AUTO_STEP, DTG_FORMAT };

		}

		return PROPERTY_DESCRIPTORS;<commit_msg>Don't provide DTG format as a property<commit_after>package org.mwc.cmap.TimeController.properties;

import java.beans.*;

import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.*;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.mwc.cmap.core.property_support.DurationHelper;

import MWC.GUI.Properties.DateFormatPropertyEditor;
import MWC.GenericData.Duration;

public class StepperProperties extends java.beans.PropertyChangeSupport implements IPropertySource2
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * the small step size
	 */
	private Duration _smallStep, _defaultSmallStep;

	/**
	 * and the large step size
	 */
	private Duration _largeStep, _defaultLargeStep;

	/**
	 * and the time interval between auto-steps
	 */
	private Duration _autoInterval, _defaultAutoInterval;
	
	/** and the format for the DTG
	 * 
	 */
	private Integer _dtgFormat, _defaultFormat;

	static private String[] DTG_FORMAT_STRINGS; 

	/**
	 * the property names
	 */
	public static String LARGE_STEP_ID = "Large Step";

	public static String SMALL_STEP_ID = "Small Step";

	public static String STEP_INTERVAL_ID = "Step Interval";

	public static String DTG_FORMAT_ID = "DTG Format";

	/**
	 * static instances of our properties
	 */
	private static PropertyDescriptor LARGE_STEP = null;

	private static PropertyDescriptor SMALL_STEP = null;

	private static PropertyDescriptor AUTO_STEP = null;

	private static PropertyDescriptor DTG_FORMAT = null;

	private static PropertyDescriptor[] PROPERTY_DESCRIPTORS = null;

	// //////////////////////////////////////////////////////////////
	// constructor
	// ///////////////////////////////////////////////////////////////

	/**
	 * create/initialise our set of properties
	 */
	public StepperProperties()
	{
		super(LARGE_STEP_ID);

		// ok, set the default values
		_smallStep = _defaultSmallStep = new Duration(1, Duration.MINUTES);
		_largeStep = _defaultLargeStep = new Duration(10, Duration.MINUTES);
		_autoInterval = _defaultAutoInterval = new Duration(1, Duration.SECONDS);
		_dtgFormat = _defaultFormat = new Integer(0);
		
		// see if our tags need declaring
		if(DTG_FORMAT_STRINGS == null)
			DTG_FORMAT_STRINGS = DateFormatPropertyEditor.getTagList();

	}

	public boolean isPropertyResettable(Object id)
	{
		return true;
	}


	public Object getEditableValue()
	{
		return this;
	}

	public IPropertyDescriptor[] getPropertyDescriptors()
	{
		if (LARGE_STEP == null)
		{

			// ok, better create our property descriptors

			LARGE_STEP = new PropertyDescriptor(LARGE_STEP_ID, LARGE_STEP_ID)
			{
				public CellEditor createPropertyEditor(Composite parent)
				{
					return new DurationHelper.DurationCellEditor(parent);
				}
			};
			LARGE_STEP.setAlwaysIncompatible(true);
			LARGE_STEP.setDescription("The size of the large time step");

			SMALL_STEP = new PropertyDescriptor(SMALL_STEP_ID, SMALL_STEP_ID)
			{
				public CellEditor createPropertyEditor(Composite parent)
				{
					return new DurationHelper.DurationCellEditor(parent);
				}
			};
			SMALL_STEP.setAlwaysIncompatible(true);
			SMALL_STEP.setDescription("The size of the small time step");

			AUTO_STEP = new PropertyDescriptor(STEP_INTERVAL_ID, STEP_INTERVAL_ID)
			{
				public CellEditor createPropertyEditor(Composite parent)
				{
					return new DurationHelper.DurationCellEditor(parent);
				}
			};
			AUTO_STEP.setAlwaysIncompatible(true);
			AUTO_STEP.setDescription("The interval between automatic time steps");

			DTG_FORMAT = new ComboBoxPropertyDescriptor(DTG_FORMAT_ID, DTG_FORMAT_ID,DTG_FORMAT_STRINGS)
			{
			};
			DTG_FORMAT.setAlwaysIncompatible(true);
			DTG_FORMAT.setDescription("The format to use to display the DTG");

			// hey, don't bother putting the DTG format in the properties window anymore - we've got it in the time-controller's
			// drop-down menu
			PROPERTY_DESCRIPTORS = new PropertyDescriptor[] { LARGE_STEP, SMALL_STEP,
					AUTO_STEP};

		}

		return PROPERTY_DESCRIPTORS;
{'fraction_non_alphanumeric': 0.11350808980308541, 'fraction_numerical': 0.001755926251097454, 'mean_word_length': 3.7099822799763733, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6102408', 'n_tokens_mistral': 2708, 'n_tokens_neox': 2344, 'n_words': 570}