本文整理匯總了Java中org.commcare.suite.model.PropertySetter類的典型用法代碼示例。如果您正苦於以下問題:Java PropertySetter類的具體用法?Java PropertySetter怎麽用?Java PropertySetter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PropertySetter類屬於org.commcare.suite.model包,在下文中一共展示了PropertySetter類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerModule
import org.commcare.suite.model.PropertySetter; //導入依賴的package包/類
public void registerModule() {
String[] prototypes = new String[] {BasicInstaller.class.getName(),
LocaleFileInstaller.class.getName(),
SuiteInstaller.class.getName(),
ProfileInstaller.class.getName(),
MediaInstaller.class.getName(),
XFormInstaller.class.getName(),
Text.class.getName(),
PropertySetter.class.getName(),
FormEntry.class.getName(),
DummyGraphDetailTemplate.class.getName()};
PrototypeManager.registerPrototypes(prototypes);
StorageManager.registerStorage(CommCareContext.STORAGE_TABLE_GLOBAL, Resource.class);
StorageManager.registerStorage(Suite.STORAGE_KEY, Suite.class);
StorageManager.registerStorage(Profile.STORAGE_KEY, Profile.class);
}
示例2: initProperties
import org.commcare.suite.model.PropertySetter; //導入依賴的package包/類
private void initProperties(Profile profile) {
// TODO Baaaaaad. Encapsulate this better!!!
SharedPreferences prefs = CommCareApp.currentSandbox.getAppPreferences();
Editor editor = prefs.edit();
for (PropertySetter p : profile.getPropertySetters()) {
editor.putString(p.getKey(), p.isForce() ? p.getValue() : prefs.getString(p.getKey(), p.getValue()));
}
editor.commit();
}
示例3: setDefaultLocale
import org.commcare.suite.model.PropertySetter; //導入依賴的package包/類
private void setDefaultLocale() {
String defaultLocale = "default";
for (PropertySetter prop : platform.getCurrentProfile().getPropertySetters()) {
if ("cur_locale".equals(prop.getKey())) {
defaultLocale = prop.getValue();
break;
}
}
print.println("Setting locale to: " + defaultLocale);
Localization.setLocale(defaultLocale);
}