Package DisplayProject.controls

Examples of DisplayProject.controls.ArrayField


        }
        return qq_list;
    }

    public void setqq_list(ArrayField value) {
        ArrayField oldValue = qq_list;
        qq_list = value;
        this.qq_Listeners.firePropertyChange("qq_list", oldValue, value);
    }
View Full Code Here


        }
        return qq_t_t_list;
    }

    public void setqq_t_t_list(ArrayField value) {
        ArrayField oldValue = qq_t_t_list;
        qq_t_t_list = value;
        this.qq_Listeners.firePropertyChange("qq_t_t_list", oldValue, value);
    }
View Full Code Here

        if (name != null && (pName.equalsIgnoreCase(name) || pName.substring(3).equalsIgnoreCase(name))) { // extra
            return targetWidget;
        }
        if (targetWidget instanceof ArrayField) {
            ArrayField aContainer = (ArrayField) targetWidget;
            ArrayColumnModel acm = (ArrayColumnModel)aContainer.getColumnModel();
            int colCount = acm.getRealColumnCount();
            for (int i = 0; i < colCount; i++) {
                ArrayColumn ac = (ArrayColumn)acm.getRealColumn(i);
                TableCellEditor tce = ac.getCellEditor();
                JComponent comp = (JComponent)tce.getTableCellEditorComponent(aContainer, null, true, -1, -1);
                if (comp == null) { // then find the cell renderer
                    ArrayFieldCellRenderer afcr = (ArrayFieldCellRenderer) ac
                            .getCellRenderer();
                    comp = (JComponent) afcr.getTableCellRendererComponent(
                            aContainer, null, false, true, -1, -1);
                    comp = (JComponent) comp.getComponent(0);
                    String compName = (comp == null) ? "" : comp.getName();
                    if (compName.endsWith(pName)) {
                        return comp;
                    }
                } else if (comp instanceof EditorLayoutPanel
                        && comp.getComponent(0) != null) {
                    comp = (JComponent) comp.getComponent(0);
                }
                String compName = (comp == null) ? "" : comp.getName();
                if (compName.endsWith(pName)) {
                    return comp;
                }
            }
        } else if (targetWidget instanceof Container) {
            Container aContainer = (Container) targetWidget;
            Component[] children = aContainer.getComponents();
            for (int i = 0; i < children.length; i++) {
                Component result = UIutils._getFieldByName(pName, children[i]);
                if (result != null) {
                    return result;
                }
View Full Code Here

     * @param name name of the field
     * @param rowHeight height of the rows in pixels
     * @param headerFontStyle the font style of the column header e.g. Font.PLAIN
     */
    public static ArrayField newArrayField(String name, int rowHeight, int headerFontStyle){
        ArrayField jt = new ArrayField(name, rowHeight, headerFontStyle);

        return jt;
    }
View Full Code Here

        if (action != null) {
            value = ((TableRow)action).getRow();
        } else if (comp instanceof ArrayField
            && !SwingUtilities.isEventDispatchThread()) { // DK:31/12/2008:use getRowForEvents() only if we currently not in EDT thread

            ArrayField table = (ArrayField)comp;
            //value = table.getSelectedRow() + 1;
            // TF: 30/9/07: We need to wait for the EDT to become idle... See the comments associated with this method and ArrayField if you don't know why...
            UIutils.waitForEDTToBeIdle();

            // TF:11/10/07:Created a new method to return the real current row at the point in time this code is executing.
            //value = table.getCurrentRow() + 1; // CraigM 24/08/2007
            value = table.getRowForEvents() + 1;

        } else {
            value = comp.getSelectedRow() + 1;
        }
        return value;
View Full Code Here

  @Override
  // ITC_CONV:Start:TF:25-Mar-08:Handle SkipOnTab focus traversal
  public Component getComponentAfter(Container aContainer, Component aComponent) {

    // Traversing out of an ArrayField is handled via code inside the ArrayField. CraigM 29/08/2007.
    ArrayField af = ArrayFieldCellHelper.getArrayField(aComponent);
    if (af != null && isSwingDisplayerIgnoreArrayField() == false) {
      return af; // Stay in the ArrayField
    }
    Component result = super.getComponentAfter(aContainer, aComponent);
    while (result instanceof JComponent && SkipOnTab.get((JComponent)result)) {
View Full Code Here

      if (WidgetState.getWorstState(focusOwner) == Constants.FS_UPDATE) {
        // TF:7/4/08: If the component which has focus is currently a table cell editor then
        // we need to ensure that the value has been committed to the underlying model. Otherwise accelerators
        // will still have the wrong value since we haven't processed the focus loss event.
        if (focusOwner instanceof JTextComponent) {
          ArrayField table = ArrayFieldCellHelper.getArrayField(focusOwner);
          if (table != null) {
            if (ArrayFieldCellHelper.getArrayEditorComponent(table) == focusOwner) {
              // TF:08/06/2008:LIB-17:If this is a formatted field, we must use the getValue method,
              // otherwise we will potentially have formatting errors on masked fields.
              if (focusOwner instanceof JFormattedTextField) {
                JFormattedTextField formattedField = (JFormattedTextField)focusOwner;
                try {
                  formattedField.commitEdit();
                  //GK/DK: convert column index to a model index to set value
                  table.setValueAt(formattedField.getValue(), table.getEditingRow(), table.getEditingColumn());
                }
                catch (ParseException e) {
                  _log.error("Unhandled parse exception committing field edit: ", e);
                }
              }
              else if (focusOwner instanceof JPasswordField) {
                table.setValueAt(new String(((JPasswordField)focusOwner).getPassword()), table.getEditingRow(), table.getEditingColumn());
              }
              else {
                table.setValueAt(((JTextComponent)focusOwner).getText(), table.getEditingRow(), table.getEditingColumn());
              }
            }
          }
        }
        if (focusOwner instanceof DataField) {
View Full Code Here

      while (comp != null) {

        /*
         * ArrayField
         */
        ArrayField af = ArrayFieldCellHelper.getArrayField(comp);
        if (af != null) {
          s.push(new ArrayFieldFocus(af));
        }
        /*
         * TabFolder
 
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

        Parent action = (Parent) ActionMgr.getAction(comp, Parent.class);
        if (action != null)
            return (JComponent) action.parent;
        else {
            Container p;
            ArrayField af = ArrayFieldCellHelper.getArrayField(comp);
           
            // If the component is contained in an ArrayField, then the ArrayField is the parent.  CraigM: 27/03/2008.
            // TF:27/10/2008:Changed this logic to return the array field as the parent only if there is no real
            // parent, to cater for grids within array fields.
            p = comp.getParent();
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.