Examples of HistoryToken


Examples of autotest.common.CustomHistory.HistoryToken

        args.put("id", new JSONNumber(Integer.parseInt(idString)));
        rpcProxy.rpcCall("get_embedded_query_url_token", args, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                String tokenString = Utils.jsonToString(result);
                HistoryToken token;
                try {
                    token = HistoryToken.fromString(tokenString);
                } catch (IllegalArgumentException exc) {
                    NotifyManager.getInstance().showError("Invalid embedded query token " +
                                                          tokenString);
                    return;
                }

                // since this is happening asynchronously, the history may have changed, so ensure
                // it's set back to what it should be.
                HistoryToken shortToken = new HistoryToken();
                shortToken.put(HISTORY_TOKEN, idString);
                CustomHistory.newItem(shortToken);

                CustomHistory.simulateHistoryToken(token);
            }
        });
View Full Code Here

Examples of autotest.common.CustomHistory.HistoryToken

               
                assert queries.size() == 1;
                JSONObject query = queries.get(0).isObject();
                int queryId = (int) query.get("id").isNumber().doubleValue();
                String tokenString = query.get("url_token").isString().stringValue();
                HistoryToken token;
                try {
                    token = HistoryToken.fromString(tokenString);
                } catch (IllegalArgumentException exc) {
                    NotifyManager.getInstance().showError("Invalid saved query token " +
                                                          tokenString);
                    return;
                }

                // since this is happening asynchronously, the history may have changed, so ensure
                // it's set back to what it should be.
                HistoryToken shortToken = new HistoryToken();
                shortToken.put(HISTORY_TOKEN, Integer.toString(queryId));
                CustomHistory.newItem(shortToken);

                CustomHistory.simulateHistoryToken(token);
            }
        });
View Full Code Here

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

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

    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

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

    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

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

    }

    @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

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

        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

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

        }
    }

    @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

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

        }
    }

    @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

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

    @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
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.