Package org.geomajas.gwt.client.command

Examples of org.geomajas.gwt.client.command.CommandCallback


    GwtCommand commandRequest = new GwtCommand(RasterizeMapRequest.COMMAND);
    RasterizeMapRequest request = new RasterizeMapRequest();
    request.setClientMapInfo(map.getMapModel().getMapInfo());
    commandRequest.setCommandRequest(request);
    final ImageUrlCallback callBack = imageCallBack;
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof RasterizeMapResponse) {
          RasterizeMapResponse rasterizeMapResponse = (RasterizeMapResponse) commandResponse;
          callBack.onImageUrl(toUrl(rasterizeMapResponse.getMapKey()),
View Full Code Here


      exportRequest.setQuoteChar(messages.exportToCsvQuoteChar());
      exportRequest.setLayerId(layer.getServerLayerId());

      GwtCommand command = new GwtCommand(ExportToCsvRequest.COMMAND);
      command.setCommandRequest(exportRequest);
      Deferred deferred = GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
        private static final String CONTENT_PRE = "<div style='margin-top: 20px; width: 200px; text-align: "
            + "center'><b>";
        private static final String CONTENT_POST = "</b><br />";
        private static final String LINK_POST = "</div>";
View Full Code Here

    getMapButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        GwtCommand commandRequest = new GwtCommand(GetMapConfigurationRequest.COMMAND);
        commandRequest.setCommandRequest(new GetMapConfigurationRequest("mapOsm", "gwt-samples"));
        GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

          public void execute(CommandResponse response) {
            SC.say("Command executed successfully");
          }
        });
      }
    });
    commandLayout.addMember(getMapButton);

    // Create a button that calls the GetMapConfigurationCommand:
    IButton getResourcesButton = new IButton("command.GetResources");
    getResourcesButton.setWidth(150);
    getResourcesButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        GetResourcesRequest request = new GetResourcesRequest(
            new String[] { "WEB-INF/security.xml" });
        GwtCommand command = new GwtCommand("example.gwt.server.samples.GetSourceCommand");
        command.setCommandRequest(request);
        GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

          public void execute(CommandResponse response) {
            // User mark should never get here...
            SC.say("Command executed successfully");
          }
View Full Code Here

    editFeatureButton.setWidth(200);
    editFeatureButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        layer = (VectorLayer) map.getMapModel().getLayer("clientLayerBeans");
        GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

          public void execute(CommandResponse response) {
            if (response instanceof SearchFeatureResponse) {
              SearchFeatureResponse resp = (SearchFeatureResponse) response;
              for (org.geomajas.layer.feature.Feature dtoFeature : resp.getFeatures()) {
View Full Code Here

    // Create the command, with the correct Spring bean name:
    GwtCommand command = new GwtCommand("command.MySuperDoIt");
    command.setCommandRequest(commandRequest);

    // Execute the command, and do something with the response:
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

      public void execute(CommandResponse response) {
        // Command returned successfully. Do something with the result.
      }
    });
View Full Code Here

  }

  public static void getSearchFavourites(final DataCallback<List<SearchFavourite>> onFinished) {
    GwtCommand command = new GwtCommand(GetSearchFavouritesRequest.COMMAND);
    command.setCommandRequest(new GetSearchFavouritesRequest());
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof GetSearchFavouritesResponse) {
          GetSearchFavouritesResponse resp = (GetSearchFavouritesResponse) response;
          if (onFinished != null) {
            int size = resp.getPrivateSearchFavourites().size() + resp.getSharedSearchFavourites().size();
View Full Code Here

  public static void saveSearchFavourite(SearchFavourite sf, final DataCallback<SearchFavourite> onFinished) {
    SaveSearchFavouriteRequest ssfr = new SaveSearchFavouriteRequest();
    ssfr.setSearchFavourite(sf);
    GwtCommand command = new GwtCommand(SaveSearchFavouriteRequest.COMMAND);
    command.setCommandRequest(ssfr);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof SaveSearchFavouriteResponse) {
          SaveSearchFavouriteResponse resp = (SaveSearchFavouriteResponse) response;
          if (onFinished != null) {
            onFinished.execute(resp.getSearchFavourite());
View Full Code Here

  public static void deleteSearchFavourite(SearchFavourite sf, final DataCallback<Boolean> onFinished) {
    DeleteSearchFavouriteRequest dsfr = new DeleteSearchFavouriteRequest();
    dsfr.setSearchFavouriteId(sf.getId());
    GwtCommand command = new GwtCommand(DeleteSearchFavouriteRequest.COMMAND);
    command.setCommandRequest(dsfr);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof SuccessCommandResponse) {
          SuccessCommandResponse resp = (SuccessCommandResponse) response;
          if (onFinished != null) {
            onFinished.execute(resp.isSuccess());
View Full Code Here

    request.setBuffer(buffer);
    request.setGeometries(toDtoGeometries(geometries));

    GwtCommand command = new GwtCommand(GeometryUtilsRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof GeometryUtilsResponse) {
          GeometryUtilsResponse resp = (GeometryUtilsResponse) response;
          if (onFinished != null) {
            Geometry[] geoms = new Geometry[2];
View Full Code Here

    request.setActionFlags(GeometryUtilsRequest.ACTION_MERGE);
    request.setGeometries(toDtoGeometries(geometries));

    GwtCommand command = new GwtCommand(GeometryUtilsRequest.COMMAND);
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
      public void execute(CommandResponse response) {
        if (response instanceof GeometryUtilsResponse) {
          GeometryUtilsResponse resp = (GeometryUtilsResponse) response;
          if (onFinished != null) {
            onFinished.execute(GeometryConverter.toGwt(resp.getGeometries()[0]));
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.command.CommandCallback

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.