Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ext/CvGraphicalWorkbench"

Index

Variables

CvGraphicalWorkbench

CvGraphicalWorkbench: ClassicComponentClass<CvGraphicalWorkbenchProps> = React.createClass<CvGraphicalWorkbenchProps, CvGraphicalWorkbenchState>({mixins: [CvBaseMixin],componentDidMount: function () {this.refresh(this.props);},componentWillReceiveProps: function (nextProps) {this.refresh(nextProps);},appWinDef: function ():AppWinDef {return this.props.appWinDef || this.firstInScope(AppWinDef);},getDefaultProps: function () {return {appWinDef: null,launchListeners: [],actionListeners: [],numCols: 3,selectionProvider: null,workbench: null,workbenchId: null}},getInitialState: function () {return {workbench: null}},getChildContext: function () {const ctx = this.getDefaultChildContext();ctx.cvContext.scopeCtx.scopeObj = this.workbench();return ctx;},refresh: function (props:CvGraphicalWorkbenchProps) {if (props.workbench) {this.setState({workbench: props.workbench});} else if (props.workbenchId) {const workbench = this._workbenchForId(props.workbenchId);if(workbench) {this.setState({workbench: workbench});} else {this.setState({workbench: this.appWinDef().workbenches[0]})}} else {this.setState({workbench: this.appWinDef().workbenches[0]})}const selectionProvider:CvValueProvider<Workbench> = props.selectionProvider;if (selectionProvider) {selectionProvider.subscribe(this._updateWorkbench);}},render: function () {const workbench:Workbench = this.workbench();if (workbench) {return (<CvWorkbench workbench={workbench} appWinDef={this.appWinDef()} renderer={(cvContext:CvContext)=>{const cssCols = Math.floor(12/this.props.numCols);const workbench:Workbench = cvContext.scopeCtx.scopeObj as Workbench;const newChildren = [];let rowElems = [];workbench.workbenchLaunchActions.forEach((launchAction:WorkbenchLaunchAction, i:number) => {rowElems.push(<CvLauncher launchAction={launchAction} key={launchAction.actionId}launchListeners={this.props.launchListeners} actionListeners={this.props.actionListeners}renderer={(cvContext:CvContext, callback:CvLaunchActionCallback)=>{const launcher = cvContext.scopeCtx.scopeObj as WorkbenchLaunchAction;return (<div onClick={()=>{callback.fireLaunchAction()}}className={"col-sm-" + cssCols + " cv-launcher-container cv-target animated fadeIn"}id={launcher.alias || launcher.actionId}><img className="cv-launcher-icon img-responsive center-block" src={launcher.iconBase} onError={this._loadPlaceholder}/><h4 className="cv-launcher-text small text-center">{launcher.name}</h4></div>);}}/>);if(i % this.props.numCols == this.props.numCols-1) {newChildren.push(React.createElement('div', {className:'row', key: i}, rowElems));rowElems = [];}});if(rowElems.length > 0){newChildren.push(React.createElement('div', {className:'row', key: '00'}, rowElems));}return <div>{newChildren}</div>}}/>);} else {return null;}},workbench: function () {return this.state.workbench;},_loadPlaceholder: function (e) {e.preventDefault();e.target.src = 'http://cdn.churchm.ag/wp-content/uploads/2013/06/404-Space-Invaders.png'},_updateWorkbench: function (workbench:Workbench) {this.setState({workbench: workbench});},_workbenchForId: function(id:string) {const appWinDef = this.appWinDef();let workbench = null;appWinDef.workbenches.some((wb)=> {if (wb.workbenchId == id) {workbench = wb;return true;} else {return false;}});return workbench;}})

CvGraphicalWorkbenchPanel

CvGraphicalWorkbenchPanel: ClassicComponentClass<CvGraphicalWorkbenchPanelProps> = React.createClass<CvGraphicalWorkbenchPanelProps, CvGraphicalWorkbenchPanelState>({mixins: [CvBaseMixin],appWinDef: function ():AppWinDef {return this.props.appWinDef || this.firstInScope(AppWinDef);},getDefaultProps: function() {return {appWinDef:null, workbench: null, workbenchId:null, workbenchRenderer: null}},render: function () {const workbench = this.workbench();if (this.props.renderer) {return this.props.renderer(this.getChildContext().cvContext);} else {return (<div className="cv-workbench-manager-container animated fadeIn"><div className="cv-panel panel panel-primary cv-workbench-panel"><div className="cv-panel-heading panel-heading"><h3 className="cv-panel-title panel-title">{workbench ? workbench.name : ''}</h3></div><div className="cv-panel-body panel-body">{this.props.workbenchRenderer(workbench)}</div></div></div>);}},workbench: function() {if (this.props.workbenchId) {const workbench = this._workbenchForId(this.props.workbenchId);if(workbench) {return workbench;} else {return this.appWinDef().workbenches.length > 0 ? this.appWinDef().workbenches[0] : null;}}},_workbenchForId: function(id:string) {const appWinDef = this.appWinDef();let workbench = null;appWinDef.workbenches.some((wb)=> {if (wb.workbenchId == id) {workbench = wb;return true;} else {return false;}});return workbench;}})

Generated using TypeDoc