Class: SC.ControlTestPane


Extends SC.Pane.

Generates a pane that will display vertically stacked views for testing. You can use this class in test mode to easily create a palette with views configured in different ways.

Example

var pane = SC.ControlTestPane.design()
  .add('basic', SC.CheckboxView.design({ title: "Hello World" }))
  .add('disabled', SC.CheckboxView.design({
    title: "Hello World", isEnabled: NO
  }));

module("CheckboxView UI", pane);

test("basic", function() {
  var view = pane.view('basic');
  ok(view.get('isEnabled'), 'should be enabled');
});

Defined in: control_test_pane.js

Since:
SproutCore 1.0

Field Summary

Class Methods

Instance Methods

Methods borrowed from SC.Pane:
append, appendTo, blurMainTo, blurTo, computeParentDimensions, didBecomeKeyPaneFrom, didBecomeKeyResponderFrom, didLoseKeyPaneTo, focusFrom, focusMainFrom, hasTouchIntercept, insert, isPaneAttached, makeFirstResponder, nextResponder, paneDidAttach, performKeyEquivalent, prependTo, recomputeDependentProperties, remove, removeFromParent, resignKeyPane, sendEvent, setBodyOverflowIfNeeded, unsetBodyOverflowIfNeeded, willBecomeKeyPaneFrom, willLoseKeyPaneTo, windowSizeDidChange
Methods borrowed from SC.View:
$, adjust, animate, appendChild, applyAttributesToContext, beginLiveResize, borderFrame, buildIn, buildInChild, buildInDidCancel, buildInDidFinish, buildInDidFinishFor, buildOut, buildOutChild, buildOutDidCancel, buildOutDidFinish, cancelAnimation, clippingFrame, computeFrameWithParentFrame, containerLayer, contextMenu, convertFrameFromView, convertFrameToView, createChildView, createChildViews, createLayer, cursor, destroy, destroyLayer, didLoseKeyResponderTo, displayDidChange, displayToolTip, emitDesign, encodeDesign, endLiveResize, findLayerInParentLayer, frame, init, insertBefore, insertText, interpretKeyEvents, invokeRenderDelegateMethod, isContextMenuEnabled, isDescendantOf, isEnabledInPane, isFixedLayout, layer, layerId, layerIdDidChange, layoutChildViews, layoutChildViewsIfNeeded, layoutDidChange, layoutDidChangeFor, layoutStyle, layoutView, nextValidKeyView, owner, parentViewDidChange, parentViewDidResize, previousValidKeyView, propertyDidChange, recomputeIsVisibleInWindow, removeAllChildren, removeChild, removeChildAndDestroy, render, renderChildViews, renderContext, renderDelegate, renderDelegateProxy, renderLayout, replaceAllChildren, replaceChild, replaceLayer, resetAnimation, resetBuild, resetBuildState, respondsTo, scrollToVisible, selectStart, theme, touchIsInBoundary, tryToPerform, updateDesignMode, updateLayer, updateLayerIfNeeded, updateLayerLocation, updateLayerLocationIfNeeded, updateLayout, viewDidResize, willBecomeKeyResponderFrom, willLoseKeyResponderTo
Methods borrowed from SC.Responder:
becomeFirstResponder, didBecomeFirstResponder, resignFirstResponder, willLoseFirstResponder
Methods borrowed from SC.Object:
activate, awake, deactivate, instanceOf, invokeLast, invokeLater, invokeNext, invokeOnce, invokeOnceLater, invokeWith, kindOf, mixin, notifyPropertyDidChange, superclass, toString
Methods borrowed from SC.Observable:
addObserver, addObservesHandler, addProbe, allPropertiesDidChange, automaticallyNotifiesObserversFor, beginPropertyChanges, bind, decrementProperty, destroyObservable, didChangeFor, endPropertyChanges, get, getEach, getPath, hasObserverFor, incrementProperty, initObservable, logProperty, notifyPropertyChange, observersForKey, propertyWillChange, registerDependentKey, removeObserver, removeObservesHandler, removeProbe, set, setIfChanged, setPath, setPathIfChanged, toggleProperty, unknownProperty

Field Detail

height Number

The default height of each row. This will be used for a view unless you manually specify a height in the view's layout.

Default value:
20
padding Number
The default padding added to the edges and between each row.
Default value:
4
top Number

The starting top location for the first row. This will increment as views are added to the pane.

Default value:
0

Class Method Detail

add(label, view, attrs)

Adds a test view to the control pane design. The passed label will be used as the key which you can use to find the view layer. You can either pass a view that is already designed or pass an array of attributes that will be used to create a design on the view.

Parameters:
label String
the view key name
view SC.View
a view class or view design
attrs Hash
optional attrs to use when designing the view
Returns:
SC.ControlTestPane
receiver
becomeKeyPane()
Makes the test pane the key pane, so that key handling methods can be properly tested.
show()

Registers a final test that will instantiate the control test pane and display it. This allows the developer to interact with the controls once the test has completed.

standardSetup()
Returns a standard setup/teardown object for use by the module() method.
view(keyName)

Convenience method. Returns the view with the given name on the current pane instance if there is one.

Parameters:
keyName String
the key used to register the view.
Returns:
SC.View
view instance

Instance Method Detail

view(keyName)
Retrieves the test sample view that was added with the passed key name.
Parameters:
keyName String
the key used to register the view.
Returns:
SC.View
view instance
Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 03 2015 13:12:20 GMT+0100 (CET)