Examples of ContentState


Examples of org.zanata.common.ContentState

            return idIndexList.get(Math.max(currentIndex - 1, 0));
        }

        // we are in filter mode
        for (int i = currentIndex - 1; i >= 0; i--) {
            ContentState contentState = idAndStateMap.get(idIndexList.get(i));
            if (matchFilterCondition(contentState)) {
                return idIndexList.get(i);
            }
        }
        // nothing matches filter condition and has reached the end
View Full Code Here

Examples of org.zanata.common.ContentState

        return selected;
    }

    public TransUnitId getPreviousStateId() {
        for (int i = currentIndex - 1; i >= 0; i--) {
            ContentState contentState = idAndStateMap.get(idIndexList.get(i));
            if (configHolder.getContentStatePredicate().apply(contentState)) {
                return idIndexList.get(i);
            }
        }
        return selected;
View Full Code Here

Examples of org.zanata.common.ContentState

        return selected;
    }

    public TransUnitId getNextStateId() {
        for (int i = currentIndex + 1; i <= maxRowIndex(); i++) {
            ContentState contentState = idAndStateMap.get(idIndexList.get(i));
            if (configHolder.getContentStatePredicate().apply(contentState)) {
                return idIndexList.get(i);
            }
        }
        return selected;
View Full Code Here

Examples of org.zanata.common.ContentState

        }

        List<Map<String, Object>> stats = hQuery.list();
        // Collect the results for all states
        for (Map<String, Object> row : stats) {
            ContentState state = (ContentState) row.get("state");
            Long msgCount = (Long) row.get("msgCount");
            Long wordCount = (Long) row.get("wordCount");
            LocaleId localeId = (LocaleId) row.get("locale");

            TransUnitCount transUnitCount =
View Full Code Here

Examples of org.zanata.common.ContentState

        }

        @Override
        public SimpleHTextFlow transformTuple(Object[] tuple, String[] aliases) {
            Long id = null;
            ContentState state = null;
            String resId = null;
            for (int i = 0, aliasesLength = aliases.length; i < aliasesLength; i++) {
                String columnName = aliases[i];
                if (columnName.equals(ID)) {
                    id = (Long) tuple[i];
View Full Code Here

Examples of org.zanata.common.ContentState

        try {
            new Work<Void>() {
                @Override
                protected Void work() throws Exception {
                    ContentState oldContentState =
                            (ContentState) Iterables.find(
                                    Lists.newArrayList(event.getOldState()),
                                    Predicates.instanceOf(ContentState.class));

                    HTextFlowTarget target =
View Full Code Here

Examples of org.zanata.common.ContentState

public class ContentStateBridge implements TwoWayStringBridge {

    @Override
    public String objectToString(Object value) {
        if (value instanceof ContentState) {
            ContentState state = (ContentState) value;
            return state.toString();
        } else {
            throw new IllegalArgumentException(
                    "ContentStateBridge used on a non-ContentState type: "
                            + value.getClass());
        }
View Full Code Here

Examples of org.zanata.common.ContentState

        Map<String, TransUnitWords> result =
                new HashMap<String, TransUnitWords>();

        for (Object[] count : stats) {
            TransUnitWords stat;
            ContentState state = (ContentState) count[0];
            Long word = (Long) count[1];
            LocaleId locale = (LocaleId) count[2];
            if (!result.containsKey(locale.getId())) {
                stat = new TransUnitWords();
                result.put(locale.getId(), stat);
View Full Code Here

Examples of org.zanata.common.ContentState

        List<Map> stats = q.list();
        Map<String, TransUnitCount> retVal =
                new HashMap<String, TransUnitCount>();

        for (Map row : stats) {
            ContentState state = (ContentState) row.get("state");
            Long count = (Long) row.get("count");
            LocaleId localeId = (LocaleId) row.get("locale");

            TransUnitCount transUnitCount = retVal.get(localeId.getId());
            if (transUnitCount == null) {
View Full Code Here

Examples of org.zanata.common.ContentState

                    }

                    int nPlurals = textFlow.isPlural() ? numPlurals : 1;
                    // we have eagerly loaded all targets upfront
                    HTextFlowTarget hTarget = textFlow.getTargets().get(locale.getId());
                    ContentState currentState = ContentState.New;
                    if (hTarget != null) {
                        currentState = hTarget.getState();
                    }

                    if (mergeType == MergeType.IMPORT) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.