Package DisplayProject

Examples of DisplayProject.FixedLengthDocument


            // Mask type: MK_NONE
            qq__ControlNumberDF = DataFieldFactory.newDataField("_ControlNumberDF", 40, TextData.class, Constants.MK_NONE);
            qq__ControlNumberDF.setValue("");
            qq__ControlNumberDF.setOriginalFormatText(null);
            qq__ControlNumberDF.setHorizontalAlignment(JTextField.LEFT);
            qq__ControlNumberDF.setDocument( new FixedLengthDocument(40) ); // Max characters of 40
            getBindingManager().bindComponent(qq__ControlNumberDF, "_ControlNumberDF");
            WidthPolicy.set(qq__ControlNumberDF, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__ControlNumberDF, Constants.SP_NATURAL);
            qq__ControlNumberDF.setMinimumSize(new Dimension(297, 23));
            qq__ControlNumberDF.setSize(new Dimension(297, 23));
View Full Code Here


        if (qq__SPRNbrDF == null) {
            // Mask type: MK_NONE
            qq__SPRNbrDF = DataFieldFactory.newDataField("_SPRNbrDF", 10, IntegerNullable.class, Constants.MK_NONE);
            qq__SPRNbrDF.setOriginalFormatText(null);
            qq__SPRNbrDF.setHorizontalAlignment(JTextField.RIGHT);
            qq__SPRNbrDF.setDocument( new FixedLengthDocument(8) ); // Max characters of 8
            getBindingManager().bindComponent(qq__SPRNbrDF, "_SPRNbrDF");
            WidthPolicy.set(qq__SPRNbrDF, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__SPRNbrDF, Constants.SP_NATURAL);
            qq__SPRNbrDF.setMinimumSize(new Dimension(84, 23));
            qq__SPRNbrDF.setSize(new Dimension(84, 23));
View Full Code Here

            // Mask type: MK_NONE
            qq__SizeDF = DataFieldFactory.newDataField("_SizeDF", 40, TextData.class, Constants.MK_NONE);
            qq__SizeDF.setValue("");
            qq__SizeDF.setOriginalFormatText(null);
            qq__SizeDF.setHorizontalAlignment(JTextField.LEFT);
            qq__SizeDF.setDocument( new FixedLengthDocument(40) ); // Max characters of 40
            getBindingManager().bindComponent(qq__SizeDF, "_SizeDF");
            WidthPolicy.set(qq__SizeDF, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__SizeDF, Constants.SP_NATURAL);
            qq__SizeDF.setMinimumSize(new Dimension(297, 23));
            qq__SizeDF.setSize(new Dimension(297, 23));
View Full Code Here

        if (qq__ReferenceIDDF == null) {
            // Mask type: MK_NONE
            qq__ReferenceIDDF = DataFieldFactory.newDataField("_ReferenceIDDF", 12, TextNullable.class, Constants.MK_NONE);
            qq__ReferenceIDDF.setOriginalFormatText(null);
            qq__ReferenceIDDF.setHorizontalAlignment(JTextField.LEFT);
            qq__ReferenceIDDF.setDocument( new FixedLengthDocument(10) ); // Max characters of 10
            getBindingManager().bindComponent(qq__ReferenceIDDF, "_ReferenceIDDF");
            WidthPolicy.set(qq__ReferenceIDDF, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__ReferenceIDDF, Constants.SP_NATURAL);
            qq__ReferenceIDDF.setMinimumSize(new Dimension(96, 23));
            qq__ReferenceIDDF.setSize(new Dimension(96, 23));
View Full Code Here

            // Mask type: MK_NONE
            qq__DescriptionDF = DataFieldFactory.newDataField("_DescriptionDF", 78, TextData.class, Constants.MK_NONE);
            qq__DescriptionDF.setValue("");
            qq__DescriptionDF.setOriginalFormatText(null);
            qq__DescriptionDF.setHorizontalAlignment(JTextField.LEFT);
            qq__DescriptionDF.setDocument( new FixedLengthDocument(60) ); // Max characters of 60
            getBindingManager().bindComponent(qq__DescriptionDF, "_DescriptionDF");
            WidthPolicy.set(qq__DescriptionDF, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__DescriptionDF, Constants.SP_NATURAL);
            qq__DescriptionDF.setMinimumSize(new Dimension(571, 23));
            qq__DescriptionDF.setSize(new Dimension(571, 23));
View Full Code Here

        if (qq__WCLineNumberDF == null) {
            // Mask type: Constants.MK_INTEGER
            qq__WCLineNumberDF = DataFieldFactory.newDataField("_WCLineNumberDF", 4, IntegerNullable.class, Constants.MK_INTEGER);
            qq__WCLineNumberDF.setOriginalFormatText(null);
            qq__WCLineNumberDF.setHorizontalAlignment(JTextField.LEFT);
            qq__WCLineNumberDF.setDocument( new FixedLengthDocument(4) ); // Max characters of 4
            getBindingManager().bindComponent(qq__WCLineNumberDF, "_WCLineNumberDF");
            WidthPolicy.set(qq__WCLineNumberDF, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__WCLineNumberDF, Constants.SP_NATURAL);
            qq__WCLineNumberDF.setMinimumSize(new Dimension(38, 23));
            qq__WCLineNumberDF.setSize(new Dimension(38, 23));
View Full Code Here

      // 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

      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

        if (qq_aString == null) {
            // Mask type: MK_NONE
            qq_aString = DataFieldFactory.newDataField("aString", 17, Constants.MK_NONE);
            qq_aString.setOriginalFormatText(null);
            qq_aString.setHorizontalAlignment(JTextField.LEFT);
            qq_aString.setDocument( new FixedLengthDocument(5) ); // Max characters of 5
            getBindingManager().bindComponent(qq_aString, "AString");
            WidthPolicy.set(qq_aString, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq_aString, Constants.SP_NATURAL);
            qq_aString.setMinimumSize(new Dimension(115, 19));
            qq_aString.setSize(new Dimension(115, 19));
View Full Code Here

        if (qq_aInteger == null) {
            // Mask type: Constants.MK_INTEGER
            qq_aInteger = DataFieldFactory.newDataField("aInteger", 17, Constants.MK_INTEGER);
            qq_aInteger.setOriginalFormatText(null);
            qq_aInteger.setHorizontalAlignment(JTextField.RIGHT);
            qq_aInteger.setDocument( new FixedLengthDocument(10) ); // Max characters of 10
            getBindingManager().bindComponent(qq_aInteger, "AInteger");
            WidthPolicy.set(qq_aInteger, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq_aInteger, Constants.SP_NATURAL);
            qq_aInteger.setMinimumSize(new Dimension(114, 19));
            qq_aInteger.setSize(new Dimension(114, 19));
View Full Code Here

TOP

Related Classes of DisplayProject.FixedLengthDocument

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.