当前位置: 首页>>代码示例>>Java>>正文


Java Procedure0.apply方法代码示例

本文整理汇总了Java中org.eclipse.xtext.xbase.lib.Procedures.Procedure0.apply方法的典型用法代码示例。如果您正苦于以下问题:Java Procedure0.apply方法的具体用法?Java Procedure0.apply怎么用?Java Procedure0.apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.xbase.lib.Procedures.Procedure0的用法示例。


在下文中一共展示了Procedure0.apply方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addButton

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
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;
}
 
开发者ID:CymricNPG,项目名称:abattle,代码行数:27,代码来源:Widgets.java

示例2: initializing

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
private void initializing(final Procedure0 init) {
  try {
    this.initializing = true;
    init.apply();
  } finally {
    this.initializing = false;
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:9,代码来源:JavaResource.java

示例3: finish

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
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);
}
 
开发者ID:CymricNPG,项目名称:abattle,代码行数:10,代码来源:OptionTable.java

示例4: isThrownBy

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
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)
  	);
  }
}
 
开发者ID:javadelight,项目名称:delight-metrics,代码行数:13,代码来源:TestCounter.java

示例5: attempt

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
/**
 * 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;
    }
}
 
开发者ID:skunkiferous,项目名称:Util,代码行数:15,代码来源:SafeCallExtension.java

示例6: _executeTask

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
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);
  }
}
 
开发者ID:oehme,项目名称:xtext-maven-example,代码行数:39,代码来源:BuildScript.java

示例7: andThen

import org.eclipse.xtext.xbase.lib.Procedures.Procedure0; //导入方法依赖的package包/类
/**
 * Returns a composed {@code Procedure1} that performs, in sequence, the {@code before}
 * operation followed by the {@code after} operation. If performing either
 * operation throws an exception, it is relayed to the caller of the
 * composed operation. If performing the {@code before} operation throws an exception,
 * the {@code after} operation will not be performed.
 *
 * @param before the operation to perform first
 * @param after the operation to perform afterwards
 * @return a composed {@code Procedure1} that performs in sequence the {@code before}
 * operation followed by the {@code after} operation
 * @throws NullPointerException if {@code before} or {@code after} is null
 * @since 2.9
 */
public static Procedure0 andThen(final Procedure0 before, final Procedure0 after) {
	if (after == null)
		throw new NullPointerException("after");
	if (before == null)
		throw new NullPointerException("before");
	return new Procedures.Procedure0() {
		@Override
		public void apply() {
			before.apply();
			after.apply();
		}
	};
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:28,代码来源:FunctionExtensions.java


注:本文中的org.eclipse.xtext.xbase.lib.Procedures.Procedure0.apply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。