Examples of SaveOptionsAction


Examples of org.zanata.webtrans.shared.rpc.SaveOptionsAction

        this.dispatcher = dispatcher;
        this.configHolder = configHolder;
    }

    public void persistOptionChange(Map<UserOptions, String> optsMap) {
        SaveOptionsAction action = new SaveOptionsAction(optsMap);

        dispatcher.execute(action, new AsyncCallback<SaveOptionsResult>() {
            @Override
            public void onFailure(Throwable caught) {
                eventBus.fireEvent(new NotificationEvent(
View Full Code Here

Examples of org.zanata.webtrans.shared.rpc.SaveOptionsAction

    @Test
    public void testExecuteWithOptionsInDatabase() throws Exception {
        UserConfigHolder configHolder = new UserConfigHolder();
        configHolder.setShowError(true); // we change one default value
        SaveOptionsAction action =
                new SaveOptionsAction(generateConfigMap(configHolder));
        saveHandler.execute(action, null); // save some options first

        LoadOptionsResult result =
                handler.execute(new LoadOptionsAction(null), null);
View Full Code Here

Examples of org.zanata.webtrans.shared.rpc.SaveOptionsAction

        ArgumentCaptor<AsyncCallback> callbackCaptor =
                ArgumentCaptor.forClass(AsyncCallback.class);
        verify(dispatcher).execute(actionCaptor.capture(),
                callbackCaptor.capture());

        SaveOptionsAction action = actionCaptor.getValue();

        int docListSize =
                Integer.parseInt(action.getConfigurationMap().get(
                        DocumentListPageSize));
        int editorSize =
                Integer.parseInt(action.getConfigurationMap().get(
                        EditorPageSize));

        boolean showError =
                Boolean.parseBoolean(action.getConfigurationMap().get(
                        ShowErrors));
        boolean displayButton =
                Boolean.parseBoolean(action.getConfigurationMap().get(
                        DisplayButtons));

        assertThat(docListSize, Matchers.equalTo(1000));
        assertThat(editorSize, Matchers.equalTo(2000));
        assertThat(displayButton, Matchers.equalTo(false));
View Full Code Here

Examples of org.zanata.webtrans.shared.rpc.SaveOptionsAction

                new HashMap<UserOptions, String>();
        configMap.put(UserOptions.DisplayButtons, Boolean.toString(true));
        configMap.put(UserOptions.EditorPageSize, Integer.toString(25));
        configMap.put(UserOptions.EnterSavesApproved, Boolean.toString(true));

        SaveOptionsAction action = new SaveOptionsAction(configMap);

        SaveOptionsResult result = handler.execute(action, null);

        assertThat(result.isSuccess(), Matchers.equalTo(true));
        List<HAccountOption> accountOptions =
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.