Package DisplayProject.controls

Examples of DisplayProject.controls.MultiLineTextField


    public static MultiLineTextField newCharacterField(TextData value){
        return newCharacterField(value.toString());
    }
    public static MultiLineTextField newCharacterField(String value){
        MultiLineTextField characterField = newTextEditField("");
        characterField.setText(value);
        return characterField;
    }
View Full Code Here


     */
    public void bind(JComponent control, ValueModel valueModel)
    {
        // Respect the document that already exists on the control, if any
        JTextComponent textControl = (JTextComponent)control;
        MultiLineTextField textArea = null;
        if (textControl instanceof MultiLineTextField) {
            textArea = (MultiLineTextField)textControl;
            // Text area is associated with valueModel so that the former can distinguish between
            // user entered text and model supplied text. Cursor is to be placed at the beginning of model
            // supplied text.
            textArea.setValueModel(valueModel);
            // Register the first PropertyChangeListener on valueModel BEFORE the DocumentAdapter has registered.
            textArea.registerPropertyChangeHandler();
        }
        if (textControl.getDocument() != null) {
          // TF:13/11/2009:LUM-48:Added the parameter to the TextDataToStringConverter to allow the use of identity comparisons when firing property change events
            Bindings.bind((JTextComponent) control,new TextDataToStringConverter(valueModel, textArea != null), textControl.getDocument(), false);
        }
        else {
          // TF:13/11/2009:LUM-48:Added the parameter to the TextDataToStringConverter to allow the use of identity comparisons when firing property change events
            Bindings.bind((JTextComponent) control,new TextDataToStringConverter(valueModel, textArea != null),false);
        }
        if (textArea != null) {
            // Register the second PropertyChangeListener on valueModel AFTER the DocumentAdapter has registered.
            textArea.registerCaratPositionHandler();
        }
    }
View Full Code Here

            params.put("column", new ParameterHolder(outlineField.getColumnIndex(X + OutlineField.cCOLUMN_SPACING)+1));
            params.put("sizes", new ParameterHolder(outlineField.getColumnSizes()));
            params.put("spacing", new ParameterHolder(OutlineField.cCOLUMN_SPACING));
        }
        else if (pControl instanceof MultiLineTextField){
            MultiLineTextField field = (MultiLineTextField)pControl;
            try {
                int offset = field.getCaretPosition()-1;
                int lRow = field.getLineOfOffset(offset);
                int lCol = offset - field.getLineStartOffset(lRow);
                params.put("row", new ParameterHolder(lRow));
                params.put("column", new ParameterHolder(lCol));
            }
            catch (BadLocationException ble) {
                Logger.getLogger(ClickListener.class).error("Bad location for text field", ble);
View Full Code Here

       
        // --------------------------------------------------------------------
        // Expand text fields
        // --------------------------------------------------------------------
        else if (comp instanceof MultiLineTextField) {
          MultiLineTextField tf = (MultiLineTextField)comp;
         
          if (tf.getParent() != null && tf.getParent().getParent() instanceof JScrollPane) {
            JScrollPane sp = (JScrollPane)tf.getParent().getParent();
            sp.setSize(tf.getPreferredSize());
            sp.setMinimumSize(tf.getPreferredSize());
            sp.setPreferredSize(tf.getPreferredSize());

            if (removeScrollBars) {
                    sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
                    sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
                }
          }
            Container parent = tf.getParent();

            while (parent != null) {
                if (parent instanceof JFrame) {
                    ((JFrame)parent).validate();
                    ((JFrame)parent).pack();
View Full Code Here

    private TextEditFactory() {
        super();
    }
    public static MultiLineTextField newTextField(String name, int rows, int columns){
        // Switched to use MultiLineTextField.  CraigM: 17/01/2008.
        final MultiLineTextField ta = new MultiLineTextField(name, rows, columns);
        // TF:12/12/2008:Word wrap is off by default in a text edit field
        ta.setLineWrap(false);
        ta.setWrapStyleWord(false);
        //PM:12/10/07 moved to constuctor
        //ta.setDisabledTextColor(SystemColor.windowText);
        ta.setFont(getDefaultFont());

        // TF:26/9/07:Default the color to transparent (inherit)
        //ta.setBackground(null); PM:30/10/07 not sure this is correct

        return ta; //PM:18/1/08 changed to return MultiLineTextField in place of a JTextArea
View Full Code Here

        return ta; //PM:18/1/08 changed to return MultiLineTextField in place of a JTextArea
    }

    public static MultiLineTextField newTextEditField(String name, int rows, int columns) {
        // Switched to use MultiLineTextField.  CraigM: 17/01/2008.
        MultiLineTextField ta = new MultiLineTextField(name, rows, columns);
        //PM:12/10/07 moved to constuctor
        //ta.setDisabledTextColor(SystemColor.windowText);
        ta.setFont(getDefaultFont());
        return ta; //PM:18/1/08 changed to return MultiLineTextField in place of a JTextArea
    }
View Full Code Here

        return ta; //PM:18/1/08 changed to return MultiLineTextField in place of a JTextArea
    }

    public static MultiLineTextField newTextEditField(String name){
        // Switched to use MultiLineTextField.  CraigM: 17/01/2008.
        MultiLineTextField tp = new MultiLineTextField(name);
        //PM:12/10/07 moved to constuctor
        //tp.setDisabledTextColor(SystemColor.windowText);
        tp.setFont(getDefaultFont());
        return tp; //PM:18/1/08 changed to return MultiLineTextField in place of a JTextArea
    }
View Full Code Here

    public static MultiLineTextField newCharacterField(TextData value){
        return newCharacterField(value.toString());
    }
    public static MultiLineTextField newCharacterField(String value){
        MultiLineTextField characterField = newTextEditField("");
        characterField.setText(value);
        return characterField;
    }
View Full Code Here

    private boolean printingRemoveScrollBars;

    public TextFieldCellRenderer(JScrollPane pScrollPane) {
      // CraigM:25/07/2008 - Force any pending actions on the widget through (like colour changes), so when we clone the widget, we get the latest info
      UIutils.processGUIActions(pScrollPane);
        MultiLineTextField tf = (MultiLineTextField)pScrollPane.getViewport().getComponent(0);

        this.sp = new JScrollPane(tf.cloneComponent());
        ArrayFieldCellHelper.setUpCellRenderer(pScrollPane, this.sp); // CraigM: 28/03/2008
        this.sp.setPreferredSize(pScrollPane.getPreferredSize());
        this.sp.setMinimumSize(pScrollPane.getMinimumSize());
        this.sp.setSize(pScrollPane.getSize());
        this.sp.setHorizontalScrollBarPolicy(pScrollPane.getHorizontalScrollBarPolicy());
View Full Code Here

                this.getMultiLineTextField().setBackgroundTemporarily(SystemColor.window);
            }
        }
       
        if (this.isPrinting && this.sp.getViewport().getComponentCount() > 0) {
          MultiLineTextField tf = this.getMultiLineTextField();
        sp.setSize(tf.getPreferredSize());
        sp.setMinimumSize(tf.getPreferredSize());
        sp.setPreferredSize(tf.getPreferredSize());
       
        if (printingRemoveScrollBars) {
          sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
          sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        }
View Full Code Here

TOP

Related Classes of DisplayProject.controls.MultiLineTextField

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.