Package org.zanata.common

Examples of org.zanata.common.ContentState


        List<TransUnitStatus> statusList =
                Lists.newArrayListWithExpectedSize(textFlows.size());

        for (HTextFlow textFlow : textFlows) {
            ContentState state = textFlow.getTargets().get(hLocale.getId()).getState();
            statusList.add(new TransUnitStatus(textFlow.getId(), textFlow
                    .getResId(), state));
        }

        Type genericType = new GenericType<List<Locale>>() {
View Full Code Here


            return idIndexList.get(Math.min(currentIndex + 1, maxRowIndex()));
        }

        // we are in filter mode
        for (int i = currentIndex + 1; i <= maxRowIndex(); 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

            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

        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

        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

        }

        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

        }

        @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

        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

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

        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

TOP

Related Classes of org.zanata.common.ContentState

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.