This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Copyright (c) 2011 EclipseSource and others. All rights reserved. | |
******************************************************************************/ | |
import org.eclipse.rwt.internal.widgets.JSExecutor; | |
import org.eclipse.rwt.lifecycle.IEntryPoint; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.widgets.Button; | |
import org.eclipse.swt.widgets.Canvas; | |
import org.eclipse.swt.widgets.Display; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe( "Mock examples:", function() { | |
var version = jasmine.version_ ? jasmine.version_.major : parseInt( jasmine.version, 10 ); | |
var spyName = function( spy ) { | |
if( version === 1 ) { | |
return spy.identity; | |
} else { | |
return spy.and.identity() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSuggestions(input) { | |
var result = {}; | |
var target = getTarget(input); | |
if (!target) { | |
return []; | |
} | |
var keys = getAllKeys(target); | |
var part = getLastPart(input); | |
for (var i = 0; i < keys.length; i++) { | |
if (keys[i].toLowerCase().startsWith(part.toLowerCase())) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Hello Gist'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ui } from 'tabris'; | |
function positive(prototype: object, property: string) { | |
const sym = Symbol(); | |
Object.defineProperty(prototype, property, { | |
enumerable: true, | |
set(value: number) { | |
if (value < 0) { | |
throw new Error('Positive number expected'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'reflect-metadata'; | |
import { ui } from 'tabris'; | |
function check(prototype: object, property: string) { | |
const sym = Symbol(); | |
const constr = Reflect.getMetadata('design:type', prototype, property); | |
Object.defineProperty(prototype, property, { | |
enumerable: true, | |
set(value: any) { | |
if (!(value instanceof constr) && (typeof value !== constr.name.toLocaleLowerCase())) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ui } from 'tabris'; | |
function pattern(regEx: RegExp) { | |
return (prototype: object, property: string) => { | |
const sym = Symbol(); | |
Object.defineProperty(prototype, property, { | |
enumerable: true, | |
set(value: string) { | |
if (!regEx.test(value)) { | |
throw new Error(`Invalid ${property} "${value}"`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ui, Composite } from 'tabris'; | |
import { component, ComponentJSX } from 'tabris-decorators'; | |
// ------------ Component ------------ | |
@component | |
export default class LabeledInput extends Composite { | |
private jsxProperties: ComponentJSX<this>; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Composite, ui, AlertDialog } from 'tabris'; | |
import { bind, component, property, ComponentJSX } from 'tabris-decorators'; | |
// ------------ Component ------------ | |
@component | |
export default class LabeledInput extends Composite { | |
@bind('#input.text') public text: string; | |
@property public labelText: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Composite, ui, AlertDialog } from 'tabris'; | |
import { bind, component, property, ComponentJSX } from 'tabris-decorators'; | |
// ------------ Component ------------ | |
@component | |
export default class LabeledInput extends Composite { | |
@bind('#input.text') public text: string; | |
@property public labelText: string; |
OlderNewer