Search in sources :

Example 1 with UploadLayerListController

use of au.org.ala.spatial.composer.input.UploadLayerListController in project spatial-portal by AtlasOfLivingAustralia.

the class ToolComposer method onClick$bSpeciesListUpload.

public void onClick$bSpeciesListUpload(Event event) {
    UploadLayerListController window = (UploadLayerListController) Executions.createComponents("WEB-INF/zul/input/UploadSpeciesList.zul", this, null);
    window.setCallback(new EventListener() {

        @Override
        public void onEvent(Event event) throws Exception {
            importList((String) event.getData());
            //enable btnOk
            btnOk.setAutodisable("");
            btnOk.setDisabled(false);
        }
    });
    try {
        window.setParent(this);
        window.doModal();
    } catch (Exception e) {
        LOGGER.error("error opening UploadSpeciesList.zul", e);
    }
}
Also used : UploadLayerListController(au.org.ala.spatial.composer.input.UploadLayerListController) EventListener(org.zkoss.zk.ui.event.EventListener) IOException(java.io.IOException)

Example 2 with UploadLayerListController

use of au.org.ala.spatial.composer.input.UploadLayerListController in project spatial-portal by AtlasOfLivingAustralia.

the class ToolComposer method onSelect$selectedLayersCombobox.

public void onSelect$selectedLayersCombobox(Event event) {
    Comboitem ci = selectedLayersCombobox.getSelectedItem();
    if (ci != null && lbListLayers != null) {
        String layersList = null;
        if (ci.getValue() != null && ci.getValue() instanceof LayerSelection) {
            layersList = ((LayerSelection) ci.getValue()).getLayers();
        } else {
            if (ci.getValue() == null) {
                if (ci.getLabel().toLowerCase().contains("paste")) {
                    PasteLayerListController window = (PasteLayerListController) Executions.createComponents("WEB-INF/zul/input/PasteLayerList.zul", this, null);
                    window.setCallback(new EventListener() {

                        @Override
                        public void onEvent(Event event) throws Exception {
                            selectLayerFromList((String) event.getData());
                            updateLayerSelectionCount();
                        }
                    });
                    try {
                        window.setParent(this);
                        window.doModal();
                    } catch (Exception e) {
                        LOGGER.error("error opening PasteLayerList.zul", e);
                    }
                } else if (ci.getLabel().toLowerCase().contains("import")) {
                    UploadLayerListController window = (UploadLayerListController) Executions.createComponents("WEB-INF/zul/input/UploadLayerList.zul", this, null);
                    window.setCallback(new EventListener() {

                        @Override
                        public void onEvent(Event event) throws Exception {
                            selectLayerFromList((String) event.getData());
                            updateLayerSelectionCount();
                        }
                    });
                    try {
                        window.setParent(this);
                        window.doModal();
                    } catch (Exception e) {
                        LOGGER.error("error opening UploadLayerList.zul", e);
                    }
                }
                selectedLayersCombobox.setSelectedIndex(-1);
            }
        }
        selectLayerFromList(layersList);
    }
}
Also used : UploadLayerListController(au.org.ala.spatial.composer.input.UploadLayerListController) PasteLayerListController(au.org.ala.spatial.composer.input.PasteLayerListController) EventListener(org.zkoss.zk.ui.event.EventListener) IOException(java.io.IOException)

Example 3 with UploadLayerListController

use of au.org.ala.spatial.composer.input.UploadLayerListController in project spatial-portal by AtlasOfLivingAustralia.

the class AddSpeciesController method onClick$bSpeciesListUpload.

public void onClick$bSpeciesListUpload(Event event) {
    UploadLayerListController window = (UploadLayerListController) Executions.createComponents("WEB-INF/zul/input/UploadSpeciesList.zul", this, null);
    window.setCallback(new EventListener() {

        @Override
        public void onEvent(Event event) throws Exception {
            importList((String) event.getData());
            //enable btnOk
            btnOk.setAutodisable("");
            btnOk.setDisabled(false);
        }
    });
    try {
        window.setParent(this);
        window.doModal();
    } catch (Exception e) {
        LOGGER.error("error opening UploadSpeciesList.zul", e);
    }
}
Also used : UploadLayerListController(au.org.ala.spatial.composer.input.UploadLayerListController) IOException(java.io.IOException)

Aggregations

UploadLayerListController (au.org.ala.spatial.composer.input.UploadLayerListController)3 IOException (java.io.IOException)3 EventListener (org.zkoss.zk.ui.event.EventListener)2 PasteLayerListController (au.org.ala.spatial.composer.input.PasteLayerListController)1