Package org.zanata.webtrans.client.history

Examples of org.zanata.webtrans.client.history.HistoryToken


            display.selectPartialText(invalidBefore ? editorFilter
                    .getLastModifiedBefore() : editorFilter
                    .getLastModifiedAfter());
        } else {
            HistoryToken newToken = history.getHistoryToken();
            populateHistoryTokenForEditorFilter(newToken, editorFilter);
            history.newItem(newToken);
        }

    }
View Full Code Here


    private void pushFilterHistory(boolean filterByTranslated,
            boolean filterByFuzzy, boolean filterByUntranslated,
            boolean filterByApproved, boolean filterByRejected,
            boolean filterByHasError, EditorFilter editorFilter) {
        HistoryToken token = history.getHistoryToken();
        token.setFilterTranslated(filterByTranslated);
        token.setFilterFuzzy(filterByFuzzy);
        token.setFilterUntranslated(filterByUntranslated);
        token.setFilterApproved(filterByApproved);
        token.setFilterRejected(filterByRejected);
        token.setFilterHasError(filterByHasError);

        if (editorFilter != null) {
            populateHistoryTokenForEditorFilter(token, editorFilter);
        }
        history.newItem(token);
View Full Code Here

    private Anchor createBookmarkIcon() {
        Anchor bookmarkIcon = new Anchor();
        bookmarkIcon.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                HistoryToken historyToken = history.getHistoryToken();
                historyToken.setTextFlowId(transUnit.getId().toString());
                history.newItem(historyToken);
            }
        });
        return bookmarkIcon;
    }
View Full Code Here

    }

    @Override
    public void fireDocumentSelection(DocumentInfo doc) {
        // generate history token
        HistoryToken token = history.getHistoryToken();

        currentDocument = doc;
        token.setDocumentPath(doc.getPath() + doc.getName());
        token.setView(MainView.Editor);
        if (doc.hasError() != null) {
            if (doc.hasError()) {
                token.setFilterHasError(true);
            } else {
                token.setFilterHasError(false);
            }
        }

        // don't carry searches over to the next document
        token.setEditorTextSearch("");
        history.newItem(token);

        userWorkspaceContext.setSelectedDoc(doc);
    }
View Full Code Here

        userWorkspaceContext.setSelectedDoc(doc);
    }

    @Override
    public void fireFilterToken(String value) {
        HistoryToken token = HistoryToken.fromTokenString(history.getToken());
        if (!value.equals(token.getDocFilterText())) {
            token.setDocFilterText(value);
            history.newItem(token.toTokenString());
        }
    }
View Full Code Here

        }
    }

    @Override
    public void fireExactSearchToken(boolean value) {
        HistoryToken token = HistoryToken.fromTokenString(history.getToken());
        if (value != token.getDocFilterExact()) {
            token.setDocFilterExact(value);
            history.newItem(token.toTokenString());
        }
    }
View Full Code Here

        }
    }

    @Override
    public void fireCaseSensitiveToken(boolean value) {
        HistoryToken token = HistoryToken.fromTokenString(history.getToken());
        if (value != token.isDocFilterCaseSensitive()) {
            token.setDocFilterCaseSensitive(value);
            history.newItem(token.toTokenString());
        }
    }
View Full Code Here

    @Override
    public void onRequestSelectTableRow(RequestSelectTableRowEvent event) {
        contextHolder.updateContext(null); // this will ensure
                                           // HistoryEventHandlerService fire
                                           // InitEditorEvent
        HistoryToken token = history.getHistoryToken();
        token.setView(MainView.Editor);
        token.setDocumentPath(event.getDocInfo().getPath()
                + event.getDocInfo().getName());
        token.clearEditorFilterAndSearch();
        token.setTextFlowId(event.getSelectedId().toString());
        history.newItem(token);
        history.fireCurrentHistoryState();
    }
View Full Code Here

        this.configHolder = configHolder;
    }

    @Override
    public void onValueChange(ValueChangeEvent<String> event) {
        HistoryToken newHistoryToken =
                HistoryToken.fromTokenString(event.getValue());
        Log.info("[gwt-history] Responding to history token: "
                + event.getValue());

        processForDocumentListPresenter(newHistoryToken);
        processForProjectWideSearch(newHistoryToken);

        configHolder.setFilterByUntranslated(newHistoryToken
                .isFilterUntranslated());
        configHolder.setFilterByFuzzy(newHistoryToken.isFilterFuzzy());
        configHolder
                .setFilterByTranslated(newHistoryToken.isFilterTranslated());
        configHolder.setFilterByApproved(newHistoryToken.isFilterApproved());
        configHolder.setFilterByRejected(newHistoryToken.isFilterRejected());
        configHolder.setFilterByHasError(newHistoryToken.isFilterHasError());

        DocumentId documentId =
                documentListPresenter.getDocumentId(newHistoryToken
                        .getDocumentPath());
        EditorFilter editorFilter = getEditorFilterFromToken(newHistoryToken);
        if (!getTransUnitActionContextHolder.isContextInitialized()
                && documentId != null) {
            DocumentInfo documentInfo =
                    documentListPresenter.getDocumentInfo(documentId);
            // if editor is not yet initialized, we want to load document with
            // search and target trans unit all at once
            Long textFlowId = newHistoryToken.getTextFlowId();
            TransUnitId transUnitId =
                    textFlowId == null ? null : new TransUnitId(textFlowId);
            getTransUnitActionContextHolder.initContext(documentInfo,
                    transUnitId, editorFilter);
            eventBus.fireEvent(new InitEditorEvent());
        }

        processForAppPresenter(documentId);
        processForBookmarkedTextFlow(newHistoryToken);
        processMessageFilterOptions(newHistoryToken);

        currentHistoryState = newHistoryToken;
        appPresenter.showView(newHistoryToken.getView());
    }
View Full Code Here

        registerHandler(display.getReplacementTextBox().addValueChangeHandler(
                new ValueChangeHandler<String>() {

                    @Override
                    public void onValueChange(ValueChangeEvent<String> event) {
                        HistoryToken token = history.getHistoryToken();
                        if (!event.getValue().equals(
                                token.getProjectSearchReplacement())) {
                            token.setProjectSearchReplacement(event.getValue());
                            history.newItem(token);
                        }
                    }
                }));
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.client.history.HistoryToken

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.