/** * Get the converter for this screen field. * NOTE: Be careful, this method is just for convenience and is required by the ScreenComponent * interface, although this is not the screen component. * @return The converter for this screen field. */ public void setConverter(Convert converter) { this.getScreenField().setConverter(converter); // Utility method } /**
/** * Set up the default control for this field. * Adds the default screen control for the current converter, and makes me it's converter. * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, int iDisplayFieldDesc) // Add this view to the list { ScreenField sField = null; Converter converter = this.getNextConverter(); if (converter != null) sField = (ScreenField)converter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); else sField = super.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); if (sField != null) { // Get rid of any and all links to/from field/converter converter.removeComponent(sField); // Have the field add me to its list for display sField.setConverter(this); } return sField; } /**
/** * Set up the default control for this field. * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) // Add this view to the list { ScreenField sField = null; BaseField field = (BaseField)this.getField(); if (field != null) { sField = field.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); if (sField != null) if (sField.getConverter() == null) sField.setConverter(this); } else sField = new SEditText(itsLocation, targetScreen, converter, iDisplayFieldDesc); return sField; } }
/** * Set up the default control for this field. * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) // Add this view to the list { ScreenField sField = null; BaseField field = (BaseField)this.getField(); if (field != null) { sField = field.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); if (sField != null) if (sField.getConverter() == null) sField.setConverter(this); } else sField = new SEditText(itsLocation, targetScreen, converter, iDisplayFieldDesc); return sField; } }
/** * Set up the default control for this field. * Adds the default screen control for the current converter, and makes me it's converter. * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, int iDisplayFieldDesc) // Add this view to the list { ScreenField sField = null; Converter converter = this.getNextConverter(); if (converter != null) sField = (ScreenField)converter.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); else sField = super.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); if (sField != null) { // Get rid of any and all links to/from field/converter converter.removeComponent(sField); // Have the field add me to its list for display sField.setConverter(this); } return sField; } /**
BaseField fieldConverter = this.getScreenRecord().getField(BookingItineraryScreenRecord.ITINERARY_TEXT); fieldConverter.addComponent(m_sHtmlView); m_sHtmlView.setConverter(fieldConverter); m_sHtmlView.setSFieldValue(strText, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); fieldConverter.removeComponent(m_sHtmlView); m_sHtmlView.setConverter(null);
/** * Set up all the screen fields. */ public void setupSFields() { ScreenLocation itsLocation = null; itsLocation = this.getNextLocation(ScreenConstants.FLUSH_LEFT, ScreenConstants.FILL_REMAINDER); // NOTE NOTE NOTE. fieldConverter is only used to create the control, since the actual text is created from reading the URL BaseField fieldConverter = this.getScreenRecord().getField(BookingItineraryScreenRecord.ITINERARY_TEXT); m_sHtmlView = new SHtmlView(itsLocation, this, fieldConverter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null); ScreenFieldView sView = m_sHtmlView.getScreenFieldView(); if (sView instanceof org.jbundle.base.screen.view.swing.VScreenField) { // Swing - get rid of scrollers and make transparent and get rid of the border. javax.swing.JEditorPane htmlPane = (javax.swing.JEditorPane)sView.getControl(); htmlPane.setEditable(false); ((org.jbundle.base.screen.view.swing.VHtmlView)sView).setupHyperLinkListener(this); htmlPane.setOpaque(false); java.awt.Component component = (java.awt.Component)sView.getControl(DBConstants.CONTROL_TOP); ((javax.swing.JScrollPane)component).setBorder(null); ((javax.swing.JScrollPane)component).setOpaque(false); ((javax.swing.JScrollPane)component).getViewport().setOpaque(false); } fieldConverter.removeComponent(m_sHtmlView); m_sHtmlView.setConverter(null); } /**