Package com.nexirius.util

Examples of com.nexirius.util.CopyPairs


        popupModel.setShowHelp(false);
        popupModel.setShowCloseOnly(!duplicate);

        if (duplicate) {
            copyPairs = new CopyPairs();
            popupDialogModel = orig.duplicate(null, copyPairs);

            popupDialogModel.addSoftDataModelListener(this); // activate this controller also for the dialog model

            if (clientMethods != null) {
View Full Code Here


    }

    public synchronized void assignDuplicate(DataModel duplicate, CopyPairs copyPairs) {
        DataModelEnumeration enDuplicate = duplicate.getEnumeration();
        DataModelEnumeration enOrig = getEnumeration();
        CopyPairs cp = null;
        boolean valueChanged = false;
        CopyPairs origChildren = null;

        deleted = null;

        if (((ArrayModel) duplicate).getSize() != getSize()) {
            valueChanged = true;
        }

        DataModelVector newChildren = new DataModelVector();

        while (enDuplicate.hasMore()) {
            DataModel duplicateChild = enDuplicate.next();
            DataModel origChild = (DataModel) copyPairs.getOrig(duplicateChild);

            if (origChild == null) {
                valueChanged = true;
                if (cp == null) {
                    cp = new CopyPairs();
                }

                newChildren.append(duplicateChild.duplicate(null, cp));
            } else {
                if (origChildren == null) {
                    origChildren = new CopyPairs();
                }
                origChild.assignDuplicate(duplicateChild, copyPairs);
                origChildren.put(origChild, origChild);
                origChild.setParentDataModelContainer(null);
                newChildren.append(origChild);
            }

            if (!valueChanged) {
                // check, whether the order has changed
                DataModel origChildAtPos = enOrig.next();

                if (origChildAtPos != origChild) {
                    valueChanged = true;
                }
            }
        }

        if (valueChanged) {
            // store the deleted instances
            DataModelEnumeration en = getEnumeration();
            while (en.hasMore()) {
                DataModel model = en.next();

                if (origChildren == null || origChildren.getCopy(model) == null) {
                    if (deleted == null) {
                        deleted = new DataModelVector();
                    }
                    deleted.append(model);
                }
View Full Code Here

                }
            }
        }

        if (copyPairs == null) {
            copyPairs = new CopyPairs();
        }

        ArrayModel ret = (ArrayModel) super.duplicate(instance, copyPairs);

        ret.highlightedItem = highlightedItem;
View Full Code Here

    public DataModelVector duplicate(CopyPairs copyPairs) {
        DataModelVector ret = new DataModelVector();
        Enumeration e = elements();

        if (copyPairs == null) {
            copyPairs = new CopyPairs();
        }

        while (e.hasMoreElements()) {
            DataModel orig = (DataModel) e.nextElement();
            DataModel copy = (DataModel) copyPairs.getCopy(orig);
View Full Code Here

     * @param instance  null (eventually used by subclasses which define the duplicate method)
     * @param copyPairs A list which avoids creating two copies of the same instance (can be null)
     */
    public DataModel duplicate(DataModel instance, CopyPairs copyPairs) {
        if (copyPairs == null) {
            copyPairs = new CopyPairs();
        }
       
        if (instance == null) {
            try {
                instance = (DataModel) getClass().getConstructor(null).newInstance(null);
View Full Code Here

        JnexPreparedStatement searchStatement = createSearchCommand(whereClause, orderByClause);

        searchStatement.executeQuery();

        ResultSet resultSet = searchStatement.getPreparedStatement().getResultSet();
        CopyPairs copyPairs = new CopyPairs();
        int total = 0;
        int count = 0;
        if (progressBar != null) {
            total = count(whereClause);
            progressBar.resetProgress();
View Full Code Here

        return count;
    }

    private int fillResultsetToModel(PreparedStatement preparedStatement, DataModel resultEntryTemplate, ArrayModel result) throws Exception  {
        ResultSet resultSet = preparedStatement.getResultSet();
        CopyPairs copyPairs = new CopyPairs();
        int ret = 0;

        while (resultSet.next()) {
            DataModel model = resultEntryTemplate.duplicate(null, copyPairs);
View Full Code Here

     */
    public void startDuplicatePopup() {
        orig = model;

        if (orig != null) {
            copyPairs = new CopyPairs();
            model = orig.duplicate(null, copyPairs);
        }
    }
View Full Code Here

        if (instance == null) {
            instance = new SimpleArrayModel(getArray());
        }

        if (copyPairs == null) {
            copyPairs = new CopyPairs();
        }

        return super.duplicate(instance, copyPairs);
    }
View Full Code Here

TOP

Related Classes of com.nexirius.util.CopyPairs

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.