Changes in 1.1.11
42 |
- fix for https://github.com/magnetsystems/r2m-plugin-android/issues/29
43 |
Changes in 1.1.10
44 |
- bring "close Add rest api" window to the front.
45 |
Changes in 1.1.9
46 |
- UI cosmetics
47 |
- lazily create .rest2mobile
48 |
- fixed https://github.com/magnetsystems/r2m-plugin-android/issues/23
49 |
- fixed https://github.com/magnetsystems/r2m-plugin-android/issues/22
50 |
- fixed https://github.com/magnetsystems/r2m-plugin-android/issues/4
51 |
Changes in 1.1.8
52 |
- Fix https://github.com/magnetsystems/r2m-plugin-android/issues/26
53 |
Changes in 1.1.7
54 |
- Fix https://github.com/magnetsystems/r2m-plugin-android/issues/27
55 |
Changes in 1.1.6
56 |
- Fix https://github.com/magnetsystems/r2m-sdk-android/issues/5
57 |
Changes in 1.1.5
58 |
- Fix https://github.com/magnetsystems/r2m-sdk-android/issues/4
59 |
Changes from 1.1.0
60 |
- Automatically show generated controller class after generation
61 |
- Show gradle snippet explaining how to include R2M dependencies
62 |
- Fix URL encoding issue
63 |
- Fix NPE in URLSection
64 | ]]>
65 |
key
33 | * @return the localized message, if found, otherwise BUNDLE_NOT_FOUND, if bundle is not found, or MESSAGE_NOT_FOUND
34 | * if the message for key key
is not found in bundle
35 | */
36 | static String getMessage(String bundleName, String key, Object... args) {
37 | ResourceBundle resourceBundle = getBundle(bundleName);
38 | if (null == resourceBundle) {
39 | return "BUNDLE_NOT_FOUND(" + bundleName + ")";
40 | }
41 | String message = null;
42 | try {
43 | message = resourceBundle.getString(key);
44 | } catch (Exception e) {
45 | // eat it
46 | }
47 | if (null == message) {
48 | return "MESSAGE_NOT_FOUND($bundleName, " + key + ", " + args + ")";
49 | }
50 | return MessageFormat.format(message, args);
51 | }
52 |
53 | /**
54 | * Utility method to retrieve the resource bundle
55 | * @param bundleName name of the resource bundle
56 | * @return bundle or null if none found
57 | */
58 | static ResourceBundle getBundle(String bundleName) {
59 | ResourceBundle res = null;
60 | try {
61 | res = ResourceBundle.getBundle(bundleName);
62 | } catch (Exception e) {
63 | // eat it
64 | }
65 | return res;
66 | }
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/com/magnet/plugin/r2m/messages/R2MMessages.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Magnet Systems, Inc.
3 | * All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you
6 | * may not use this file except in compliance with the License. You
7 | * may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 | * implied. See the License for the specific language governing
15 | * permissions and limitations under the License.
16 | */
17 |
18 | package com.magnet.plugin.r2m.messages;
19 |
20 | /**
21 | * Placeholder for retrieving all L10N messages
22 | *
23 | */
24 | public class R2MMessages {
25 | /**
26 | * @param key constant identifying L10n message
27 | * @param args arguments to be expanded in L10n message
28 | * @return expanded L10n message given its key and arguments
29 | */
30 | public static String getMessage(String key, Object... args) {
31 | return MessagesSupport.getMessage("r2m/r2m", key, args);
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/magnet/plugin/r2m/models/ControllerHistory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Magnet Systems, Inc.
3 | * All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you
6 | * may not use this file except in compliance with the License. You
7 | * may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 | * implied. See the License for the specific language governing
15 | * permissions and limitations under the License.
16 | */
17 |
18 | package com.magnet.plugin.r2m.models;
19 |
20 | import com.intellij.openapi.project.Project;
21 | import com.magnet.plugin.r2m.project.CacheManager;
22 |
23 | import java.io.File;
24 | import java.io.FileFilter;
25 | import java.util.ArrayList;
26 | import java.util.Collections;
27 | import java.util.List;
28 |
29 | /**
30 | * Cache holding all controllers used in this project
31 | */
32 | public class ControllerHistory {
33 | private final Project project;
34 | private List