/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { BaseField field = new ImageField(null, m_strFieldName, m_iMaxLength, m_strFieldDesc, null); field.setRecord(m_record); // Set table without adding to table field list return field; } /**
/** * Get this image as an icon. */ public PortableImage getImage() { if (this.isNull()) return null; /*if (this.getData() instanceof ImageIcon) return (ImageIcon)this.getData(); // Never (legacy) else*/ if (this.getData() instanceof PortableImage) return (PortableImage)this.getData(); else return null; } /**
/** * Constructor. * @param record The parent record. * @param strName The field name. * @param iDataLength The maximum string length (pass -1 for default). * @param strDesc The string description (usually pass null, to use the resource file desc). * @param strDefault The default value (if object, this value is the default value, if string, the string is the default). */ public ImageField(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { this(); this.init(record, strName, iDataLength, strDesc, strDefault); } /**
if (fldDisplayFieldDesc.getListener(BlankButtonHandler.class) == null) fldDisplayFieldDesc.addListener(new BlankButtonHandler(null)); if (fldDisplayFieldDesc != null) this.addListener(new ReadSecondaryHandler(fldDisplayFieldDesc.getRecord()));
/** * AddMasterListeners Method. */ public void addMasterListeners() { super.addMasterListeners(); this.addListener(new NoDeleteModifyHandler(true, false)); this.getField(Tour.FINALIZED).addListener(new FinalizeHandler(null)); this.getField(Tour.ORDER_COMPONENTS).addListener(new TourOrderHandler(null)); this.getField(Tour.CANCELLED).addListener(new TourOrderHandler(null)); this.getField(Tour.TOUR_STATUS_SUMMARY).addListener(new UpdateTourStatusSummaryHandler(null)); ((TourStatusField)this.getField(Tour.TOUR_STATUS_ID)).getIconField(null).addListener(new TourStatusUpdateHandler(null)); this.addActionListeners(); } /**
this.getRecord(Tour.TOUR_FILE).getField(Tour.TOUR_STATUS_ID).setupDefaultView(toolbar.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), toolbar, ScreenConstants.DONT_DISPLAY_DESC); if (((TourStatusField)this.getRecord(Tour.TOUR_FILE).getField(Tour.TOUR_STATUS_ID)).getIconField(null) != null) if (((TourStatusField)this.getRecord(Tour.TOUR_FILE).getField(Tour.TOUR_STATUS_ID)).getIconField(null).getListener(TourStatusUpdateHandler.class) == null) ((TourStatusField)this.getRecord(Tour.TOUR_FILE).getField(Tour.TOUR_STATUS_ID)).getIconField(null).addListener(new TourStatusUpdateHandler(null)); // Hack new SCannedBox(toolbar.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.DONT_SET_ANCHOR), toolbar, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.LOOKUP, BookingScreenHandler.BOOKING_LOOKUP, resources.getString(BookingScreenHandler.BOOKING_LOOKUP));
if (fldDisplayFieldDesc.getListener(BlankButtonHandler.class) == null) fldDisplayFieldDesc.addListener(new BlankButtonHandler(null)); if (fldDisplayFieldDesc != null) this.addListener(new ReadSecondaryHandler(fldDisplayFieldDesc.getRecord()));
/** * AddMasterListeners Method. */ public void addMasterListeners() { super.addMasterListeners(); this.addListener(new NoDeleteModifyHandler(true, false)); this.getField(Tour.FINALIZED).addListener(new FinalizeHandler(null)); this.getField(Tour.ORDER_COMPONENTS).addListener(new TourOrderHandler(null)); this.getField(Tour.CANCELLED).addListener(new TourOrderHandler(null)); this.getField(Tour.TOUR_STATUS_SUMMARY).addListener(new UpdateTourStatusSummaryHandler(null)); ((TourStatusField)this.getField(Tour.TOUR_STATUS_ID)).getIconField(null).addListener(new TourStatusUpdateHandler(null)); this.addActionListeners(); } /**
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { BaseField field = new ImageField(null, m_strFieldName, m_iMaxLength, m_strFieldDesc, null); field.setRecord(m_record); // Set table without adding to table field list return field; } /**
if (fldDisplayFieldDesc.getListener(BlankButtonHandler.class) == null) fldDisplayFieldDesc.addListener(new BlankButtonHandler(null)); if (fldDisplayFieldDesc != null) this.addListener(new ReadSecondaryHandler(fldDisplayFieldDesc.getRecord()));
((BaseStatusField)recBookingDetail.getField(BookingDetail.INFO_STATUS_ID)).getIconField(null).addListener(new BookingDetailStatusUpdateHandler(null)); ((BaseStatusField)recBookingDetail.getField(BookingDetail.INVENTORY_STATUS_ID)).getIconField(null).addListener(new BookingDetailStatusUpdateHandler(null)); ((BaseStatusField)recBookingDetail.getField(BookingDetail.COST_STATUS_ID)).getIconField(null).addListener(new BookingDetailStatusUpdateHandler(null)); ((BaseStatusField)recBookingDetail.getField(BookingDetail.PRODUCT_STATUS_ID)).getIconField(null).addListener(new BookingDetailStatusUpdateHandler(null));
/** * Get this image as an icon. */ public ImageIcon getImage() { if (this.isNull()) return null; if (this.getData() instanceof ImageIcon) return (ImageIcon)this.getData(); // Never (legacy) else if (this.getData() instanceof SerializableImage) return new ImageIcon(((SerializableImage)this.getData()).getImage()); else return null; } /**
/** * Constructor. * @param record The parent record. * @param strName The field name. * @param iDataLength The maximum string length (pass -1 for default). * @param strDesc The string description (usually pass null, to use the resource file desc). * @param strDefault The default value (if object, this value is the default value, if string, the string is the default). */ public ImageField(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { this(); this.init(record, strName, iDataLength, strDesc, strDefault); } /**
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { BaseField field = new ImageField(null, m_strFieldName, m_iMaxLength, m_strFieldDesc, null); field.setRecord(m_record); // Set table without adding to table field list return field; } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.setEditing(false); this.getMainRecord().setKeyArea(Product.DESC_SORT_KEY); // Redisplay if any of these change this.getScreenRecord().getField(ProductScreenRecord.DESCRIPTION).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.CITY_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.DETAIL_DATE).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.RATE_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.CLASS_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.REMOTE_QUERY_ENABLED).addListener(new FieldReSelectHandler(this)); this.addRateMessageListeners((Product)this.getMainRecord(), (ProductScreenRecord)this.getScreenRecord()); this.setThisProperty(ProductScreenRecord.DETAIL_DATE); this.setThisProperty(ProductScreenRecord.CLASS_ID); this.setThisProperty(ProductScreenRecord.RATE_ID); this.setThisProperty(ProductScreenRecord.PAX); this.setThisProperty(ProductScreenRecord.CITY_ID); ((BaseStatusField)this.getMainRecord().getField(Product.DISPLAY_COST_STATUS_ID)).getIconField(null).addListener(new CostStatusUpdateHandler(null)); } /**
/** * Get this image as an icon. */ public ImageIcon getImage() { if (this.isNull()) return null; if (this.getData() instanceof ImageIcon) return (ImageIcon)this.getData(); // Never (legacy) else if (this.getData() instanceof SerializableImage) return new ImageIcon(((SerializableImage)this.getData()).getImage()); else return null; } /**
/** * Constructor. * @param record The parent record. * @param strName The field name. * @param iDataLength The maximum string length (pass -1 for default). * @param strDesc The string description (usually pass null, to use the resource file desc). * @param strDefault The default value (if object, this value is the default value, if string, the string is the default). */ public ImageField(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { this(); this.init(record, strName, iDataLength, strDesc, strDefault); } /**
/** * Add this field in the Record's field sequence. */ public BaseField setupField(int iFieldSeq) { BaseField field = null; //if (iFieldSeq == 0) //{ // field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null); // field.setHidden(true); //} //if (iFieldSeq == 1) //{ // field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null); // field.setHidden(true); //} //if (iFieldSeq == 2) //{ // field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false)); // field.setHidden(true); //} if (iFieldSeq == 3) field = new StringField(this, DESCRIPTION, 20, null, null); if (iFieldSeq == 4) field = new ImageField(this, ICON, Constants.DEFAULT_FIELD_LENGTH, null, null); if (field == null) field = super.setupField(iFieldSeq); return field; } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.setEditing(false); this.getMainRecord().setKeyArea(Product.DESC_SORT_KEY); // Redisplay if any of these change this.getScreenRecord().getField(ProductScreenRecord.DESCRIPTION).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.CITY_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.DETAIL_DATE).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.RATE_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.CLASS_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(ProductScreenRecord.REMOTE_QUERY_ENABLED).addListener(new FieldReSelectHandler(this)); this.addRateMessageListeners((Product)this.getMainRecord(), (ProductScreenRecord)this.getScreenRecord()); this.setThisProperty(ProductScreenRecord.DETAIL_DATE); this.setThisProperty(ProductScreenRecord.CLASS_ID); this.setThisProperty(ProductScreenRecord.RATE_ID); this.setThisProperty(ProductScreenRecord.PAX); this.setThisProperty(ProductScreenRecord.CITY_ID); ((BaseStatusField)this.getMainRecord().getField(Product.DISPLAY_COST_STATUS_ID)).getIconField(null).addListener(new CostStatusUpdateHandler(null)); } /**