Package org.jitterbit.integration.data.structure.text

Examples of org.jitterbit.integration.data.structure.text.Field


        if (isUpdateBlocked()) {
            return false;
        }
        boolean updated = false;
        if (o instanceof Field) {
            Field f = (Field) o;
            switch (columnIndex) {
            case 1:
                updated = setNewFieldName(f, ((String) value).trim());
                break;
            case 2:
View Full Code Here


    }
   
    @Override
    public Field createNewObject() {
        // TODO: Adjust this constructor, as necessary
        return new Field(-1, "", "String", "", "", 0, false);
    }
View Full Code Here

            }
        };
    }

    private boolean isIdentifier(int rowIndex) {
        Field f = getField(rowIndex);
        return ((f != null) && (f.getDataType() == FieldDataType.Identifier));
    }
View Full Code Here

    }

    @Override
    public Object createNewObject() {
        Segment s = new Segment("");
        Field id = new Field(-1, "ID", FieldDataType.Identifier.name(), "", "", 1, 0, 0, null, textStructure.isFixField());
        s.fieldList.add(id);
        return s;
    }
View Full Code Here

    }

    private void copyFieldList(Segment donator, Segment receiver) {
        List<Field> receiverFields = Lists.newArrayList();
        for (Field f : donator.getFieldList()) {
            receiverFields.add(new Field(f));
        }
        receiver.fieldList = receiverFields;
    }
View Full Code Here

     *            if <code>true</code> the displayed field information cannot be edited
     * @return <code>true</code> if any changes were made to the fields displayed in the dialog.
     */
    public static boolean show(Segment segment, boolean isFixedWidth, boolean readOnly) {
        checkNotNull(segment, "segment");
        Field identifier=segment.findIdentField();
        if (identifier != null && identifier.defaultValue.isEmpty() && identifier.format.isEmpty()) {
            String value = segment.getName();
            identifier.defaultValue = identifier.format = value;
            if (isFixedWidth) {
                identifier.setLength(value.length());
            }
        }
        SegmentFieldDialog dlg = new SegmentFieldDialog(UiUtils.getActiveWindow(),
                        segment, isFixedWidth, readOnly, getTitle(segment));
        dlg.setVisible(true);
View Full Code Here

        for (Field f : segment.getFieldList()) {
            // Create a copy of the field, so that we don't modify the field
            // instances that are actually attached to the segments. If the
            // user presses OK we will replace the old fields with the new ones.
            // On CANCEL we don't have to do anything
            tableModel.addRow(new Field(f));
        }
    }
View Full Code Here

        }
    }

    private static void checkIdentifier(FieldTableModel model) throws TextDocumentDefinitionException {
        // Check that exactly one identifier has been specified:
        Field identifier = getIdentifier(model);
        if (identifier == null) {
            throw new TextDocumentDefinitionException("Must specify an identifier field.");
        }
        checkIdentifierValue(identifier);
    }
View Full Code Here

        }
        checkIdentifierValue(identifier);
    }

    private static Field getIdentifier(FieldTableModel model) throws TextDocumentDefinitionException {
        Field identifier = null;
        for (int row = 0, rows = model.getRowCount(); row < rows; ++row) {
            Field f = model.getField(row);
            if (f.getDataType() == FieldDataType.Identifier) {
                if (identifier == null) {
                    identifier = f;
                } else {
                    // Duplicate identifiers
                    throw new TextDocumentDefinitionException("There can only be one identifier field.");
View Full Code Here

     */
    private static class FixedWidthFieldTableModel2 extends FixedWidthFieldTableModel {

        @Override
        public Field createNewObject() {
            Field field = super.createNewObject();
            if (getRowCount() == 0) {
                // For the first field we set the data type to Identifier:
                field.setDataType(FieldDataType.Identifier);
            }
            return field;
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.structure.text.Field

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.