{
// ----------
// Name field
// ----------
String id = NAME;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return ((Pipe) model).getName();
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setName((String) value);
}
};
TextEditor editor = new TextEditor();
editor.setSize(75);
editor.setFormatter(new NullHidingFormatter());
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}
{
// --------------
// Password field
// --------------
String id = START_PASSWORD;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return ((Pipe) model).getStartPassword();
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setStartPassword((String) value);
}
};
PasswordEditor editor = new PasswordEditor();
editor.setSize(20);
editor.setFormatter(new NullHidingFormatter());
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}
/*
{
// ----------------------
// Enable RPC start field
// ----------------------
String id = ENABLE_RPC_START;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return new Boolean(((Pipe) model).isRpcStartEnabled());
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setRpcStartEnabled(((Boolean) value).booleanValue());
}
};
BooleanEditor editor = new BooleanEditor();
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}
*/
{
// ----------------------
// Enable HTTP start field
// ----------------------
String id = ENABLE_HTTP_START;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return new Boolean(((Pipe) model).isHttpStartEnabled());
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setHttpStartEnabled(((Boolean) value).booleanValue());
}
};
BooleanEditor editor = new BooleanEditor();
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}
{
// -------------------------
// Verbosity level drop down
// -------------------------
String id = VERBOSITY_LEVEL;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return new Integer(((Pipe) model).getLoggingVerbosityLevel());
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setLoggingVerbosityLevel(((Integer) value).intValue());
}
};
SelectEditor editor = new SelectEditor();
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.LOG_ERROR),
"log_errors"));
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.LOG_WARNING),
"log_warnings"));
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.LOG_DEBUG),
"log_debug"));
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.LOG_DYNAMIC),
"log_dynamic"));
editor.setFormatter(new IntegerFormatter());
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}
{
// -------------------------
// Transfer log notification level drop down
// -------------------------
String id = NOTIFICATION_LEVEL;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return new Integer(((Pipe) model).getTransferLogNotificationLevel());
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setTransferLogNotificationLevel(((Integer) value).intValue());
}
};
SelectEditor editor = new SelectEditor();
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.MAIL_ERROR),
"log_errors"));
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.MAIL_WARNING),
"log_warnings"));
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.MAIL_DEBUG),
"log_debug"));
editor.addOption(new DefaultSelectOption(
new Integer(MessageLogger.MAIL_NONE),
"mail_none"));
editor.setFormatter(new IntegerFormatter());
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}{
// ----------
// Mail server field
// ----------
String id = MAIL_HOST;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return ((Pipe) model).getMailHost();
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setMailHost((String) value);
}
};
TextEditor editor = new TextEditor();
editor.setSize(25);
editor.setFormatter(new NullHidingFormatter());
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}{
// ----------
// Recipient name field
// ----------
String id = RECIPIENT;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return ((Pipe) model).getRecipientAddress();
}
public void setModelValue(Object model, Object value) throws Exception {
((Pipe) model).setRecipientAddress((String) value);
}
};
TextEditor editor = new TextEditor();
editor.setSize(25);
editor.setFormatter(new NullHidingFormatter());
generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
}{
// ----------
// Send-mail-when-pipe-aborts checkbox
// ----------
String id = ENABLE_ABORT_MAIL;
ModelModifier modifier = new DefaultModelModifier() {
public Object getModelValue(Object model) throws Exception {
return ((Pipe) model).isAbortMailEnabled();
}
public void setModelValue(Object model, Object value) throws Exception {