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


Java PluginEntry类代码示例

本文整理汇总了Java中org.apache.cordova.PluginEntry的典型用法代码示例。如果您正苦于以下问题:Java PluginEntry类的具体用法?Java PluginEntry怎么用?Java PluginEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getPlugin

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Get the plugin object that implements the service.
 * If the plugin object does not already exist, then create it.
 * If the service doesn't exist, then return null.
 *
 * @param service       The name of the service.
 * @return              CordovaPlugin or null
 */
public CordovaPlugin getPlugin(String service) {
    CordovaPlugin ret = pluginMap.get(service);
    if (ret == null) {
        PluginEntry pe = entryMap.get(service);
        if (pe == null) {
            return null;
        }
        if (pe.plugin != null) {
            ret = pe.plugin;
        } else {
            ret = instantiatePlugin(pe.pluginClass);
        }
        ret.privateInitialize(ctx, app, app.getPreferences());
        pluginMap.put(service, ret);
    }
    return ret;
}
 
开发者ID:aabognah,项目名称:LoRaWAN-Smart-Parking,代码行数:26,代码来源:PluginManager.java

示例2: onOverrideUrlLoading

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Called when the URL of the webview changes.
 *
 * @param url               The URL that is being changed to.
 * @return                  Return false to allow the URL to load, return true to prevent the URL from loading.
 */
public boolean onOverrideUrlLoading(String url) {
    // Deprecated way to intercept URLs. (process <url-filter> tags).
    // Instead, plugins should not include <url-filter> and instead ensure
    // that they are loaded before this function is called (either by setting
    // the onload <param> or by making an exec() call to them)
    for (PluginEntry entry : this.entryMap.values()) {
        List<String> urlFilters = urlMap.get(entry.service);
        if (urlFilters != null) {
            for (String s : urlFilters) {
                if (url.startsWith(s)) {
                    return getPlugin(entry.service).onOverrideUrlLoading(url);
                }
            }
        } else {
            CordovaPlugin plugin = pluginMap.get(entry.service);
            if (plugin != null && plugin.onOverrideUrlLoading(url)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:aabognah,项目名称:LoRaWAN-Smart-Parking,代码行数:29,代码来源:PluginManager.java

示例3: loadUrl

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
@Override
public void loadUrl(String url, boolean clearNavigationStack) {
    if (!activityDelegate.isXWalkReady()) {
        startUrl = url;

        CordovaPlugin initPlugin = new CordovaPlugin() {
            @Override
            public void onResume(boolean multitasking) {
                activityDelegate.onResume();
            }
        };
        pluginManager.addService(new PluginEntry("XWalkInit", initPlugin));
        return;
    }
    webView.load(url, null);
}
 
开发者ID:infil00p,项目名称:cordova-photosphere-example,代码行数:17,代码来源:XWalkWebViewEngine.java

示例4: onOverrideUrlLoading

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Called when the URL of the webview changes.
 *
 * @param url               The URL that is being changed to.
 * @return                  Return false to allow the URL to load, return true to prevent the URL from loading.
 */
public boolean onOverrideUrlLoading(String url) {
    // Deprecated way to intercept URLs. (process <url-filter> tags).
    // Instead, plugins should not include <url-filter> and instead ensure
    // that they are loaded before this function is called (either by setting
    // the onload <param> or by making an exec() call to them)
    for (PluginEntry entry : this.entryMap.values()) {
        List<String> urlFilters = urlMap.get(entry.service);
        if (urlFilters != null) {
            for (String s : urlFilters) {
                if (url.startsWith(s)) {
                    Log.d(TAG,"onOverrideUrlLoading()");
                    return getPlugin(entry.service).onOverrideUrlLoading(url);
                }
            }
        } else {
            CordovaPlugin plugin = pluginMap.get(entry.service);
            if (plugin != null && plugin.onOverrideUrlLoading(url)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:chrisuehlinger,项目名称:smart-mirror-app,代码行数:30,代码来源:PluginManager.java

示例5: clear

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Clear all markups
 * @param args
 * @param callbackContext
 * @throws JSONException
 */
@SuppressWarnings("unused")
private void clear(JSONArray args, CallbackContext callbackContext) throws JSONException {
  Set<String> pluginNames = plugins.keySet();
  Iterator<String> iterator = pluginNames.iterator();
  String pluginName;
  PluginEntry pluginEntry;
  while(iterator.hasNext()) {
    pluginName = iterator.next();
    if ("Map".equals(pluginName) == false) {
      pluginEntry = plugins.get(pluginName);
      ((MyPlugin) pluginEntry.plugin).clear();
    }
  }

  this.map.clear();
  this.sendNoResult(callbackContext);
}
 
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:24,代码来源:GoogleMaps.java

示例6: onMarkerClick

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
  this.onMarkerEvent("click", marker);
  
  JSONObject properties = null;
  String propertyId = "marker_property_" + marker.getId();
  PluginEntry pluginEntry = this.plugins.get("Marker");
  PluginMarker pluginMarker = (PluginMarker)pluginEntry.plugin;
  if (pluginMarker.objects.containsKey(propertyId)) {
    properties = (JSONObject) pluginMarker.objects.get(propertyId);
    if (properties.has("disableAutoPan")) {
      boolean disableAutoPan = false;
      try {
        disableAutoPan = properties.getBoolean("disableAutoPan");
      } catch (JSONException e) {}
      if (disableAutoPan) {
        //marker.showInfoWindow();
        return true;
      }
    }
  }

  //marker.showInfoWindow();
  return true;
  //return false;
}
 
开发者ID:neo4art,项目名称:neo4art,代码行数:27,代码来源:GoogleMaps.java

示例7: postMessage

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (PluginEntry entry : this.entries.values()) {
        if (entry.plugin != null) {
            obj = entry.plugin.onMessage(id, data);
            if (obj != null) {
                return obj;
            }
        }
    }
    return null;
}
 
开发者ID:Zimtronic,项目名称:posjs2,代码行数:23,代码来源:PluginManager.java

示例8: onOverrideUrlLoading

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Called when the URL of the webview changes.
 *
 * @param url               The URL that is being changed to.
 * @return                  Return false to allow the URL to load, return true to prevent the URL from loading.
 */
public boolean onOverrideUrlLoading(String url) {
    // Deprecated way to intercept URLs. (process <url-filter> tags).
    // Instead, plugins should not include <url-filter> and instead ensure
    // that they are loaded before this function is called (either by setting
    // the onload <param> or by making an exec() call to them)
    for (PluginEntry entry : this.entries.values()) {
        List<String> urlFilters = urlMap.get(entry.service);
        if (urlFilters != null) {
            for (String s : urlFilters) {
                if (url.startsWith(s)) {
                    return getPlugin(entry.service).onOverrideUrlLoading(url);
                }
            }
        } else if (entry.plugin != null) {
            if (entry.plugin.onOverrideUrlLoading(url)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:trujunzhang,项目名称:CrossWalkAndroidStudio,代码行数:28,代码来源:PluginManager.java

示例9: init

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
/**
 * Init when loading a new HTML page into webview.
 */
public void init() {
    LOG.d(TAG, "init()");

    // If first time, then load plugins from config.xml file
    if (this.firstRun) {
        this.loadPlugins();
        this.firstRun = false;
    }

    // Stop plugins on current HTML page and discard plugin objects
    else {
        this.onPause(false);
        this.onDestroy();
        this.clearPluginObjects();
    }

    // Insert PluginManager service
    this.addService(new PluginEntry("PluginManager", new PluginManagerService()));

    // Start up all plugins that have onload specified
    this.startupPlugins();
}
 
开发者ID:ZachMoreno,项目名称:krakn,代码行数:26,代码来源:PluginManager.java

示例10: init

import org.apache.cordova.PluginEntry; //导入依赖的package包/类
@Override
public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries,
        Whitelist whitelist, CordovaPreferences preferences) {
    if (this.cordova != null) {
        throw new IllegalStateException();
    }
    this.cordova = cordova;
    this.whitelist = whitelist;
    this.preferences = preferences;

    pluginManager = new PluginManager(this, this.cordova, pluginEntries);
    resourceApi = new CordovaResourceApi(webview.getContext(), pluginManager);
    bridge = new CordovaBridge(pluginManager, new NativeToJsMessageQueue(this, cordova));
    pluginManager.addService("App", "org.apache.cordova.CoreAndroid");
    initWebViewSettings();

    webview.init(this);
    exposeJsInterface();
}
 
开发者ID:ZachMoreno,项目名称:krakn,代码行数:20,代码来源:XWalkCordovaWebView.java


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