use of com.sun.messaging.jmq.admin.apps.console.util.LongField in project openmq by eclipse-ee4j.
the class ObjStoreConFactoryDialog method makeLabelledComponent.
private LabelledComponent makeLabelledComponent(AdministeredObject aobj, String propName) {
LabelledComponent lc = null;
String propType = null;
String propLabel = null;
String propDefault = null;
try {
propType = aobj.getPropertyType(propName);
propLabel = aobj.getPropertyLabel(propName);
propDefault = aobj.getProperty(propName);
} catch (Exception e) {
System.out.println("Exception for property: " + propName + e);
}
if (propType.equals(AdministeredObject.AO_PROPERTY_TYPE_LIST)) {
String listValues = aobj.getPropertyListValues(propName);
String[] comboValues = stringToArray(listValues, "|");
// Remove any "..." from menu, not yet implemented
comboValues = omitOtherValues(comboValues);
// subst any "..." values for "Other..."
changeOtherValues(comboValues);
if (comboValues != null) {
lc = new LabelledComponent(propLabel + ":", new JComboBox(comboValues));
JComboBox comp = (JComboBox) lc.getComponent();
comp.addActionListener(this);
lc.setClientData(propName);
}
extraItems = new LabelledComponent[0];
} else if (propType.equals(AdministeredObject.AO_PROPERTY_TYPE_INTEGER)) {
if (propDefault == null) {
lc = new LabelledComponent(propLabel + ":", new IntegerField(Integer.MIN_VALUE, Integer.MAX_VALUE, propDefault, 7));
} else {
lc = new LabelledComponent(propLabel + ":", new IntegerField(Integer.MIN_VALUE, Integer.MAX_VALUE, 7));
}
lc.setClientData(propName);
} else if (propType.equals(AdministeredObject.AO_PROPERTY_TYPE_LONG)) {
if (propDefault == null) {
lc = new LabelledComponent(propLabel + ":", new LongField(Long.MIN_VALUE, Long.MAX_VALUE, propDefault, 7));
} else {
lc = new LabelledComponent(propLabel + ":", new LongField(Long.MIN_VALUE, Long.MAX_VALUE, 7));
}
lc.setClientData(propName);
} else if (propType.equals(AdministeredObject.AO_PROPERTY_TYPE_BOOLEAN)) {
lc = new LabelledComponent(propLabel + ":", new JCheckBox());
lc.setClientData(propName);
} else if (propType.equals(AdministeredObject.AO_PROPERTY_TYPE_STRING)) {
lc = new LabelledComponent(propLabel + ":", new JTextField(15));
lc.setClientData(propName);
} else {
lc = new LabelledComponent(propLabel + ":", new JTextField(15));
lc.setClientData(propName);
}
return lc;
}
Aggregations