|Home >> All >> org >> scopemvc >> view|
|||org.scopemvc.view.awt.* (1)||||org.scopemvc.view.servlet.* (9)||||org.scopemvc.view.servlet.jsp.* (2)|
|||org.scopemvc.view.servlet.xml.* (4)||||org.scopemvc.view.swing.* (31)||||org.scopemvc.view.util.* (4)|
org.scopemvc.view.servlet.xml: Contains ServletView , a "container" used to hold a set of Page s that a Controller in a web application manages.
SComboBox: A JComboBox that uses a SComboBoxModel to bind to model properties for the list of items and to bind the selected item to a property. Uses a SListCellRenderer to draw items in the list. Uses a SComboBoxEditor if editable. SComboBox can issue Controls on selection changes. SList doesn't itself bind to a model: it delegates all binding to its SComboBoxModel. Examples for SComboBox use can be found in samples.swing.combodemo package, and see SComboBoxModel and SAbstractListModel . Elements (rows) in the data model can be arbitrary class (e.g. Person, Employee etc.). Scope's combobox renderer can have ...
SAbstractListModel: A javax.swing.AbstractListModel bound to a property of a model used by SList , SComboBox , STable . The property should have elements accessible using IntIndexedSelectors and needs to fulfill one of the following criteria: be a java.util.List be an Object optional: have an accessible 'size' property in the parent view model (see below) Unfortunately this means that JavaBeans indexed properties cannot be bound directly to an SAbstractListModel because there is no way to discover the size of such a list, unless a separate property can be accessed to provide the size of the list using setSizeSelector(org.scopemvc.core.Selector) ...
STable: A JTable bound to a list property of a model. The table shows a list of rows from the bound property (see setSelector(org.scopemvc.core.Selector) 55 ). If the rows are model objects, the properties shown for each column are set using setColumnSelectors(org.scopemvc.core.Selector) 55 . See also setColumnNames(java.lang.String) 55 . STable uses STableModel and so the contents can be sorted using setSorted(boolean) 55 or setSorted(Comparator) 55 . STable uses a standard (non-bound) Swing ListSelectionModel unless a selection Selector is set using setSelectionSelector(org.scopemvc.core.Selector) ...
SPanel: A JPanel implementation of View for use in Swing-based user interfaces. org.scopemvc.controller.swing.SwingContext uses the following methods from the SwingView base class that should be overridden in subclasses that can be shown as top-level views in a Window: SwingView.getTitle() 55 SwingView.getDisplayMode() 55 SwingView.getCloseControl() 55 SwingView.isResizable() 55 SPanel can be bound either to an entire model object, or to a property of a model. In either case it binds child components to the model it shows (either the entire model or a property of it, assumed to be a submodel). Note: See ...
ServletView: A container View to aggregate a set of Page s the allows the currently visible Page to be set. In a servlet application, a Controller's View must 'contain' all the possible pages that the user could be interacting with because the user is free to hit the browser's forward and back buttons, use history or bookmarks etc. This "View" therefore acts as a simple container for other Views ( Page s) that represent the actual interfaces that the user interacts with. It forwards any setController(org.scopemvc.core.Controller) 55 and setBoundModel(java.lang.Object) 55 calls to all children. A Controller ...
SUnboundPanel: A JPanel implementation of View that is not bound to a model object for use in Swing-based user interfaces. This can be used as a simple View that is never bound to a model and which can contain subviews bound to their own completely independent models (rather than being bound to submodels of a common parent model that is bound to a parent SwingView). org.scopemvc.controller.swing.SwingContext uses the following methods from the SwingView base class that can be overridden in subclasses that can be shown as Window-level views: SwingView.getTitle() 55 SwingView.getDisplayMode() 55 SwingView.getCloseControl() ...
SwingView: An abstract base JPanel implementation of View for use in Swing-based user interfaces. org.scopemvc.controller.swing.SwingContext assumes the use of SwingView subclasses, for which the following methods should be overridden: getTitle() 55 getDisplayMode() 55 getCloseControl() 55 isResizable() 55 Binding to the model object should be implemented in subclasses appropriately -- see SPanel for an example. This split in functionality is to support splitting Scope into a Controller/View subsystem and an independent model subsystem. SwingView subclasses must issue a CHANGE_MODEL_CONTROL_ID Control when ...
Page: Base class for views used by servlet implementation. Pages in a browser do not communicate with the web server, so this class does not implement ModelChangeListener. Model objects in a web application shouldn't bother to implement ModelChangeEventSource unless change notification is used for some purpose other than updating Views. In a servlet application, a Controller must use a ServletView that contains all possible Page s that the Controller can show. Pages must be created with unique View IDs to allow incoming requests to be linked to the correct parent View instance in ScopeServlet. eg http://localhost/scope/servlet/Test?view=TestView&action=TestControl ...
STextField: A JTextField linked to a property of a bound model object. The property must have a StringConvertor to handle conversion to and from a String representation that will be edited in the textfield. Updates to the textfield result in changes to the model property when focus is lost. STextField responds to the bound model or the particular bound property becoming read-only by disabling itself. An STextField is also disabled if it has no bound model or property. STextField can issue a Control when the user hits the Enter key. Null properties are handled in one of two ways: The field is disabled to prevent ...
STextArea: A JTextArea linked to a property of a bound model object. The property must have a StringConvertor to handle conversion to and from a String representation that will be edited in the textarea. Updates to the textarea result in changes to the model property when focus is lost. STextArea responds to the bound model object or the particular bound property becoming read-only by disabling itself. An STextArea is also disabled if it has no bound model or property. Null properties are handled in one of two ways: The textarea is disabled to prevent editing. The textarea is populated with an empty String. ...
AbstractXSLPage: A ServletView that references an XSLT URI used to transform an XML representation of the View's bound model objects. The XSLT is assumed to describe the entire view, not just a part of the overall page, even when this view is a subview or a parent of subviews. Model objects are turned to a SAX source in a concrete subclass, which is transformed with the XSLT to a SAX stream that gets fed to a SAX ContentHandler (eg an HTML serializer) that writes to an OutputStream (eg the HTTPResponse's output stream). This abstract base class does some generic XSLT handling, including caching compiled stylesheets. ...
STextCellEditor: Base class for cell editors based on Swing's JTextComponent . It is validating editor - it means, that stopCellEditing 55 can return false . Difference between a Swing's and this cell editor is that Swing always returns String value, whereas STextCellEditor uses StringConvertor to return object of desired type. Note: This editor fixes in unbelievable simple way Sun's editor unpleasant bug - when You start cell editing with keyboard, not mouse, the text field has no cursor (in 1.3.1 and 1.4 beta)
SList: A JList that uses a SListModel to bind to model properties, and a SListSelectionModel to bind the selected item to a property. Uses a SListCellRenderer to draw items in the list. SList can issue Controls on selection changes and on double-click. SList doesn't itself bind to a model: it delegates all binding to its SListModel and SListSelectionModel.
ModelToXML: Converts a model into an XML document (as SAX events driving a ContentHandler). Uses a PropertyIDGenerator to create "path" attributes for all elements, and "id" attributes for model elements. Handles circular references using the "ID" and "IDREF" pattern. (data id='_root') (name path='name')Steve(/name) (pets path='pets') (element index='0' path='pets.0') (data id='pets.0') (name path='pets.0.name')Trevor(/name) (/data) (/element) (/pets) (/data)
ActiveBoundModel: A BoundModel that handles ModelChangeEvents and provides full two-way data-binding between a View and its bound model property. The parent View needs to implement the ModelBindable interface to provide a generic interface used by this delegate. An ActiveBoundModel registers itself as a ModelChangeListener to the bound model object so that it can update its parent View.
ValidationHelper: Handles ModelBindable.validationFailed(java.lang.Exception) > ModelBindable.validationFailed(java.lang.Exception) 55 and ModelBindable.validationSuccess() > ModelBindable.validationSuccess() 55 by setting the background colour of the parent component to a new colour and being able to generate an "error tooltip" that is coloured and contains the localized error message from the validation failure.
SRadioButton: A JRadioButton linked to a Boolean or boolean property of a bound model object. Updates to the radiobutton result in changes to the model property immediately. Note that the Selector specified for a SRadioButton must select a single Boolean or boolean property. SRadioButton responds to the bound model or the particular bound property becoming read-only by disabling itself. A SRadioButton is also disabled if it has no bound model or property, or the property is a null Boolean. SRadioButton can issue a Control when it changes state.
SCheckBox: A JCheckbox linked to a Boolean or boolean property of a bound model object. Updates to the checkbox result in changes to the model property immediately. Note that the Selector specified for a SCheckbox must select a single Boolean or boolean property. Checkbox responds to the bound model or the particular bound property becoming read-only by disabling itself. A SCheckbox is also disabled if it has no bound model or property, or the property is a null Boolean. SCheckbox can issue a Control when the checkbox changes state.
SActionListener: Connects component action event to a method in a model. Let's have button Save and method void saveData() in model object, which should be called, when button is pressed. The connection can be done in following way: JButton button = new JButton("Save"); SActionListener action = new SActionListener(); action.setModelActionString("saveData"); button.addActionListener(action); ... action.setBoundModel(myModel);
XSLPage: A concrete AbstractXSLPage that uses Scope's ModelManager implementations to serialise its entire bound model object to an XML document. A better strategy would be to use a more intelligent view that selectively serialises relevant parts of the model object. Handles circular references using the "ID" and "IDREF" pattern.
SListSelectionModel: A ListSelectionModel bound to a model property that will contain a reference to the current selection. This implementation allows read-only properties to disable the parent JList or JTable. SINGLE_SELECTION and SINGLE_INTERVAL_SELECTION are supported. The bound property can be an Object of the type being selected in which case the topmost single selection is updated. If the property is a HashSet then it is updated with all selections.
PropertyIDGenerator: Generates IDs to identify properties during the traversal of the model containment hierarchy. Used by ModelToXML. The ids in the xml could be used as form parameters to identify properties to be populated with user input. This is used by the ID generators defined as inner classes in XSLPage .
SComboBoxEditor: Default combobox editor for SComboBox. It can be used for any value class for which a StringConvertor exists. The editor is created in SComboBox constructor, so it can be safely obtained with call getEditor . The StringConvertor is obtained from StringConvertors to match the type of object being edited.
SSlider: A JSlider whose value is bound to an int property of a model object. Note that the Selector specified for a SCheckbox must select a single Integer or int property. SSlider responds to the bound model or the particular bound property becoming read-only by disabling itself. A SSlider is also disabled if it has no bound model or property, or the property is a null Integer.
BoundModel: Delegate to handle generic parts of binding a View to a property of a model object with no automatic updates between model and View: ie this delegate just handles accessing the model and Selector for its owning View. Full model/View binding is provided by the ActiveBoundModel delegate.