本文整理汇总了Java中tigase.form.Form.addField方法的典型用法代码示例。如果您正苦于以下问题:Java Form.addField方法的具体用法?Java Form.addField怎么用?Java Form.addField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tigase.form.Form
的用法示例。
在下文中一共展示了Form.addField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareRegistrationForm
import tigase.form.Form; //导入方法依赖的package包/类
private Element prepareRegistrationForm(final XMPPResourceConnection session) throws NoConnectionIdException {
Element query = new Element("query", new String[] { "xmlns" }, XMLNSS);
query.addChild(new Element("instructions", "Use the enclosed form to register."));
Form form = new Form(SignatureCalculator.SUPPORTED_TYPE, "Contest Registration",
"Please provide the following information to sign up for our special contests!");
form.addField(Field.fieldTextSingle("username", "", "Username"));
form.addField(Field.fieldTextPrivate("password", "", "Password"));
form.addField(Field.fieldTextSingle("email", "", "Email"));
SignatureCalculator sc = new SignatureCalculator(oauthConsumerKey, oauthConsumerSecret);
sc.setOauthToken(UUID.nameUUIDFromBytes((session.getConnectionId() + "|" + session.getSessionId()).getBytes()).toString());
sc.addEmptyFields(form);
query.addChild(form.getElement());
return query;
}
示例2: getTaskInfo
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getTaskInfo() {
Form result = new Form("", "Memory Information", "");
result.addField(Field.fieldTextSingle("heapMemMax", Long.toString(runtime.getHeapMemMax()), "Heap Memory Max"));
result.addField(Field.fieldTextSingle("heapMemUsed", Long.toString(runtime.getHeapMemUsed()), "Heap Memory Used"));
result.addField(Field.fieldTextSingle("heapMemUsedPercentage", Float.toString(runtime.getHeapMemUsage()),
"Heap Memory Used [%]"));
result.addField(Field.fieldTextSingle("nonHeapMemMax", Long.toString(runtime.getNonHeapMemMax()), "Non-Heap Memory Max"));
result.addField(Field.fieldTextSingle("nonHeapMemUsed", Long.toString(runtime.getNonHeapMemUsed()),
"Non-Heap Memory Used"));
result.addField(Field.fieldTextSingle("nonHeapMemUsedPercentage", Float.toString(runtime.getNonHeapMemUsage()),
"Non-Heap Memory Used [%]"));
result.addField(Field.fieldTextSingle("directMemUsed", Long.toString(runtime.getDirectMemUsed()), "Direct Memory Used"));
return result;
}
示例3: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form form = super.getCurrentConfiguration();
form.addField(Field.fieldTextSingle("averageLoadThreshold", String.valueOf(averageLoadThreshold),
"Alarm when AverageLoad is bigger than"));
return form;
}
示例4: getTaskInfo
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getTaskInfo() {
Form result = new Form("", "Load Information", "");
result.addField(Field.fieldTextSingle("averageLoad", Double.toString(runtime.getLoadAverage()), "Load Average"));
return result;
}
示例5: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form f = super.getCurrentConfiguration();
Field x = Field.fieldListSingle("levelTreshold", levelTreshold.getName(), "Log level threshold",
new String[] { Level.SEVERE.getName(), Level.WARNING.getName(), Level.INFO.getName(), Level.CONFIG.getName(),
Level.FINE.getName(), Level.FINER.getName(), Level.FINEST.getName(), Level.ALL.getName() },
new String[] { Level.SEVERE.getName(), Level.WARNING.getName(), Level.INFO.getName(), Level.CONFIG.getName(),
Level.FINE.getName(), Level.FINER.getName(), Level.FINEST.getName(), Level.ALL.getName() });
f.addField(x);
return f;
}
示例6: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form f = super.getCurrentConfiguration();
f.addField(Field.fieldTextSingle(PERIOD_VAR, "" + period, "Period [ms]"));
return f;
}
示例7: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form x = super.getCurrentConfiguration();
x.addField(Field.fieldTextSingle("cpuTempThreshold", "" + cpuTempThreshold, "CPU Temp threshold"));
// x.addField(Field.fieldTextSingle("N270#cpuTemp", "" +
// cpuTempThreshold, "CPU Temp threshold"));
return x;
}
示例8: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form form = super.getCurrentConfiguration();
form.addField(Field.fieldTextSingle("maxHeapMemUsagePercentThreshold", String.valueOf(maxHeapMemUsagePercentThreshold),
"Alarm when heap mem usage is bigger than [%]"));
form.addField(Field.fieldTextSingle("maxNonHeapMemUsagePercentThreshold",
String.valueOf(maxNonHeapMemUsagePercentThreshold), "Alarm when non-heap mem usage is bigger than [%]"));
return form;
}
示例9: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form f = new Form("", "Task Configuration", "");
f.addField(Field.fieldBoolean(ENABLED_VAR, enabled, "Enabled"));
// f.addField(Field.fieldTextSingle("period", "" + period,
// "Period [ms]"));
return f;
}
示例10: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form x = super.getCurrentConfiguration();
x.addField(Field.fieldTextSingle("threshold", "" + threshold, "Percent of disconnected users"));
x.addField(Field.fieldTextSingle("thresholdMinimal", "" + thresholdMinimal, "Minimal amount of disconnected users"));
return x;
}
示例11: buildInstructionsForm
import tigase.form.Form; //导入方法依赖的package包/类
private Packet buildInstructionsForm(Packet packet) {
Element query = new Element("query", new String[] { "xmlns" }, XMLNSS);
Form form = new Form("form", null, null);
form.addField(Field.fieldHidden("FORM_TYPE", XMLNSS[0]));
Field phone = Field.fieldTextSingle("phone", null, "Phone number");
phone.setRequired(true);
form.addField(phone);
form.addField(Field.fieldTextSingle("force", null, "Force registration"));
form.addField(Field.fieldBoolean("fallback", null, "Fallback"));
form.addField(Field.fieldListSingle("challenge", null, "Challenge type",
new String[] {
"Verification code",
"Missed call",
"Caller ID",
},
new String[] {
PhoneNumberVerificationProvider.CHALLENGE_PIN,
PhoneNumberVerificationProvider.CHALLENGE_MISSED_CALL,
PhoneNumberVerificationProvider.CHALLENGE_CALLER_ID,
}));
query.addChild(form.getElement());
return packet.okResult(query, 0);
}
示例12: prepareRegisteredResponseForm
import tigase.form.Form; //导入方法依赖的package包/类
private Element prepareRegisteredResponseForm(byte[] publicKey) {
Element query = new Element("query", new String[] { "xmlns" }, XMLNSS);
Form form = new Form("form", null, null);
form.addField(Field.fieldHidden("FORM_TYPE", IQ_FORM_KONTALK_CODE_XMLNS));
form.addField(Field.fieldTextSingle("publickey", Base64.encode(publicKey), "Signed public key"));
query.addChild(form.getElement());
return query;
}
示例13: preparePrivateKeyStoredResponseForm
import tigase.form.Form; //导入方法依赖的package包/类
private Element preparePrivateKeyStoredResponseForm(String token) {
Element query = new Element("query", new String[] { "xmlns" }, XMLNSS);
Form form = new Form("form", null, null);
form.addField(Field.fieldHidden("FORM_TYPE", IQ_FORM_KONTALK_PRIVATEKEY_XMLNS));
form.addField(Field.fieldTextSingle("token", token, "Private key identification token"));
query.addChild(form.getElement());
return query;
}
示例14: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form x = super.getCurrentConfiguration();
x.addField(Field.fieldTextSingle("message", "", "Event message"));
return x;
}
示例15: getCurrentConfiguration
import tigase.form.Form; //导入方法依赖的package包/类
@Override
public Form getCurrentConfiguration() {
Form x = super.getCurrentConfiguration();
x.addField(Field.fieldTextSingle("threshold", "" + threshold, "Disk usage ratio threshold"));
return x;
}