Package net.helipilot50.stocktrade.displayproject.binding.list

Examples of net.helipilot50.stocktrade.displayproject.binding.list.SelectionInList$ListModelAdapter


     * rows is more than the passed value, the number of rows will be
     * set to the number of rows used. This method is thread-safe and may be
     * called on or off the GUI thread
     */
    public void setRows(final int pRows) {
        ActionMgr.addAction(new PendingAction(null) {
            @Override
            public String toString() {
                return GridField.this.getName() + ".setRows(" + pRows + ")";
            }
            @Override
View Full Code Here


     * columns is more than the passed value, the number of columns will be
     * set to the number of columns used. This method is thread-safe and may be
     * called on or off the GUI thread
     */
    public void setColumns(final int pColumns) {
        ActionMgr.addAction(new PendingAction(null) {
            @Override
            public String toString() {
                return GridField.this.getName() + ".setColumns(" + pColumns + ")";
            }
            @Override
View Full Code Here

        // TF:8/8/07:Made a shallow clone in case there is a really big object attached to the list element
        Array_Of_ListElement<ListElement> clonedList = CloneHelper.clone(les, false);
        Object currentValue = this.list.getValue();
        ListElement valueToReselect = null;
        if (currentValue instanceof ListElement && clonedList != null && this.list.getSelectionHolder() instanceof TypeAwareValueModel) {
          TypeAwareValueModel tavm = (TypeAwareValueModel)this.list.getSelectionHolder();
          // We need to find an item in the new list which is the same as an item in the old list,
          // depending on the type being considered. For example, if the list is mapped to an int,
          // we need to find an element in the new list with the same IntegerValue.
          Class<?> clazz = tavm.getValueType();
          ListElement currentSelection = (ListElement)currentValue;
          for (ListElement item : clonedList) {
            if (clazz.equals(Integer.TYPE) ||
                clazz.equals(Short.TYPE) ||
                NumericData.class.isAssignableFrom(clazz) ||
View Full Code Here

     * @param selectionHolder  holds the selection of the combo
     * @throws NullPointerException if the list of items or the selection holder
     *         is <code>null</code>
     */
    public ComboBoxAdapter(List<?> items, ValueModel selectionHolder) {
        this(new SelectionInList(items), selectionHolder, false);
    }
View Full Code Here

     * @param selectionHolder   holds the selection of the combo
     * @throws NullPointerException if the list of items or the selection holder
     *         is <code>null</code>
     */
    public ComboBoxAdapter(ListModel listModel, ValueModel selectionHolder) {
        this(new SelectionInList(listModel), selectionHolder, false);
    }
View Full Code Here

     * @param selectionHolder   holds the selection of the combo
     * @throws NullPointerException if the list of items or the selection holder
     *         is <code>null</code>
     */
    public ComboBoxAdapter(Object[] items, ValueModel selectionHolder) {
        this(new SelectionInList(items), selectionHolder, false);
    }
View Full Code Here

     * @param selectionHolder  holds the selection of the combo
     * @throws NullPointerException if the list holder or the selection holder
     *         is <code>null</code>
     */
    public ComboBoxAdapter(ValueModel listHolder, ValueModel selectionHolder) {
        this(new SelectionInList(listHolder), selectionHolder, false);
    }
View Full Code Here

        // Unfortunately, we need to tie the list selection and the model together, so that we can
        // get and set the element list from the model
//        ListElementValueModelConverter elementConverter = this.getElementConverter(selectedItemProperty, newList);
        //SelectionInList selection = new SelectionInList(newList,elementConverter);

        SelectionInList selection = this.getSelectionInList(selectedItemProperty, newList);
        list.setModel(new ScrollListModel(selection, list, pIsSingleSelect));
        if (pIsSingleSelect) {
            list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            list.setSelectionModel( new SingleListSelectionAdapter(
                            selection.getSelectionIndexHolder()));
            // Force a selection if we're in single selection mode...
            if (list.getSelectedIndex() == -1) {
                list.setSelectedIndex(0);
            }
        }
        else {
            list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            list.setSelectionModel(new ToggleListSelectionModel());
            list.addListSelectionListener(new SelectionCounterAdapter(list, selection.getSelectionIndexHolder()));
        }

        //Bindings.bind(list,getSelectionInList(selectedItemProperty,elements));
    }
View Full Code Here

    @SuppressWarnings("unchecked")
  public void bindComponent(MenuList list, String selectedItemProperty, Array_Of_ListElement<ListElement> elements)
    {
      Array_Of_ListElement<ListElement> newList = (Array_Of_ListElement<ListElement>)elements.clone();
      // TF:08/11/2009:We need to be able to force the list to have a valid value (unless it's a null type)
        SelectionInList selection = this.getSelectionInList(selectedItemProperty, newList, true);
        list.setModel(new MenuList.Model(selection, list));
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        list.setSelectionModel( new SingleListSelectionAdapter(
                selection.getSelectionIndexHolder()));
        // Force a selection if we're in single selection mode...
        // TF:08/11/2009:DET-127:We only want to do this on non-nullable types, so invoke a method to do it.
        list.initialiseSelectedElement();
    }
View Full Code Here

        Array_Of_ListElement<ListElement> newList = (Array_Of_ListElement<ListElement>)elements.clone();

        // Unfortunately, we need to tie the list selection and the model together, so that we can
        // get and set the element list from the model
//        ListElementValueModelConverter elementConverter = this.getElementConverter(selectedItemProperty, newList);
        SelectionInList selection = this.getSelectionInList(selectedItemProperty, newList);
        list.setModel(new RadioListModel(selection, list));
        list.setSelectionModel( new SingleListSelectionAdapter(
                        selection.getSelectionIndexHolder()));


        //Bindings.bind(list,getSelectionInList(selectedItemProperty,elements));
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.displayproject.binding.list.SelectionInList$ListModelAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.