本文整理汇总了Java中org.ruboto.JRubyAdapter.isJRubyPreOneSeven方法的典型用法代码示例。如果您正苦于以下问题:Java JRubyAdapter.isJRubyPreOneSeven方法的具体用法?Java JRubyAdapter.isJRubyPreOneSeven怎么用?Java JRubyAdapter.isJRubyPreOneSeven使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ruboto.JRubyAdapter
的用法示例。
在下文中一共展示了JRubyAdapter.isJRubyPreOneSeven方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadScript
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
private void loadScript(String f) throws IOException {
Log.d(getClass().getName(), "Loading test script: " + f);
InputStream is = getClass().getClassLoader().getResourceAsStream(f);
BufferedReader buffer = new BufferedReader(new InputStreamReader(is));
StringBuilder source = new StringBuilder();
while (true) {
String line = buffer.readLine();
if (line == null) break;
source.append(line).append("\n");
}
buffer.close();
JRubyAdapter.setScriptFilename(f);
// FIXME(uwe): Simplify when we stop supporting JRuby < 1.7.0
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$test", this);
JRubyAdapter.put("$script_code", source.toString());
JRubyAdapter.put("$filename", f);
JRubyAdapter.runScriptlet("$test.instance_eval($script_code, $filename)");
} else {
if (f.equals("test_helper.rb")) {
JRubyAdapter.runScriptlet(source.toString());
} else {
JRubyAdapter.runRubyMethod(this, "instance_eval", source.toString(), f);
}
}
Log.d(getClass().getName(), "Test script " + f + " loaded");
}
示例2: onTrackballEvent
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onTrackballEvent(android.view.MotionEvent event) {
if (ScriptLoader.isCalledFromJRuby()) return super.onTrackballEvent(event);
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onTrackballEvent");
return super.onTrackballEvent(event);
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) return super.onTrackballEvent(event);
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_trackball_event}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_event", event);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_trackball_event($arg_event)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_trackball_event", event);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onTrackballEvent}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_event", event);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onTrackballEvent($arg_event)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onTrackballEvent", event);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
return super.onTrackballEvent(event);
}
}
}
示例3: onStartTemporaryDetach
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onStartTemporaryDetach() {
if (ScriptLoader.isCalledFromJRuby()) {super.onStartTemporaryDetach(); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onStartTemporaryDetach");
{super.onStartTemporaryDetach(); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onStartTemporaryDetach(); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_start_temporary_detach}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_start_temporary_detach()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_start_temporary_detach");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onStartTemporaryDetach}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onStartTemporaryDetach()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onStartTemporaryDetach");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onStartTemporaryDetach(); return;}
}
}
}
示例4: onAttachedToWindow
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onAttachedToWindow() {
if (ScriptLoader.isCalledFromJRuby()) {super.onAttachedToWindow(); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onAttachedToWindow");
{super.onAttachedToWindow(); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onAttachedToWindow(); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_attached_to_window}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_attached_to_window()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_attached_to_window");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onAttachedToWindow}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onAttachedToWindow()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onAttachedToWindow");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onAttachedToWindow(); return;}
}
}
}
示例5: onCreateContextMenu
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onCreateContextMenu(android.view.ContextMenu menu) {
if (ScriptLoader.isCalledFromJRuby()) {super.onCreateContextMenu(menu); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onCreateContextMenu");
{super.onCreateContextMenu(menu); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onCreateContextMenu(menu); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_create_context_menu}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_menu", menu);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_create_context_menu($arg_menu)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_create_context_menu", menu);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCreateContextMenu}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_menu", menu);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onCreateContextMenu($arg_menu)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onCreateContextMenu", menu);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onCreateContextMenu(menu); return;}
}
}
}
示例6: onWindowVisibilityChanged
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onWindowVisibilityChanged(int visibility) {
if (ScriptLoader.isCalledFromJRuby()) {super.onWindowVisibilityChanged(visibility); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onWindowVisibilityChanged");
{super.onWindowVisibilityChanged(visibility); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onWindowVisibilityChanged(visibility); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_window_visibility_changed}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_visibility", visibility);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_window_visibility_changed($arg_visibility)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_window_visibility_changed", visibility);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onWindowVisibilityChanged}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_visibility", visibility);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onWindowVisibilityChanged($arg_visibility)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onWindowVisibilityChanged", visibility);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onWindowVisibilityChanged(visibility); return;}
}
}
}
示例7: onDetachedFromWindow
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onDetachedFromWindow() {
if (ScriptLoader.isCalledFromJRuby()) {super.onDetachedFromWindow(); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onDetachedFromWindow");
{super.onDetachedFromWindow(); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onDetachedFromWindow(); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_detached_from_window}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_detached_from_window()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_detached_from_window");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onDetachedFromWindow}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onDetachedFromWindow()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onDetachedFromWindow");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onDetachedFromWindow(); return;}
}
}
}
示例8: onDraw
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onDraw(android.graphics.Canvas canvas) {
if (ScriptLoader.isCalledFromJRuby()) {super.onDraw(canvas); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onDraw");
{super.onDraw(canvas); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onDraw(canvas); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_draw}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_canvas", canvas);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_draw($arg_canvas)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_draw", canvas);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onDraw}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_canvas", canvas);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onDraw($arg_canvas)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onDraw", canvas);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onDraw(canvas); return;}
}
}
}
示例9: onFinishInflate
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onFinishInflate() {
if (ScriptLoader.isCalledFromJRuby()) {super.onFinishInflate(); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onFinishInflate");
{super.onFinishInflate(); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onFinishInflate(); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_finish_inflate}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_finish_inflate()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_finish_inflate");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onFinishInflate}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onFinishInflate()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onFinishInflate");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onFinishInflate(); return;}
}
}
}
示例10: onTouchEvent
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onTouchEvent(android.view.MotionEvent event) {
if (ScriptLoader.isCalledFromJRuby()) return super.onTouchEvent(event);
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onTouchEvent");
return super.onTouchEvent(event);
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) return super.onTouchEvent(event);
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_touch_event}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_event", event);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_touch_event($arg_event)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_touch_event", event);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onTouchEvent}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_event", event);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onTouchEvent($arg_event)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onTouchEvent", event);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
return super.onTouchEvent(event);
}
}
}
示例11: onFinishTemporaryDetach
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onFinishTemporaryDetach() {
if (ScriptLoader.isCalledFromJRuby()) {super.onFinishTemporaryDetach(); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onFinishTemporaryDetach");
{super.onFinishTemporaryDetach(); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onFinishTemporaryDetach(); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_finish_temporary_detach}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_finish_temporary_detach()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_finish_temporary_detach");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onFinishTemporaryDetach}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onFinishTemporaryDetach()");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onFinishTemporaryDetach");
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onFinishTemporaryDetach(); return;}
}
}
}
示例12: onDisplayHint
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onDisplayHint(int hint) {
if (ScriptLoader.isCalledFromJRuby()) {super.onDisplayHint(hint); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onDisplayHint");
{super.onDisplayHint(hint); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onDisplayHint(hint); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_display_hint}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_hint", hint);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_display_hint($arg_hint)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_display_hint", hint);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onDisplayHint}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_hint", hint);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onDisplayHint($arg_hint)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onDisplayHint", hint);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onDisplayHint(hint); return;}
}
}
}
示例13: onCreateInputConnection
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo outAttrs) {
if (ScriptLoader.isCalledFromJRuby()) return super.onCreateInputConnection(outAttrs);
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onCreateInputConnection");
return super.onCreateInputConnection(outAttrs);
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) return super.onCreateInputConnection(outAttrs);
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_create_input_connection}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_outAttrs", outAttrs);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (android.view.inputmethod.InputConnection) JRubyAdapter.runScriptlet("$ruby_instance.on_create_input_connection($arg_outAttrs)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (android.view.inputmethod.InputConnection) JRubyAdapter.runRubyMethod(android.view.inputmethod.InputConnection.class, scriptInfo.getRubyInstance(), "on_create_input_connection", outAttrs);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onCreateInputConnection}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_outAttrs", outAttrs);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (android.view.inputmethod.InputConnection) JRubyAdapter.runScriptlet("$ruby_instance.onCreateInputConnection($arg_outAttrs)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (android.view.inputmethod.InputConnection) JRubyAdapter.runRubyMethod(android.view.inputmethod.InputConnection.class, scriptInfo.getRubyInstance(), "onCreateInputConnection", outAttrs);
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
return super.onCreateInputConnection(outAttrs);
}
}
}
示例14: onVisibilityChanged
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public void onVisibilityChanged(android.view.View changedView, int visibility) {
if (ScriptLoader.isCalledFromJRuby()) {super.onVisibilityChanged(changedView, visibility); return;}
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onVisibilityChanged");
{super.onVisibilityChanged(changedView, visibility); return;}
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) {super.onVisibilityChanged(changedView, visibility); return;}
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_visibility_changed}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_changedView", changedView);
JRubyAdapter.put("$arg_visibility", visibility);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.on_visibility_changed($arg_changedView, $arg_visibility)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "on_visibility_changed", new Object[]{changedView, visibility});
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onVisibilityChanged}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_changedView", changedView);
JRubyAdapter.put("$arg_visibility", visibility);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
JRubyAdapter.runScriptlet("$ruby_instance.onVisibilityChanged($arg_changedView, $arg_visibility)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
JRubyAdapter.runRubyMethod(scriptInfo.getRubyInstance(), "onVisibilityChanged", new Object[]{changedView, visibility});
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
{super.onVisibilityChanged(changedView, visibility); return;}
}
}
}
示例15: onKeyDown
import org.ruboto.JRubyAdapter; //导入方法依赖的package包/类
public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
if (ScriptLoader.isCalledFromJRuby()) return super.onKeyDown(keyCode, event);
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: GraphicsView#onKeyDown");
return super.onKeyDown(keyCode, event);
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) return super.onKeyDown(keyCode, event);
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_key_down}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_keyCode", keyCode);
JRubyAdapter.put("$arg_event", event);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.on_key_down($arg_keyCode, $arg_event)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_key_down", new Object[]{keyCode, event});
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onKeyDown}")) {
// FIXME(uwe): Simplify when we stop support for RubotoCore 0.4.7
if (JRubyAdapter.isJRubyPreOneSeven()) {
JRubyAdapter.put("$arg_keyCode", keyCode);
JRubyAdapter.put("$arg_event", event);
JRubyAdapter.put("$ruby_instance", scriptInfo.getRubyInstance());
return (Boolean) JRubyAdapter.runScriptlet("$ruby_instance.onKeyDown($arg_keyCode, $arg_event)");
} else {
if (JRubyAdapter.isJRubyOneSeven()) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onKeyDown", new Object[]{keyCode, event});
} else {
throw new RuntimeException("Unknown JRuby version: " + JRubyAdapter.get("JRUBY_VERSION"));
}
}
} else {
return super.onKeyDown(keyCode, event);
}
}
}