Package org.geomajas.sld.client

Examples of org.geomajas.sld.client.SldGwtServiceAsync


    panel.add(nameLabel, 100, 300);

    // Add it to the root panel.
    RootPanel.get().add(panel);

    final SldGwtServiceAsync service = GWT.create(SldGwtService.class);
    ServiceDefTarget endpoint = (ServiceDefTarget) service;
    endpoint.setServiceEntryPoint(GWT.getHostPageBaseURL() + "d/sld");
    service.findAll(new AsyncCallback<List<String>>() {

      public void onSuccess(List<String> result) {
        GWT.log("got " + result.size() + " SLDs");
        for (String name : result) {
          sldList.addItem(name);
        }
      }

      public void onFailure(Throwable caught) {
        GWT.log("could not access SLDs", caught);
      }
    });
    sldList.addChangeHandler(new ChangeHandler() {

      public void onChange(ChangeEvent event) {
        int index = sldList.getSelectedIndex();
        if (index >= 0) {
          String name = sldList.getItemText(index);
          service.findByName(name, new AsyncCallback<StyledLayerDescriptorInfo>() {

            public void onSuccess(StyledLayerDescriptorInfo sld) {
              if (!sld.getChoiceList().isEmpty()) {
                StyledLayerDescriptorInfo.ChoiceInfo info = sld.getChoiceList().iterator().next();
                if (info.ifNamedLayer()) {
View Full Code Here

TOP

Related Classes of org.geomajas.sld.client.SldGwtServiceAsync

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.