Examples of FixedLengthDocument


Examples of DisplayProject.FixedLengthDocument

      this.passwordDataFieldCloned = pDataField.cloneComponentForRenderer();
      ArrayFieldCellHelper.setUpCellRenderer(this.passwordDataFieldOriginal, this.passwordDataFieldCloned); // CraigM: 28/03/2008
      // TF:29 Oct 2008:Set this up to handle fixed length documents
     
      if (this.passwordDataFieldOriginal.getDocument() instanceof FixedLengthDocument) {
        FixedLengthDocument doc = (FixedLengthDocument)this.passwordDataFieldOriginal.getDocument();
        this.passwordDataFieldCloned.setDocument(new FixedLengthDocument(doc.getMaxLength()));
      }
      else {
        this.passwordDataFieldCloned.setDocument(new PlainDocument()); // we can't reuse the document
      }
    this.passwordDataFieldCloned.getCaret().setVisible(false);
View Full Code Here

Examples of DisplayProject.FixedLengthDocument

      this.dataFieldOriginal = pDataField;
      this.dataFieldCloned = pDataField.cloneComponentForRenderer();
      ArrayFieldCellHelper.setUpCellRenderer(this.dataFieldOriginal, this.dataFieldCloned); // CraigM: 28/03/2008
      // TF:29 Oct 2008:Set this up to handle fixed length documents
      if (this.dataFieldOriginal.getDocument() instanceof FixedLengthDocument) {
        FixedLengthDocument doc = (FixedLengthDocument)this.dataFieldOriginal.getDocument();
        this.dataFieldCloned.setDocument(new FixedLengthDocument(doc.getMaxLength()));
      }
      else {
        this.dataFieldCloned.setDocument(new PlainDocument()); // we can't reuse the document
      }
      this.dataFieldCloned.setFormatterFactory(new DataFieldFormatterFactory()); // we can't reuse the formatter
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

        this.editor = new BorderedComboBoxEditor();
        this.setEditor(this.editor);
        this.setRenderer(new BorderedComboBoxRenderer());
        JTextComponent comp = (JTextComponent)this.editor.getEditorComponent();
        comp.setBackground(this.getBackground());
        comp.setDocument(new FixedLengthDocument(0));

        comp.addKeyListener(new ComboBoxKeyHandler());
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

            }
            if (autoComplete) {
                editComponent.setDocument(new FillinManagementDocument(this, showDropdowns, listEntriesOnly, maxCharacters));
            }
            else {
                editComponent.setDocument(new FixedLengthDocument(maxCharacters));
            }
        }
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

      this.dataFieldOriginal = pDataField;
      this.dataFieldCloned = pDataField.cloneComponentForRenderer();
      ArrayFieldCellHelper.setUpCellRenderer(this.dataFieldOriginal, this.dataFieldCloned); // CraigM: 28/03/2008
      // TF:29 Oct 2008:Set this up to handle fixed length documents
      if (this.dataFieldOriginal.getDocument() instanceof FixedLengthDocument) {
        FixedLengthDocument doc = (FixedLengthDocument)this.dataFieldOriginal.getDocument();
        this.dataFieldCloned.setDocument(new FixedLengthDocument(doc.getMaxLength()));
      }
      else {
        this.dataFieldCloned.setDocument(new PlainDocument()); // we can't reuse the document
      }
      this.dataFieldCloned.setFormatterFactory(new DataFieldFormatterFactory()); // we can't reuse the formatter
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

      this.passwordDataFieldCloned = pDataField.cloneComponentForRenderer();
      ArrayFieldCellHelper.setUpCellRenderer(this.passwordDataFieldOriginal, this.passwordDataFieldCloned); // CraigM: 28/03/2008
      // TF:29 Oct 2008:Set this up to handle fixed length documents
     
      if (this.passwordDataFieldOriginal.getDocument() instanceof FixedLengthDocument) {
        FixedLengthDocument doc = (FixedLengthDocument)this.passwordDataFieldOriginal.getDocument();
        this.passwordDataFieldCloned.setDocument(new FixedLengthDocument(doc.getMaxLength()));
      }
      else {
        this.passwordDataFieldCloned.setDocument(new PlainDocument()); // we can't reuse the document
      }
    this.passwordDataFieldCloned.getCaret().setVisible(false);
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

      // CONV:TF:21 Jul 2009:Fixed this to work properly
      if (isEditable() && isEnabled()) {
        int finalCursorPosition = 0;
        boolean didManualPaste = false;
        if (getDocument() instanceof FixedLengthDocument){
          FixedLengthDocument doc = (FixedLengthDocument)getDocument();
          Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
          try {
            if (doc.getMaxLength() > 0 && t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
              String text = (String)t.getTransferData(DataFlavor.stringFlavor);
              // CONV:TF:21 Jul 2009:Insert the text at the correct spot in the current String. The String is truncated
              // to the maximum number of characters, and the cursor is moved to the end of the selection or the
              // end of string, whichever is smaller.
              if (text.length()+doc.getLength() > doc.getMaxLength()) {
                String currentText = doc.getText(0, doc.getLength());
                int caretMark = this.getCaret().getMark();
                int caretDot = this.getCaret().getDot();
                String newText = currentText.substring(0, Math.min(caretMark, caretDot)) + text + currentText.substring(Math.max(caretMark, caretDot));
                this.setText(newText);
                finalCursorPosition = Math.min(caretDot+text.length(), doc.getMaxLength());
                didManualPaste = true;
              }
            }
          } catch (UnsupportedFlavorException e) {
          } catch (IOException e) {
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

     * @return
     */
    public static DataField newDataField() {
        DataField df = new DataField();
        df.setOpaque(true);
        df.setDocument(new FixedLengthDocument(0));
        df.setInputVerifier(new DataFieldVerifier());
        // Install a factory that knows about data value instances
        df.setFormatterFactory(new DataFieldFormatterFactory());
        df.setDisabledTextColor(SystemColor.windowText);
        setFont(df);
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.FixedLengthDocument

    public static DataField newDataField(String name, int columns, AbstractFormatter formatter) {
        DataField df = new DataField(formatter);
        df.setName(name);
        df.setColumns(columns);
        df.setOpaque(true);
        df.setDocument(new FixedLengthDocument(0));
        df.setInputVerifier(new DataFieldVerifier());
        df.setDisabledTextColor(SystemColor.windowText);
        setFont(df);
        return df;
    }
View Full Code Here

Examples of util.FixedLengthDocument

                view.setVisible(false);
                view.dispose();
            }
        });

        view.getTxtCenario().setDocument(new FixedLengthDocument(30));

        view.getTxtCenario().setName("Nome do cenário");
        final ValidationPanel pnl = new ValidationPanel();
        view.setContentPane(pnl);
        pnl.setInnerComponent(view.getPnlCampos());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.