Search in sources :

Example 1 with StringMapListUnmarshaller

use of org.eclipse.che.ide.rest.StringMapListUnmarshaller in project che by eclipse.

the class AntPagePresenter method getEstimateProjectCallback.

public AsyncRequestCallback<Map<String, List<String>>> getEstimateProjectCallback() {
    return new AsyncRequestCallback<Map<String, List<String>>>(new StringMapListUnmarshaller()) {

        @Override
        protected void onSuccess(Map<String, List<String>> result) {
            List<String> srcFolder = result.get(AntAttributes.SOURCE_FOLDER);
            srcFolder = srcFolder != null && !srcFolder.isEmpty() ? srcFolder : Arrays.asList(AntAttributes.DEF_SRC_PATH);
            setAttribute(AntAttributes.SOURCE_FOLDER, srcFolder);
            List<String> testSrcFolder = result.get(AntAttributes.TEST_SOURCE_FOLDER);
            testSrcFolder = testSrcFolder != null && !testSrcFolder.isEmpty() ? testSrcFolder : Arrays.asList(AntAttributes.DEF_TEST_SRC_PATH);
            setAttribute(AntAttributes.TEST_SOURCE_FOLDER, testSrcFolder);
        }

        @Override
        protected void onFailure(Throwable exception) {
            Log.error(getClass(), exception.getMessage());
        }
    };
}
Also used : AsyncRequestCallback(org.eclipse.che.ide.rest.AsyncRequestCallback) List(java.util.List) StringMapListUnmarshaller(org.eclipse.che.ide.rest.StringMapListUnmarshaller) Map(java.util.Map)

Aggregations

List (java.util.List)1 Map (java.util.Map)1 AsyncRequestCallback (org.eclipse.che.ide.rest.AsyncRequestCallback)1 StringMapListUnmarshaller (org.eclipse.che.ide.rest.StringMapListUnmarshaller)1