Package DisplayProject.controls

Examples of DisplayProject.controls.ArrayField


         */
        if (pParent instanceof OutlineField){
          return;
        }
        if (pParent instanceof ArrayField) {
          ArrayField table = (ArrayField)pParent;

            // TF:23/9/07:We sometimes need to post the event on the table as well. For example, consider a mouse double click
            // over a non-editable cell in a table. Forte could process the double click and send it through to the event loop,
            // but in java the renderer will not get the double click (it's not really there, after all) so the array will get
            // it. Hence we need to listen for it on the array as well
            // _installOnChild(pRoot, pParent, table, pEvent, pInstaller);
            TableColumnModel cm = table.getColumnModel();
            for (int c = 0; c < cm.getColumnCount(); c++){
                TableColumn tc = cm.getColumn(c);
                TableCellRenderer tcr = tc.getCellRenderer();

                // Handle ArrayFieldCellRenderer. CraigM 30/08/2007
View Full Code Here


            processComponent(c, state);
          }
        }
        else if (comp instanceof ArrayField) {
          // TF:13/10/2009:Get our columns and process them as well
          ArrayField af = (ArrayField)comp;
          ArrayColumnModel model = (ArrayColumnModel)af.getColumnModel();
          for (int i = 0; i < model.getRealColumnCount(); i++) {
            ArrayColumn column = model.getRealColumn(i);
            Component childComp = column.getComponent();
            if (childComp != null) {
              // TF:29/10/2009:DET-123:Changed this to use processComponent to take into account the state of the child component.
View Full Code Here

            }
        }
       
        // CraigM:19/06/2008 - If we are disabling or enabling the component in an array field, we also need to enable/disable the array column
        if (ArrayFieldCellHelper.getArrayField(comp) != null) {
          ArrayField af = ArrayFieldCellHelper.getArrayField(comp);
          int col = ArrayFieldCellHelper.getArrayFieldColumn(comp);

          // CraigM:18/10/2008 - Don't switch the array column if we are modifying components inside a grid field in the array field
          if (ArrayFieldCellHelper.isInGridFieldInArrayField(comp) == false) {
            // TF:13/10/2009:Corrected this to set our column state also based on the state of the array field.
            int worstState = getWorstState(af, state);
            boolean isEditable = (worstState == Constants.FS_UPDATE || worstState == Constants.FS_VIEWONLY || worstState == Constants.FS_SELECTONLY);
            // CraigM:22/08/2008 - Fixed to use real column
            ((ArrayColumn)((ArrayColumnModel)af.getColumnModel()).getRealColumn(col)).setEditable(isEditable);
          }
        }
    }
View Full Code Here

        }
        Component rootComponent = SwingUtilities.getRoot(component);
       
        // If we are in an ArrayField, then we need to go from there
        if (rootComponent == null) {
          ArrayField af = ArrayFieldCellHelper.getArrayField(component);
          if (af != null) {
            rootComponent = SwingUtilities.getRoot(af);
          }
        }

        // If our frame is not visible, then we can't set the focus yet.  We just flag our form
        // to set the focus once it becomes visible.  CraigM: 26/02/2008.
        if (rootComponent instanceof JFrame && ((JFrame)rootComponent).isVisible() == false) {
          JPanel form = UIutils.getForm((JFrame)rootComponent);

          if (form != null) {
            form.putClientProperty(QQ_INITIAL_FOCUS_COMPONENT, component);
            form.putClientProperty(QQ_INITIAL_FOCUS_ROW, row);
            return;
          }
        }
       
        // TF:10/7/07: Added in the application traversal type for the Forte-style focus manager
        // Since this pending action only ever occurs as the result of the application requesting
        // the focus to change, we set a flag to indicate that this is the case.
        ForteKeyboardFocusManager.setApplicationTraversal();
       
        // TF:11/03/2009:DET-82:In forte, you could try to focus on an array field, and either provide a row
        // in which case the focus would go to the first row or the row'th row if specified.
        if (component instanceof JComponent) {
            ArrayField af;
            if (component instanceof ArrayField) {
              af = (ArrayField)component;
              // Now set the component to the first visible column on the designated row
              component = ArrayFieldCellHelper.getArrayEditorComponent(af, row, 0);
              if (component == null) {
                // We cannot find the first visible component, do nothing
                return;
              }
            }
            else {
              af = ArrayFieldCellHelper.getArrayField(component);
            }
            if (af != null) {
                int col = ArrayFieldCellHelper.getArrayFieldColumn((JComponent)component);
                //PM:23/11/07 correct for invisible columns
                ArrayColumn ac = (ArrayColumn)((ArrayColumnModel)af.getColumnModel()).getRealColumn(col);
                col = ((ArrayColumnModel)af.getColumnModel()).getColumnIndex(ac.getIdentifier());

                // If an explicit focus request occurs on an empty array field that allows append, then create
                // a new row (that's what Forte did).  CraigM 16/10/2007.
                if (af.getRowCount() == 0 && af.isAllowsAppend()) {
                    af.appendRow(col);
                }
                else if (row >= af.getRowCount()) {
                  // TF:11/03/2009:A request has been made to focus to a non-existant row, do nothing
                  return;
                }

                // CraigM:01/05/2008 - Let all other swing event happen before requesting the focus in here
                final ArrayField afFinal = af;
                final int colFinal = col;
               
                // CraigM:25/06/2008 - Switched from SwingUtilities.invokeLater
                UIutils.invokeOnGuiThread(new Runnable() {
                  public void run() {
                    // CraigM:09/07/2008 - Now ArrayField has been fixed, we can just change the selection
                    afFinal.changeSelection(row, colFinal, false, false);
                  }
                });
            } else {
                // TF:27/11/07:(Credit to java almanac...) If we can't set the focus in the window, it's possibly
                // because we're not focusable, such as a grid field. In this case we want to set the focus to our
View Full Code Here

//            if (cb.isEditable() && (!(e.getActionCommand().equals("comboBoxChanged") && e.getModifiers() > 0))) {
//                return;
//            }
           
            // TF:26/06/2008:If we're a table editor, we must commit the value first as the model hasn't updated at this point in time
            ArrayField af = ArrayFieldCellHelper.getArrayField(cb);
            if (af != null && ArrayFieldCellHelper.getArrayEditorComponent(af) == cb) {
              af.setValueAt(af.getCellEditor().getCellEditorValue(), af.getEditingRow(), af.getEditingColumn());
            }
            EventManager.startEventChain();
            FocusHelper.addSetFocusPurgeAction(cb);
            Logger.getLogger(this.getClass()).debug("ComboBox Action: " + e.getActionCommand());
            if ((e.getActionCommand() == "comboBoxChanged") ||
View Full Code Here

TOP

Related Classes of DisplayProject.controls.ArrayField

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.