Package net.helipilot50.stocktrade.displayproject

Examples of net.helipilot50.stocktrade.displayproject.DataField$RollbackAction


//  }

    public static DataField newPercentageField(String name, int columns, String pattern, int minimumFraction) {
        PercentFormatter editFormatter = new PercentFormatter(pattern, minimumFraction);
        PercentFormatter displayFormatter = new PercentFormatter(pattern, minimumFraction);
        DataField df = newDataField(name, columns, new DefaultFormatterFactory(displayFormatter, displayFormatter, editFormatter, null));
        return df;
    }
View Full Code Here


    }

    public static DataField newAmountField(String name, int columns, String pattern, int decimalPlaces, Class<?> mappedType) {
        AmountFormatter editFormatter = new AmountFormatter(pattern, decimalPlaces, true, mappedType);
        AmountFormatter displayFormatter = new AmountFormatter(pattern, decimalPlaces, false, mappedType);
        DataField df = newDataField(name, columns, new DefaultFormatterFactory(displayFormatter, displayFormatter, editFormatter, null));
        return df;
    }
View Full Code Here

    }

    public static DataField newDecimalField(String name, int columns, String pattern, int decimalPlaces, Class<?> mappedType) {
        DecimalFormatter editFormatter = new DecimalFormatter(pattern, decimalPlaces, mappedType);
        DecimalFormatter displayFormatter = new DecimalFormatter(pattern, decimalPlaces, mappedType);
        DataField df = newDataField(name, columns, new DefaultFormatterFactory(displayFormatter, displayFormatter, editFormatter, null));
        return df;     
    }
View Full Code Here

    }

    public static DataField newIntegerField(String name, int columns) {
        IntegerFormatter editFormatter = new IntegerFormatter("#0");
        IntegerFormatter displayFormatter = new IntegerFormatter("#0");
        DataField df = newDataField(name, columns, new DefaultFormatterFactory(displayFormatter, displayFormatter, editFormatter, null));
        return df;
    }
View Full Code Here

        return df;
    }

    public static DataField newDateField(String name, int columns, Class<?> mappedType)
    {
        DataField df = configureFormatter(newDataField(name, columns, Constants.MK_NONE), cDefaultDateMask, '*', cDefaultDatePattern, mappedType);
        df.getDocument().addUndoableEditListener(new DateFieldEditListener(cDefaultDateMask));
        return df;
    }
View Full Code Here

//                new NumberFormatter(nf),
//                null);
//        ((DataField)this._component).setFormatterFactory(dff);
//        ((DataField)this._component).setOriginalFormatText(this.value.toString());

      DataField df = (DataField)this._component;
      AbstractFormatter af = df.getFormatter();
      Class<?> valueClass = null;
      if (af instanceof DefaultFormatter) {
        valueClass = ((DefaultFormatter)af).getValueClass();
      }
    NumericFormatter formatter = new NumericFormatter((DataField)this._component, this.value.toString(), valueClass);
View Full Code Here

        this.mappedType = mappedType;
    }

    @Override
    public void performAction() {
        DataField df = ((DataField)this._component);
        df.setOriginalFormatText(this.template.toString());
        if (this.mappedType == null){
         
          if (df.getDocument() instanceof TypeAwareValueModel){
            TypeAwareValueModel vm = (TypeAwareValueModel)df.getDocument();
            this.mappedType = vm.getValueType();
          } else {
            this.mappedType = DateTimeData.class;
          }
        }
        String templateValue = template.toString();
        String inputMask = this.formatter.convertFormatMask(templateValue);
        String format = this.formatter.convertTemplate(templateValue);
        // TF:14/07/2009:Fixed this to handle other placeholder characters besides '*'
        Matcher m = placeholderPattern.matcher(templateValue);
        char placeHolderChar = '*';
        if (m.find()) {
          String value = m.group(1);
          placeHolderChar = value.charAt(0);
        }
        DataFieldFactory.configureFormatter(df, inputMask, placeHolderChar, format, mappedType);
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        sdf.setLenient(this.formatter.isLenient());
        ((DataFieldVerifier)df.getInputVerifier()).setDateFormat(sdf);
    }
View Full Code Here

        CloneHelper.cloneClientProperties(source, target);
        return target;
    }

    public static JTree cloneJTree(JTree source) {
        DisplayNode root = clone((DisplayNode) source.getModel().getRoot(), true);
        TreeViewModel dtm = new TreeViewModel(root);
        JTree target = new JTree(dtm);
        CloneHelper.cloneComponent(source, target, new String[] {"UI", // class javax.swing.plaf.TreeUI
                "UIClassID", // class java.lang.String
                "accessibleContext", // class javax.accessibility.AccessibleContext
View Full Code Here

        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

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

TOP

Related Classes of net.helipilot50.stocktrade.displayproject.DataField$RollbackAction

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.