Ignore:
Timestamp:
2013-10-27T03:04:38+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #9201 - fix remote control usage examples for handlers with several commands + typo

Location:
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java

    r6091 r6332  
    3333                   buf.append(", ");
    3434               }
    35                String info = RequestProcessor.getHanldlerInfoAsJSON("/"+s);
     35               String info = RequestProcessor.getHandlerInfoAsJSON("/"+s);
    3636               if (info!=null) {
    3737                   buf.append(info);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r6248 r6332  
    8080    @Override
    8181    public String[] getUsageExamples() {
    82         if (command.equals(myCommand)) {
     82        return getUsageExamples(myCommand);
     83    }
     84   
     85    @Override
     86    public String[] getUsageExamples(String cmd) {
     87        if (command.equals(cmd)) {
    8388            return new String[] {
    84                 "/load_and_zoom?addtags=wikipedia:de=Wei%C3%9Fe_Gasse|maxspeed=5&select=way23071688,way23076176,way23076177,&left=13.740&right=13.741&top=51.05&bottom=51.049",
    85                 "/load_and_zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999&new_layer=true"};
     89                    "/load_and_zoom?addtags=wikipedia:de=Wei%C3%9Fe_Gasse|maxspeed=5&select=way23071688,way23076176,way23076177,&left=13.740&right=13.741&top=51.05&bottom=51.049",
     90                    "/load_and_zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999&new_layer=true"};
    8691        } else {
    8792            return new String[] {
    88                 "/zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999"};
    89         }
    90     }
    91    
     93            "/zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999"};
     94        }
     95    }
     96
    9297    @Override
    9398    protected void handleRequest() throws RequestHandlerErrorException
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r6316 r6332  
    116116    public String[] getUsageExamples() {
    117117        return null;
     118    }
     119
     120    /**
     121     * Returns usage examples for the given command. To be overriden only my handlers that define several commands.
     122     * @param cmd The command asked
     123     * @return Usage examples for the given command
     124     * @since 6332
     125     */
     126    public String[] getUsageExamples(String cmd) {
     127        return getUsageExamples();
    118128    }
    119129
Note: See TracChangeset for help on using the changeset viewer.