當前位置: 首頁>>代碼示例>>Java>>正文


Java KrollDict.containsKey方法代碼示例

本文整理匯總了Java中org.appcelerator.kroll.KrollDict.containsKey方法的典型用法代碼示例。如果您正苦於以下問題:Java KrollDict.containsKey方法的具體用法?Java KrollDict.containsKey怎麽用?Java KrollDict.containsKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.appcelerator.kroll.KrollDict的用法示例。


在下文中一共展示了KrollDict.containsKey方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleCreationDict

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void handleCreationDict(KrollDict dict) {
	super.handleCreationDict(dict);
	
	if (dict.containsKey(PROPERTY_ID)) {
		setId(TiConvert.toInt(dict, PROPERTY_ID));
	} else {
		throw new IllegalArgumentException("property 'id' is required");
	}
	if (dict.containsKey(PROPERTY_TITLE)) {
		setTitle(TiConvert.toString(dict, PROPERTY_TITLE));
	}
	if (dict.containsKey(PROPERTY_TEXT)) {
		setText(TiConvert.toString(dict, PROPERTY_TEXT));
	}
	if (dict.containsKey(PROPERTY_ICON)) {
		setIcon(TiConvert.toInt(dict, PROPERTY_ICON));
	}
	if (dict.containsKey(PROPERTY_PENDING_INTENT)) {
		setPendingIntent((PendingIntentProxy) dict.get(PROPERTY_PENDING_INTENT));
	}
	if (dict.containsKey(PROPERTY_NUMBER)) {
		setNumber(TiConvert.toInt(dict, PROPERTY_NUMBER));
	}
}
 
開發者ID:azwan082,項目名稱:nc_progress_notification,代碼行數:26,代碼來源:NotificationProxy.java

示例2: handleCreationDict

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void handleCreationDict(KrollDict options) {
	super.handleCreationDict(options);
	if (options.containsKey(TiC.PROPERTY_URL)) {
		setProperty(TiC.PROPERTY_URL, resolveUrl(null, TiConvert.toString(options, TiC.PROPERTY_URL)));
	}
	if (options.containsKey(TiC.PROPERTY_ALLOW_BACKGROUND)) {
		setProperty(TiC.PROPERTY_ALLOW_BACKGROUND, options.get(TiC.PROPERTY_ALLOW_BACKGROUND));
	}
	if(options.containsKey("speakerphone")) {
		setProperty("speakerphone", TiConvert.toBoolean(options.get("speakerphone")));
	}
	if (DBG) {
		Log.i(LCAT, "Creating audio player proxy for url: " + TiConvert.toString(getProperty("url")));
	}
}
 
開發者ID:DesktopSolutionsSoftware,項目名稱:android-audioplayer,代碼行數:17,代碼來源:AudioPlayerProxy.java

示例3: handleCreationDict

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void handleCreationDict(KrollDict d)
{
	super.handleCreationDict(d);
	if (d == null) {
		return;
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_BIG_TEXT)) {
		setBigText(TiConvert.toString(d.get(NotificationfactoryModule.PROPERTY_BIG_TEXT)));
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_BIG_CONTENT_TITLE)) {
		setBigContentTitle(TiConvert.toString(d.get(NotificationfactoryModule.PROPERTY_BIG_CONTENT_TITLE)));
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_SUMMARY_TEXT)) {
		setSummaryText(TiConvert.toString(d.get(NotificationfactoryModule.PROPERTY_SUMMARY_TEXT)));
	}
}
 
開發者ID:falkolab,項目名稱:Ti.NotificationFactory,代碼行數:21,代碼來源:BigTextStyleProxy.java

示例4: handleCreationDict

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void handleCreationDict(KrollDict d)
{
	super.handleCreationDict(d);
	if (d == null) {
		return;
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_BIG_LARGE_ICON)) {
		setBigLargeIcon(d.get(NotificationfactoryModule.PROPERTY_BIG_LARGE_ICON));
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_BIG_PICTURE)) {
		setBigPicture(d.get(NotificationfactoryModule.PROPERTY_BIG_PICTURE));
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_BIG_CONTENT_TITLE)) {
		setBigContentTitle(TiConvert.toString(d.get(NotificationfactoryModule.PROPERTY_BIG_CONTENT_TITLE)));
	}
	
	if (d.containsKey(NotificationfactoryModule.PROPERTY_SUMMARY_TEXT)) {
		setSummaryText(TiConvert.toString(d.get(NotificationfactoryModule.PROPERTY_SUMMARY_TEXT)));
	}
}
 
開發者ID:falkolab,項目名稱:Ti.NotificationFactory,代碼行數:25,代碼來源:BigPictureStyleProxy.java

示例5: signin

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Kroll.method
public void signin(KrollDict props)
{
	if (props.containsKey("success")) {
		successCallback = (KrollFunction) props.get("success");
	}
	if (props.containsKey("error")) {
		errorCallback = (KrollFunction) props.get("error");
	}
	

	String[] accountTypes = new String[] { GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE };
	Intent intent = AccountPicker.newChooseAccountIntent(null, null,
			accountTypes, false, null, null, null, null);

	Activity activity = TiApplication.getAppCurrentActivity();
	TiActivitySupport support = (TiActivitySupport) activity;
	requestCode = support.getUniqueResultCode();
	support.launchActivityForResult(intent, requestCode, this);

}
 
開發者ID:Sitata,項目名稱:titanium_google_auth_util,代碼行數:22,代碼來源:TitaniumGoogleAuthUtilModule.java

示例6: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict d)
{	
	super.processProperties(d);
	
	if(d.containsKey("save_location")){
		SAVE = d.getString("save_location");
	}
	
	if( d.containsKey("useFrontCamera") ){
		Log.i(TAG, "Front Camera Property exists!");
		FRONT_CAMERA = d.getBoolean("useFrontCamera");
	}
	
	if( d.containsKey("pictureTimeout")){
		PICTURE_TIMEOUT = d.getInt("pictureTimeout");
	}
	
	if( d.containsKey("resolutionNamed") ){
		RESOLUTION_NAME = d.getInt("resolutionNamed");
	}
}
 
開發者ID:brownemint,項目名稱:Ti-Android-CameraView,代碼行數:23,代碼來源:CameraViewProxy.java

示例7: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict props)
{
	super.processProperties(props);
	
	if (props.containsKey("zoom")) {
		tiv.setZoom(TiConvert.toFloat(proxy.getProperty("zoom")));
	}
	if (props.containsKey("image")) {
		handleImage(proxy.getProperty("image"));
	}
	if (props.containsKey("maxZoom")) {
		tiv.setMaxZoom(TiConvert.toFloat(proxy.getProperty("maxZoom")));
	}
	if (props.containsKey("minZoom")) {
		tiv.setMinZoom(TiConvert.toFloat(proxy.getProperty("minZoom")));
	}
}
 
開發者ID:iotashan,項目名稱:TiTouchImageView,代碼行數:19,代碼來源:ViewProxy.java

示例8: CollectionItemData

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
public CollectionItemData (KrollDict properties, CollectionViewTemplate template) {
	this.properties = properties;
	this.template = template;
	//set searchableText
	if (properties.containsKey(TiC.PROPERTY_PROPERTIES)) {
		Object props = properties.get(TiC.PROPERTY_PROPERTIES);
		if (props instanceof HashMap) {
			HashMap<String, Object> propsHash = (HashMap<String, Object>) props;
			Object searchText = propsHash.get(TiC.PROPERTY_SEARCHABLE_TEXT);
			if (propsHash.containsKey(TiC.PROPERTY_SEARCHABLE_TEXT) && searchText != null) {
				searchableText = TiConvert.toString(searchText);
			}
		}
	}

}
 
開發者ID:nuno,項目名稱:TiCollectionView,代碼行數:17,代碼來源:CollectionSectionProxy.java

示例9: createPolyline

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
/**
 * <p>Draws a polyline on the map view.</p>
 * Supported parameters:<br>
 * latlngs Array&lt;Array&lt;Integer&gt;&gt; Like [ [45,12], [45,13] ]<br>
 * color String Supported colors are: black, blue, green, red, transparent, white.<br>
 * strokeWidth Integer
 * @param dict	dictionary with key-value pairs: {key:value}.
 */
@Kroll.method
public HashMap createPolyline(KrollDict dict) {
	containsKey(dict, KEY_COORDINATES);
	
	Object[] coordinates = (Object[]) dict.get(KEY_COORDINATES);
	List<LatLong> geom = coordinatesToList(coordinates);
	Color color = Color.RED;
	float strokeWidth = 0;
	
	if (dict.containsKey(KEY_COLOR)) {
		color = Color.valueOf(dict.get(KEY_COLOR).toString().toUpperCase());
	}
	if (dict.containsKey(KEY_STROKEWIDTH)) {
		strokeWidth = TiConvert.toFloat(dict.get(KEY_STROKEWIDTH));
	}
			
	int id = mView.createPolyline(geom, color, strokeWidth);
	dict.put(KEY_ID, id);
	dict.put(KEY_LAYERTYPE, TYPE_POLYLINE);
	
	return dict;
}
 
開發者ID:snowciety,項目名稱:sc.mapsforge,代碼行數:31,代碼來源:MapsforgeViewProxy.java

示例10: createPolygon

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
/**
 * <p>Draws a polygon on the map view.</p>
 * Supported parameters:<br>
 * latlngs Array&lt;Array&lt;Integer&gt;&gt; Like [ [45,12], [45,13] ]<br>
 * fillColor String Supported colors are: black, blue, green, red, transparent, white.<br>
 * strokeColor String Supported colors are: black, blue, green, red, transparent, white.<br>
 * strokeWidth Integer
 * @param dict	dictionary with key-value pairs: {key:value}.
 */
@Kroll.method
public HashMap createPolygon(KrollDict dict) {
	containsKey(dict, KEY_COORDINATES);
	
	Object[] coordinates = (Object[]) dict.get(KEY_COORDINATES);
	List<LatLong> geom = coordinatesToList(coordinates);
	Color fillColor = Color.TRANSPARENT;
	Color strokeColor = Color.BLACK;
	float strokeWidth = 0;
	if (dict.containsKey(KEY_FILLCOLOR)) {
		fillColor = Color.valueOf(dict.get(KEY_FILLCOLOR).toString().toUpperCase());
	}
	if (dict.containsKey(KEY_STROKECOLOR)) {
		strokeColor = Color.valueOf(dict.get(KEY_STROKECOLOR).toString().toUpperCase());
	}
	if (dict.containsKey(KEY_STROKEWIDTH)) {
		strokeWidth = TiConvert.toFloat(dict.get(KEY_STROKEWIDTH));
	}
	
	int id = mView.createPolygon(geom, fillColor, strokeColor, strokeWidth);
	dict.put(KEY_ID, id);
	dict.put(KEY_LAYERTYPE, TYPE_POLYGON);

	return dict;
}
 
開發者ID:snowciety,項目名稱:sc.mapsforge,代碼行數:35,代碼來源:MapsforgeViewProxy.java

示例11: discoveryFinished

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
/**
 * @event bluetooth:discovery
 * @param devices {object} Keys are device names and values are hardware addresses.  Currently, only the name is used by this module.
 * @since 1.0
 */
public void discoveryFinished(BluetoothDevice[] devices)
{
	KrollDict allDevices = new KrollDict();
	//Set<BluetoothDevice> bondedDevices = mBluetooth.findBondedDevices();

	// add discovered devices to availableDevices
	for(Integer j = 0; j < devices.length; j++)
	{
		if(devices[j] != null && !allDevices.containsKey(devices[j]))
		{
			try{
				mBluetooth.startSdp(devices[j]);
			}
			catch(Exception e){
				e.printStackTrace();
				sendError(e.getMessage());
			}
			allDevices.put(devices[j].getName(), devices[j].getAddress());
		}
	}

	// make sure it's a new Dict every time discovery occurs
	mDevices = allDevices;

	KrollDict props = new KrollDict();
	props.put("devices", mDevices);

	fireEvent(DISCOVERY_FINISHED, props);
}
 
開發者ID:eyesore,項目名稱:appc-android-bluetooth,代碼行數:35,代碼來源:BluetoothModule.java

示例12: handleCreationDict

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void handleCreationDict(KrollDict options)
{
	super.handleCreationDict(options);

	if (options.containsKey("message")) {
		Log.d(LCAT, "example created with message: " + options.get("message"));
	}
}
 
開發者ID:E2010,項目名稱:android-parse-module-titanium-3-5,代碼行數:10,代碼來源:ExampleProxy.java

示例13: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict d)
{
	if (d.containsKey(PROPERTY_VOLUME)) {
		setVolume(TiConvert.toFloat(d, PROPERTY_VOLUME));
	} else {
		setVolume(0.5f);
	}

	if (d.containsKey(TiC.PROPERTY_TIME)) {
		setTime(TiConvert.toInt(d, TiC.PROPERTY_TIME));
	}
}
 
開發者ID:DesktopSolutionsSoftware,項目名稱:android-audioplayer,代碼行數:14,代碼來源:MediaPlayerWrapper.java

示例14: initialize

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Kroll.method
public void initialize(KrollDict props) {
  Log.d(LCAT, "TiIntercom : initialize()");
  if (props.containsKey("api_key") && props.containsKey("app_id")) {
    Intercom.initialize(theApp, props.getString("api_key"), props.getString("app_id"));
    initialized = true;
  } else {
    Log.d(LCAT, "Intercom : intialize() requies api_key and app_id to be set");
  }
}
 
開發者ID:centogram,項目名稱:TiIntercomAndroid,代碼行數:11,代碼來源:TiintercomandroidModule.java

示例15: processProperties

import org.appcelerator.kroll.KrollDict; //導入方法依賴的package包/類
@Override
public void processProperties(KrollDict d)
{
	if (d.containsKey(TiC.PROPERTY_VIEWS)) {
		setViews(d.get(TiC.PROPERTY_VIEWS));
	}
	
	if (d.containsKey(TiC.PROPERTY_CURRENT_PAGE)) {
		int page = TiConvert.toInt(d, TiC.PROPERTY_CURRENT_PAGE);
		if (page > 0) {
			setCurrentPage(page);
		}
	}
	
	if (d.containsKey(PROPERTY_ORIENTATION)) {
		mFlipView.setOrientation((String) d.get(PROPERTY_ORIENTATION));
	}
	
	if (d.containsKey(PROPERTY_OVERFLIPMODE)) {
		int mode = TiConvert.toInt(d, PROPERTY_OVERFLIPMODE);
		
		if (mode == AndroidflipModule.OVERFLIPMODE_GLOW) {
			mFlipView.setOverFlipMode(OverFlipMode.GLOW);
		}
		
		if (mode == AndroidflipModule.OVERFLIPMODE_RUBBER_BAND) {
			mFlipView.setOverFlipMode(OverFlipMode.RUBBER_BAND);
		}
	}
	
	setNativeView(mFlipView);
	
	super.processProperties(d);
}
 
開發者ID:manumaticx,項目名稱:TiAndroidFlip,代碼行數:35,代碼來源:TiFlipView.java


注:本文中的org.appcelerator.kroll.KrollDict.containsKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。