/** * Initialize class fields. */ public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
OnSelectHandler listener = (OnSelectHandler)this.getMainRecord().getListener(OnSelectHandler.class); if (listener != null) this.getMainRecord().removeListener(listener, false); iMode = iMode | ScreenConstants.SELECT_MODE; BasePanel screen = this.onForm(null, iMode, true, iCommandOptions, null); if (targetRecord != null) screen.setSelectQuery(targetRecord, false);
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); ((TourHeaderOption)this.getMainRecord()).addSubFileIntegrityHandlers(); } /**
/** * Create a data entry screen of this type. */ public BasePanel onForm(Record recordMain, int iDocMode, boolean bReadCurrentRecord, int iCommandOptions, Map<String,Object> properties) { String strMessage = this.getProperty(MessageConstants.QUEUE_NAME); if (strMessage != null) { if (properties == null) properties = new Hashtable<String,Object>(); properties.put(MessageConstants.QUEUE_NAME, strMessage); if (this.getProperty(RecordMessageConstants.TABLE_NAME) != null) properties.put(RecordMessageConstants.TABLE_NAME, this.getProperty(RecordMessageConstants.TABLE_NAME)); } return super.onForm(recordMain, iDocMode, bReadCurrentRecord, iCommandOptions, properties); } /**
/** * Get the command string to restore screen. */ public String getScreenURL() { String strCommand = super.getScreenURL(); String strValue = TourHeaderOption.OPTION; if (this.getHeaderRecord() instanceof TourHeader) strValue = TourHeaderOption.TOUR; strCommand = Utility.addURLParam(strCommand, TourHeaderOption.TOUR_OR_OPTION, strValue); return strCommand; }
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); if (m_recHeader != null) this.addRecord(m_recHeader, false); else { String strType = this.getProperty(TourHeaderOption.TOUR_OR_OPTION); if (TourHeaderOption.OPTION.equals(strType)) m_recHeader = new TourHeaderOption(this); else m_recHeader = new TourHeader(this); } ((ReferenceField)this.getMainRecord().getField(TourHeaderOption.TOUR_OR_OPTION_ID)).setReferenceRecord(m_recHeader); } /**
/** * Add button(s) to the toolbar. */ public void addToolbarButtons(ToolScreen toolScreen) { super.addToolbarButtons(toolScreen); BaseApplication application = (BaseApplication)this.getTask().getApplication(); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.FLUSH_LEFT, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(Product.PRICING_DETAIL), Booking.BUTTON_LOCATION + "Price", Product.PRICING_DETAIL, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TOUR), Booking.BUTTON_LOCATION + ProductType.TOUR, ProductType.TOUR, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR + "Header"), Booking.BUTTON_LOCATION + ProductType.AIR + "Header", ProductType.AIR + "Header", null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR), Booking.BUTTON_LOCATION + ProductType.AIR, ProductType.AIR, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.HOTEL), Booking.BUTTON_LOCATION + ProductType.HOTEL, ProductType.HOTEL, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.LAND), Booking.BUTTON_LOCATION + ProductType.LAND, ProductType.LAND, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CAR), Booking.BUTTON_LOCATION + ProductType.CAR, ProductType.CAR, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TRANSPORTATION), Booking.BUTTON_LOCATION + ProductType.TRANSPORTATION, ProductType.TRANSPORTATION, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CRUISE), Booking.BUTTON_LOCATION + ProductType.CRUISE, ProductType.CRUISE, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.ITEM), Booking.BUTTON_LOCATION + ProductType.ITEM, ProductType.ITEM, null); } /**
/** * Add the navigation button(s) to the left of the grid row. */ public void addNavButtons() { BaseApplication application = (BaseApplication)this.getTask().getApplication(); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.ITEM, ProductType.ITEM, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.ITEM)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.CRUISE, ProductType.CRUISE, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CRUISE)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.TRANSPORTATION, ProductType.TRANSPORTATION, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TRANSPORTATION)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.CAR, ProductType.CAR, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CAR)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.LAND, ProductType.LAND, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.LAND)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.HOTEL, ProductType.HOTEL, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.HOTEL)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.AIR, ProductType.AIR, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.AIR + "Header", ProductType.AIR + "Header", application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR + "Header")); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.TOUR, ProductType.TOUR, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TOUR)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + "Price", Product.PRICING_DETAIL, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(Product.PRICING_DETAIL)); super.addNavButtons(); // Next buttons will be "First!" } /**
/** * Add the navigation button(s) to the left of the grid row. */ public void addNavButtons() { new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.FORMDETAIL, MenuConstants.FORMDETAIL, null); super.addNavButtons(); // Next buttons will be "First!" } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); ((TourHeaderOption)this.getMainRecord()).addSubFileIntegrityHandlers(); } /**
/** * Create a data entry screen of this type. */ public BasePanel onForm(Record recordMain, int iDocMode, boolean bReadCurrentRecord, int iCommandOptions, Map<String,Object> properties) { String strMessage = this.getProperty(MessageConstants.QUEUE_NAME); if (strMessage != null) { if (properties == null) properties = new Hashtable<String,Object>(); properties.put(MessageConstants.QUEUE_NAME, strMessage); if (this.getProperty(RecordMessageConstants.TABLE_NAME) != null) properties.put(RecordMessageConstants.TABLE_NAME, this.getProperty(RecordMessageConstants.TABLE_NAME)); } return super.onForm(recordMain, iDocMode, bReadCurrentRecord, iCommandOptions, properties); } /**
/** * Get the command string to restore screen. */ public String getScreenURL() { String strCommand = super.getScreenURL(); String strValue = TourHeaderOption.OPTION; if (this.getHeaderRecord() instanceof TourHeader) strValue = TourHeaderOption.TOUR; strCommand = Utility.addURLParam(strCommand, TourHeaderOption.TOUR_OR_OPTION, strValue); return strCommand; }
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); if (m_recHeader != null) this.addRecord(m_recHeader, false); else { String strType = this.getProperty(TourHeaderOption.TOUR_OR_OPTION); if (TourHeaderOption.OPTION.equals(strType)) m_recHeader = new TourHeaderOption(this); else m_recHeader = new TourHeader(this); } ((ReferenceField)this.getMainRecord().getField(TourHeaderOption.TOUR_OR_OPTION_ID)).setReferenceRecord(m_recHeader); } /**
/** * Add button(s) to the toolbar. */ public void addToolbarButtons(ToolScreen toolScreen) { super.addToolbarButtons(toolScreen); BaseApplication application = (BaseApplication)this.getTask().getApplication(); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.FLUSH_LEFT, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(Product.PRICING_DETAIL), Booking.BUTTON_LOCATION + "Price", Product.PRICING_DETAIL, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TOUR), Booking.BUTTON_LOCATION + ProductType.TOUR, ProductType.TOUR, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR + "Header"), Booking.BUTTON_LOCATION + ProductType.AIR + "Header", ProductType.AIR + "Header", null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR), Booking.BUTTON_LOCATION + ProductType.AIR, ProductType.AIR, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.HOTEL), Booking.BUTTON_LOCATION + ProductType.HOTEL, ProductType.HOTEL, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.LAND), Booking.BUTTON_LOCATION + ProductType.LAND, ProductType.LAND, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CAR), Booking.BUTTON_LOCATION + ProductType.CAR, ProductType.CAR, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TRANSPORTATION), Booking.BUTTON_LOCATION + ProductType.TRANSPORTATION, ProductType.TRANSPORTATION, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CRUISE), Booking.BUTTON_LOCATION + ProductType.CRUISE, ProductType.CRUISE, null); new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.ITEM), Booking.BUTTON_LOCATION + ProductType.ITEM, ProductType.ITEM, null); } /**
/** * Add the navigation button(s) to the left of the grid row. */ public void addNavButtons() { BaseApplication application = (BaseApplication)this.getTask().getApplication(); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.ITEM, ProductType.ITEM, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.ITEM)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.CRUISE, ProductType.CRUISE, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CRUISE)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.TRANSPORTATION, ProductType.TRANSPORTATION, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TRANSPORTATION)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.CAR, ProductType.CAR, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.CAR)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.LAND, ProductType.LAND, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.LAND)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.HOTEL, ProductType.HOTEL, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.HOTEL)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.AIR, ProductType.AIR, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.AIR + "Header", ProductType.AIR + "Header", application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.AIR + "Header")); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + ProductType.TOUR, ProductType.TOUR, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(ProductType.TOUR)); new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, Booking.BUTTON_LOCATION + "Price", Product.PRICING_DETAIL, application.getResources(ResourceConstants.PRODUCT_RESOURCE, true).getString(Product.PRICING_DETAIL)); super.addNavButtons(); // Next buttons will be "First!" } /**
/** * Initialize class fields. */ public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
/** * Add all the screen listeners. */ public void addListeners() { // This beginning code is a trick to make the grid screen think that a zero record is the header. this.setProperty("fakeHeader", DBConstants.FALSE); if (m_recHeader != null) if ((m_recHeader.getEditMode() == DBConstants.EDIT_ADD) || (m_recHeader.getEditMode() == DBConstants.EDIT_NONE)) if (this.getProperty(DBParams.HEADER_OBJECT_ID) == null) { this.setProperty("fakeHeader", DBConstants.TRUE); this.setProperty(DBParams.HEADER_OBJECT_ID, "0"); if (m_recHeader.getCounterField() != null) if (m_recHeader.getCounterField().getDefault() == null) { m_recHeader.getCounterField().setDefault(new Integer(0)); // This will guarantee that the sub record's parent field is non-null try { m_recHeader.addNew(); } catch (DBException ex) { } } } super.addListeners(); } /**
/** * Constructor. */ public BaseFolderGridScreen(Record recHeader, Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { this(); this.init(recHeader, record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
/** * Initialize class fields. */ public void init(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { super.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**
/** * Constructor. * @param record The main record for this screen. * @param itsLocation The location of this component within the parent. * @param parentScreen The parent screen. * @param fieldConverter The field this screen field is linked to. * @param iDisplayFieldDesc Do I display the field desc?. */ public BaseFolderGridScreen(Record record, ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String,Object> properties) { this(); this.init(record, itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties); } /**