Package org.zanata.webtrans.shared.rpc

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


    @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

        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

                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

Related Classes of org.zanata.webtrans.shared.rpc.SaveOptionsAction

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.