/// <summary> /// Draws the right label: "Given", "When", "Then" or "and". /// </summary> /// <typeparam name="T">The Step Method type.</typeparam> /// <param name="unityInterface">The unity interface.</param> /// <param name="index">The index.</param> public void DrawLabel <T>(IUnityInterfaceWrapper unityInterface, int index) where T : IGivenWhenThenDeclaration { string label = StepMethodUtilities.GetStepMethodName <T>(); if (index > 0) { label = "and"; } unityInterface.EditorGUILayoutLabelField(label, RunnerEditorBusinessLogicData.LabelWidthAbsolute); }
/// <summary> /// Draws the static rows. /// </summary> /// <typeparam name="T">The Step Methods type.</typeparam> /// <param name="unityInterface">The unity interface.</param> /// <param name="stepMethodsLoader">The step methods loader.</param> /// <param name="bddComponents">The BDD components.</param> /// <param name="labelWidthAbsolute">The label width absolute.</param> /// <param name="buttonsWidthAbsolute">The buttons width absolute.</param> public void DrawStaticRows <T>(IUnityInterfaceWrapper unityInterface, MethodsLoader stepMethodsLoader, Component[] bddComponents, float labelWidthAbsolute, float buttonsWidthAbsolute) where T : IGivenWhenThenDeclaration { List <BaseMethodDescription> methodsList = stepMethodsLoader.LoadStepMethods <T>(bddComponents); for (int index = 0; index < methodsList.Count; index++) { unityInterface.EditorGUILayoutBeginHorizontal(); float rowWidth = unityInterface.EditorGUIUtilityCurrentViewWidth() - labelWidthAbsolute - buttonsWidthAbsolute; float textSize = rowWidth - 20; string label = StepMethodUtilities.GetStepMethodName <T>(); if (index > 0) { label = "and"; } unityInterface.EditorGUILayoutLabelField(label, labelWidthAbsolute); string description = string.Empty; description = methodsList[index].Text; unityInterface.EditorGUILayoutLabelField(description, textSize); this.DrawCogButton(unityInterface, methodsList[index]); unityInterface.EditorGUILayoutEndHorizontal(); } }