/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LocalArgumentsVariable getLocalArgumentsVariable() { LocalArgumentsVariable __lok = this.get_lok(); boolean _tripleEquals = (__lok == null); if (_tripleEquals) { final LocalArgumentsVariable newLok = N4JSFactory.eINSTANCE.createLocalArgumentsVariable(); newLok.setName("arguments"); final Procedure0 _function = new Procedure0() { public void apply() { FunctionOrFieldAccessorImpl.this.set_lok(newLok); } }; EcoreUtilN4.doWithDeliver(false, _function, this); } return this.get_lok(); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LocalArgumentsVariable getLocalArgumentsVariable() { LocalArgumentsVariable __lok = this.get_lok(); boolean _tripleEquals = (__lok == null); if (_tripleEquals) { final LocalArgumentsVariable newLok = N4JSFactory.eINSTANCE.createLocalArgumentsVariable(); newLok.setName("arguments"); final Procedure0 _function = new Procedure0() { public void apply() { N4MethodDeclarationImpl.this.set_lok(newLok); } }; EcoreUtilN4.doWithDeliver(false, _function, this); } return this.get_lok(); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LocalArgumentsVariable getLocalArgumentsVariable() { LocalArgumentsVariable __lok = this.get_lok(); boolean _tripleEquals = (__lok == null); if (_tripleEquals) { final LocalArgumentsVariable newLok = N4JSFactory.eINSTANCE.createLocalArgumentsVariable(); newLok.setName("arguments"); final Procedure0 _function = new Procedure0() { public void apply() { N4FieldAccessorImpl.this.set_lok(newLok); } }; EcoreUtilN4.doWithDeliver(false, _function, this); } return this.get_lok(); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LocalArgumentsVariable getLocalArgumentsVariable() { LocalArgumentsVariable __lok = this.get_lok(); boolean _tripleEquals = (__lok == null); if (_tripleEquals) { final LocalArgumentsVariable newLok = N4JSFactory.eINSTANCE.createLocalArgumentsVariable(); newLok.setName("arguments"); final Procedure0 _function = new Procedure0() { public void apply() { FunctionDeclarationImpl.this.set_lok(newLok); } }; EcoreUtilN4.doWithDeliver(false, _function, this); } return this.get_lok(); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LocalArgumentsVariable getLocalArgumentsVariable() { LocalArgumentsVariable __lok = this.get_lok(); boolean _tripleEquals = (__lok == null); if (_tripleEquals) { final LocalArgumentsVariable newLok = N4JSFactory.eINSTANCE.createLocalArgumentsVariable(); newLok.setName("arguments"); final Procedure0 _function = new Procedure0() { public void apply() { PropertyMethodDeclarationImpl.this.set_lok(newLok); } }; EcoreUtilN4.doWithDeliver(false, _function, this); } return this.get_lok(); }
public MyTextButton addButton(final Layout position, final Icons icon, final Procedure0 changeProcedure) { MyTextButton _xblockexpression = null; { final Procedure0 _function = new Procedure0() { @Override public void apply() { if ((!Widgets.this.hidden)) { changeProcedure.apply(); } } }; final MyTextButton button = this.createButton(icon, _function); button.setPosition(position.x, position.y); final Procedure1<Boolean> _function_1 = new Procedure1<Boolean>() { @Override public void apply(final Boolean it) { Widgets.this.changeText(it, icon, Widgets.this.helpLabel, Widgets.this.defaultHelpText); } }; button.addHoverListener(_function_1); this.stage.addActor(button); this.buttons.add(button); _xblockexpression = button; } return _xblockexpression; }
@Override public void create() { Widgets _widgets = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { ScreenSwitcher _switcher = CloudScreen.this.getSwitcher(); _switcher.switchToScreen(Screens.Main); } }; _widgets.addButton(Layout.Back, Icons.Back, _function); MultiplayerScreen _multiplayerScr = this.getMultiplayerScr(); Widgets _widgets_1 = this.getWidgets(); MyStage _stage = this.getStage(); _multiplayerScr.create(_widgets_1, _stage, this); }
@Override public void create() { Widgets _widgets = this.getWidgets(); MyStage _stage = this.getStage(); OptionTable _optionTable = new OptionTable(_widgets, _stage); this.table = _optionTable; this.table.create(); this.fillTable(); Widgets _widgets_1 = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { OptionsScreen.this.finish(); } }; _widgets_1.addButton(Layout.Back, Icons.Back, _function); Widgets _widgets_2 = this.getWidgets(); final Procedure0 _function_1 = new Procedure0() { @Override public void apply() { OptionsScreen.this.reset(); } }; MyTextButton _addButton = _widgets_2.addButton(Layout.Options, Icons.Reset, _function_1); this.resetButton = _addButton; }
public MyTextButton create(final Icons icon) { MyTextButton _xblockexpression = null; { Widgets _widgets = this.getWidgets(); _widgets.addImage(50, 50, icon); Widgets _widgets_1 = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { ScreenSwitcher _switcher = WinLooseScreen.this.getSwitcher(); _switcher.switchToScreen(Screens.Main); } }; _xblockexpression = _widgets_1.addButton(Layout.Back, Icons.Back, _function); } return _xblockexpression; }
@Override public void create() { Widgets _widgets = this.getWidgets(); Label _addLabel = _widgets.addLabel(Layout.IMPR_TEXT.x, Layout.IMPR_TEXT.y, "..."); this.label = _addLabel; Widgets _widgets_1 = this.getWidgets(); Label _addLabel_1 = _widgets_1.addLabel(Layout.IMPR_TEXT.x, Layout.IMPR_TEXT.y, "..."); this.label = _addLabel_1; Widgets _widgets_2 = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { ScreenSwitcher _switcher = ErrorScreen.this.getSwitcher(); _switcher.switchToScreen(Screens.Main); } }; _widgets_2.addButton(Layout.Back, Icons.Back, _function); }
public boolean addCheckBox(final String label, final boolean checked, final Procedure1<Boolean> update) { boolean _xblockexpression = false; { Label _createLabel = this.widgets.createLabel(label); Cell<Label> _add = this.table.<Label>add(_createLabel); this.defaultCellOptions(_add); final CheckBox box = this.widgets.createCheckBox(); box.setChecked(checked); Cell<CheckBox> _add_1 = this.table.<CheckBox>add(box); this.defaultCellOptions(_add_1); this.table.row(); final Procedure0 _function = new Procedure0() { @Override public void apply() { boolean _isChecked = box.isChecked(); update.apply(Boolean.valueOf(_isChecked)); } }; _xblockexpression = this.updateProcedures.add(_function); } return _xblockexpression; }
@Override public void create(final Widgets widgets, final Stage stage, final BasicScreen screen) { final Procedure0 _function = new Procedure0() { @Override public void apply() { MultiplayerScreenImpl.this.quickStart(); } }; widgets.addButton(Layout.MULTI_QUICK, Icons.Quick, _function); final Procedure0 _function_1 = new Procedure0() { @Override public void apply() { MultiplayerScreenImpl.this.joinInvites(); } }; widgets.addButton(Layout.MULTI_INVITE, Icons.Invites, _function_1); GameParameterPartScreen _gameParameterPartScreen = new GameParameterPartScreen(widgets, true, screen); this.parameterScreen = _gameParameterPartScreen; final Procedure0 _function_2 = new Procedure0() { @Override public void apply() { MultiplayerScreenImpl.this.newGame(); } }; this.parameterScreen.create(_function_2, stage); }
public void installStubs() { final Procedure0 _function = () -> { this.derivedStateComputer.installStubs(this); this.initialized = true; }; this.initializing(_function); }
public void installFull() { final Procedure0 _function = () -> { this.derivedStateComputer.installFull(this); this.initialized = true; }; this.initializing(_function); }
private void initializing(final Procedure0 init) { try { this.initializing = true; init.apply(); } finally { this.initializing = false; } }
public void discardDerivedState() { final Procedure0 _function = () -> { this.derivedStateComputer.discardDerivedState(this); this.initialized = false; }; this.initializing(_function); }
/** * Curries a procedure that takes one argument. * * @param procedure * the original procedure. May not be <code>null</code>. * @param argument * the fixed argument. * @return a procedure that takes no arguments. Never <code>null</code>. */ @Pure public static <P1> Procedure0 curry(final Procedure1<? super P1> procedure, final P1 argument) { if (procedure == null) throw new NullPointerException("procedure"); return new Procedure0() { @Override public void apply() { procedure.apply(argument); } }; }
@Override public void create() { Table _table = new Table(); this.table = _table; Widgets _widgets = this.getWidgets(); String _get = I18N.get("wait_name"); Label _createLabel = _widgets.createLabel(_get); this.table.<Label>add(_createLabel); this.table.row(); final ScrollPane scrollpane = new ScrollPane(this.table); scrollpane.setSize(Layout.LOCAL_SIZE.x, Layout.LOCAL_SIZE.y); scrollpane.setPosition(Layout.LOCAL_SCROLL.x, Layout.LOCAL_SCROLL.y); MyStage _stage = this.getStage(); _stage.addActor(scrollpane); Widgets _widgets_1 = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { WaitingScreen.this.leaveGame(); } }; _widgets_1.addButton(Layout.Back, Icons.Back, _function); Widgets _widgets_2 = this.getWidgets(); String _get_1 = I18N.get("wait_msg"); Label _addLabel = _widgets_2.addLabel(Layout.WAIT_START.x, Layout.WAIT_START.y, _get_1); this.waitLabel = _addLabel; }
private MyTextButton addButton(final Layout position, final Icons icon, final Screens screen, final Screens back) { Widgets _widgets = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { ScreenSwitcher _switcher = MenuScreen.this.getSwitcher(); _switcher.switchToScreen(screen, back); } }; return _widgets.addButton(position, icon, _function); }
private MyTextButton addButton(final Layout position, final Icons icon, final Screens screen) { Widgets _widgets = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { ScreenSwitcher _switcher = MenuScreen.this.getSwitcher(); _switcher.switchToScreen(screen); } }; return _widgets.addButton(position, icon, _function); }
@Override public void create() { Widgets _widgets = this.getWidgets(); GameParameterPartScreen _gameParameterPartScreen = new GameParameterPartScreen(_widgets, false, this); this.parameterScreen = _gameParameterPartScreen; final Procedure0 _function = new Procedure0() { @Override public void apply() { SingleScreen.this.startGame(); } }; MyStage _stage = this.getStage(); this.parameterScreen.create(_function, _stage); }
@Override public void create() { ArrayList<NetworkGameInfo> _newArrayList = CollectionLiterals.<NetworkGameInfo>newArrayList(); this.games = _newArrayList; this.initGames(); Table _table = new Table(); this.table = _table; this.fillTable(); final ScrollPane scrollpane = new ScrollPane(this.table); scrollpane.setSize(Layout.LOCAL_SIZE.x, Layout.LOCAL_SIZE.y); scrollpane.setPosition(Layout.LOCAL_SCROLL.x, Layout.LOCAL_SCROLL.y); MyStage _stage = this.getStage(); _stage.addActor(scrollpane); Widgets _widgets = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { LocalScreen.this.exitScreen(Screens.Main); } }; _widgets.addButton(Layout.Back, Icons.Back, _function); Widgets _widgets_1 = this.getWidgets(); final Procedure0 _function_1 = new Procedure0() { @Override public void apply() { LocalScreen.this.exitScreen(Screens.New); } }; _widgets_1.addButton(Layout.LOCAL_NEW, Icons.New, _function_1); }
@Override public void create() { Widgets _widgets = this.getWidgets(); GameParameterPartScreen _gameParameterPartScreen = new GameParameterPartScreen(_widgets, true, this); this.parameterScreen = _gameParameterPartScreen; final Procedure0 _function = new Procedure0() { @Override public void apply() { NewScreen.this.startGame(); } }; MyStage _stage = this.getStage(); this.parameterScreen.create(_function, _stage); }
@Override public void create() { Widgets _widgets = this.getWidgets(); _widgets.addLabel(Layout.IMPR_TEXT.x, Layout.IMPR_TEXT.y, ImpressumScreen.text); Widgets _widgets_1 = this.getWidgets(); final Procedure0 _function = new Procedure0() { @Override public void apply() { ScreenSwitcher _switcher = ImpressumScreen.this.getSwitcher(); _switcher.switchToScreen(Screens.Main); } }; _widgets_1.addButton(Layout.Back, Icons.Back, _function); }
public void create() { HashSet<Procedure0> _newHashSet = CollectionLiterals.<Procedure0>newHashSet(); this.updateProcedures = _newHashSet; Table _table = new Table(); this.table = _table; this.table.setFillParent(false); Skin _skin = this.widgets.getSkin(); final ScrollPane scrollpane = new ScrollPane(this.table, _skin); scrollpane.setSize(Layout.OPTION_SIZE.x, Layout.OPTION_SIZE.y); scrollpane.setPosition(Layout.OPTION_SCROLL.x, Layout.OPTION_SCROLL.y); scrollpane.setCancelTouchFocus(false); scrollpane.setFadeScrollBars(false); this.stage.addActor(scrollpane); }
public void finish() { final Procedure1<Procedure0> _function = new Procedure1<Procedure0>() { @Override public void apply(final Procedure0 it) { it.apply(); } }; IterableExtensions.<Procedure0>forEach(this.updateProcedures, _function); }
private static <T extends Exception> void isThrownBy(final Class<T> expected, final Procedure0 block) { try { block.apply(); Assert.fail("Expected a " + expected.getName()); } catch (Exception e) { Class<?> actual = e.getClass(); Assert.assertTrue( "Expected a " + expected.getName() + " but got " + actual.getName(), expected.isAssignableFrom(actual) ); } }
/** * Runs some code safely. * Never throws an Exception. * @return return true; on success. */ public static boolean attempt(final Procedure0 code) { try { code.apply(); return true; } catch (final Throwable t) { LOG.log(Level.SEVERE, t.getMessage(), t); return false; } }
public void _executeTask(final String name) { Map<String, TaskDef> _tasks = this.getTasks(); final TaskDef task = _tasks.get(name); boolean _equals = Objects.equal(task, null); if (_equals) { throw new UnsupportedOperationException((("A task \'" + name) + "\' does not exist.")); } boolean _isExecuted = task.isExecuted(); if (_isExecuted) { return; } boolean _isIsExecuting = task.isIsExecuting(); if (_isIsExecuting) { throw new IllegalStateException((("Recursion detected : The task \'" + name) + "\' already running.")); } try { task.setIsExecuting(true); List<String> _prerequisitedTasks = task.getPrerequisitedTasks(); final Procedure1<String> _function = new Procedure1<String>() { public void apply(final String it) { BuildScript.this._executeTask(it); } }; IterableExtensions.<String>forEach(_prerequisitedTasks, _function); StringConcatenation _builder = new StringConcatenation(); _builder.append("[Task \'"); _builder.append(name, ""); _builder.append("\']"); InputOutput.<String>println(_builder.toString()); Procedure0 _runnable = task.getRunnable(); if (_runnable!=null) { _runnable.apply(); } } finally { task.setExecuted(true); task.setIsExecuting(false); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Map<NameAndAccess, ? extends TMember> getOrCreateOwnedMembersByNameAndAccess() { Map<NameAndAccess, ? extends TMember> _ownedMembersByNameAndAccess = this.getOwnedMembersByNameAndAccess(); boolean _tripleEquals = (_ownedMembersByNameAndAccess == null); if (_tripleEquals) { Map<NameAndAccess, ? extends TMember> _switchResult = null; int _size = this.getOwnedMembers().size(); switch (_size) { case 0: _switchResult = Collections.<NameAndAccess, TMember>emptyMap(); break; case 1: Map<NameAndAccess, ? extends TMember> _xblockexpression = null; { final MT singleMember = this.getOwnedMembers().get(0); final NameAndAccess[] nameAndAccess = NameAndAccess.of(singleMember); Map<NameAndAccess, ? extends TMember> _xifexpression = null; int _length = nameAndAccess.length; boolean _greaterThan = (_length > 1); if (_greaterThan) { Map<NameAndAccess, TMember> _xblockexpression_1 = null; { final HashMap<NameAndAccess, TMember> map = new HashMap<NameAndAccess, TMember>(); map.put(nameAndAccess[0], singleMember); map.put(nameAndAccess[1], singleMember); _xblockexpression_1 = Collections.<NameAndAccess, TMember>unmodifiableMap(map); } _xifexpression = _xblockexpression_1; } else { _xifexpression = Collections.<NameAndAccess, MT>singletonMap(nameAndAccess[0], singleMember); } _xblockexpression = _xifexpression; } _switchResult = _xblockexpression; break; default: EList<MT> _ownedMembers = this.getOwnedMembers(); MemberByNameAndAccessMap _memberByNameAndAccessMap = new MemberByNameAndAccessMap(_ownedMembers); _switchResult = Collections.<NameAndAccess, TMember>unmodifiableMap(_memberByNameAndAccessMap); break; } final Map<NameAndAccess, ? extends TMember> newRegistry = _switchResult; final Procedure0 _function = new Procedure0() { public void apply() { ContainerTypeImpl.this.setOwnedMembersByNameAndAccess(newRegistry); } }; EcoreUtilN4.doWithDeliver(false, _function, this); } return this.getOwnedMembersByNameAndAccess(); }
@Test public void testFunctionType5() { this.assertInJava(this.assertInXtend(this.getOwner().newFunctionTypeReference(this.type(Procedure0.class)), "()=>void"), "org.eclipse.xtext.xbase.lib.Procedures$Procedure0"); }
public void validateLater(final Procedure0 validationCallback) { this.delegate.validateLater(validationCallback); }
public MyChangeListener(Procedure0 procedure) { Validate.notNull(procedure); this.procedure0 = procedure; }
public MyTextButton createButton(final Icons icon, final Procedure0 buttonPressed) { return this.createButton(icon, 1.0f, buttonPressed, false); }