Package DisplayProject

Examples of DisplayProject.DropListModel


        for (int i=0; i<comp.getModel().getSize(); i++) {
          if (comp.getModel().getElementAt(i) instanceof ListElement) {
            elements.add((ListElement)comp.getModel().getElementAt(i));
          }
        }
        comp.setModel(new DropListModel(elements, comp));
      }
      // TF:28/07/2009:Changed this to return the data from the underlying model. We cannot pass (ListField)comp as the
      // second parameter for historical reasons -- this get method was invoked directly from the main thread due to a
      // generator bug, and the solution admistered to the code was to have this method calling ElementList.get() indirectly.
      // If we pass (ListField)comp here, it will call ElementList.get(comp) which is this method and hence enters
View Full Code Here


        Component result = super.getTableCellEditorComponent(table, value, isSelected, row, column);
       // AD:26/6/2008 Change JComboBox to AutoResizingComboBox to reduce casting later
        if (result instanceof AutoResizingComboBox) {
            AutoResizingComboBox cb = (AutoResizingComboBox)result;
            if (cb.getModel() instanceof DropListModel){
              DropListModel model = (DropListModel)cb.getModel();
             
                Array_Of_ListElement<ListElement> elements = null;
                if (rowElements != null){
                    //PM:10/8/07
                    /*
                     * customize the element list per row, if there is
                     * no customisation for the row
                     * use the default
                     */
                    elements = rowElements.get(row);
                }
                if (elements == null){
                    //PM:17/7/07 add a DropListModel with the correct data
                    elements = this.defaultElements;
                }
                cb.setModel(new DropListModel(elements, cb));
           
              if (value instanceof Integer) {
                  model.setIntegerValue(((Integer)value).intValue());
              }
              else if (value instanceof IntegerData) {
                  model.setIntegerValue(((IntegerData)value).intValue());
              }
              else if (value instanceof TextData) {
                  model.setTextValue((TextData)value);
              }
              else if (value instanceof String) {
                  model.setTextValue(new TextData((String)value));
              }
              else {
                  model.setObjectValue(value);
              }
            }
        }
        return result;
    }
View Full Code Here

        @SuppressWarnings("unchecked")
    public void performAction() {
          try {
              if (this.bg == null){
                  if (this._component instanceof JComboBox){
                      DropListModel dlm = (DropListModel)((JComboBox)this._component).getModel();
                      dlm.setSelectedIndex(value-1);
                  }
                  else if (this._component instanceof RadioList) {
                    // TF:23/07/2008:Changed this to use the radio list instead of the model to make the code cleaner
                      ((RadioList)this._component).setIndexValue(value-1);
                  }
View Full Code Here

        @SuppressWarnings("unchecked")
    public void performAction() {
          try {
              if (this.bg == null){
                  if (this._component instanceof JComboBox){
                      DropListModel dlm = (DropListModel)((JComboBox)this._component).getModel();
                      dlm.setSelectedIndex(value-1);
                  }
                  else if (this._component instanceof RadioList) {
                    // TF:23/07/2008:Changed this to use the radio list instead of the model to make the code cleaner
                      ((RadioList)this._component).setIndexValue(value-1);
                  }
View Full Code Here

    }
   
  public static FillInField newFillinField() {
      // CraigM:01/05/2008:Override the enabled, focusable, and paint methods, so we can draw the text as black if we are disabled but focusable
        FillInField cb = new FillInField();
        cb.setModel(new DropListModel(new Array_Of_ListElement<ListElement>(),cb));
        cb.setEditable(true);
        return cb;
    }
View Full Code Here

  public static DropList newDropList()
    {
        final DropList cb = new DropList();
        cb.setEditable(false);
        cb.setRenderer(new ForteSizedListElementCellRenderer());
        cb.setModel(new DropListModel(new Array_Of_ListElement<ListElement>(),cb));
        return cb;
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  public static DropList newDropList(ListElement[] elements) {
        DropList cb = DropFillinFactory.newDropList();
        DropListModel model = new DropListModel(new Array_Of_ListElement(Arrays.asList(elements)),cb);
        cb.setModel(model);
        //cb.addActionListener(model);
        //cb.setModel(new DefaultComboBoxModel(elements));
        cb.setMaximumRowCount(elements.length);
        return cb;
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public static DropList newDropList(Array_Of_ListElement<ListElement> elements) {
      DropList cb = DropFillinFactory.newDropList();
      DropListModel model = new DropListModel(new Array_Of_ListElement(Arrays.asList(elements)),cb);
      cb.setModel(model);
      //cb.addActionListener(model);
      //cb.setModel(new DefaultComboBoxModel(elements));
      cb.setMaximumRowCount(elements.size());
      return cb;
View Full Code Here

    }
    if (elements == null){
      //PM:17/7/07 add a DropListModel with the correct data
      elements =((DropListModel)this.fif.getModel()).getElementList();
    }
    this.fif.setModel(new DropListModel(elements, this.fif));
    // TF:22/12/2009:DET-137: Added this to set the popup menu
    this.fif.setComponentPopupMenu(table.getComponentPopupMenu());
    // TF:11/11/2009:DET-126:Stop spurious AfterValueChangeEvents from occurring
    if (value == null) {
      this.fif.initialise("");
View Full Code Here

    }

    public void actionPerformed(ActionEvent e) {
        if (e.getSource() instanceof AutoResizingComboBox) {
            AutoResizingComboBox cb = (AutoResizingComboBox)e.getSource();
            DropListModel model = (DropListModel)cb.getModel();

            if (model.isAdjusting() || !cb.isEnabled()) {
                return;
            }
            // TF:28/3/07: Editable comboboxes will post an afterValueChange event when they lose the
            // focus, because their value is not necessarily equal to their selected value. However,
            // in this case we'll have a data field that will post the AfterValueChange event for us.184157
View Full Code Here

TOP

Related Classes of DisplayProject.DropListModel

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.