Skip to content

Commit 02af11c

Browse files
committed
2 parents 5a4823a + 9995454 commit 02af11c

File tree

19 files changed

+1006
-412
lines changed

19 files changed

+1006
-412
lines changed

src/ServiceStackIDEA/.idea/workspace.xml

Lines changed: 288 additions & 222 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceStackIDEA/META-INF/plugin.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<idea-plugin version="2">
22
<id>net.servicestack.ideaplugin</id>
3-
<name>ServiceStackIDEA</name>
3+
<name>ServiceStack</name>
44
<version>1.0</version>
55
<vendor email="team@servicestack.net" url="https://servicestack.net/">ServiceStack</vendor>
66

77
<description><![CDATA[
8-
Enter short description for your plugin here.<br>
9-
<em>most HTML tags may be used</em>
8+
Integration with ServiceStack Web Services, includes support for Java Add ServiceStack Reference.
109
]]></description>
1110

1211
<change-notes><![CDATA[
13-
Add change notes here.<br>
14-
<em>most HTML tags may be used</em>
12+
1.0 - Initial release.<br>
13+
<em></em>
1514
]]>
1615
</change-notes>
1716

@@ -27,7 +26,7 @@
2726
<extensions defaultExtensionNs="com.intellij">
2827
<!-- Add your extensions here -->
2928
<intentionAction>
30-
<className>UpdateServiceStackReference</className>
29+
<className>UpdateServiceStackReferenceIntention</className>
3130
<category>ServiceStack</category>
3231
<descriptionDirectoryName>ServiceStack</descriptionDirectoryName>
3332
</intentionAction>
@@ -47,5 +46,9 @@
4746
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="NewAction"/>
4847
<keyboard-shortcut keymap="$default" first-keystroke="shift ctrl alt R"/>
4948
</action>
49+
<action id="UpdateServiceStackReference" class="UpdateServiceStackReference" text="Update ServiceStack Reference" icon="/icons/logo-16.png"
50+
description="Updates the selected ServiceStack reference.">
51+
<add-to-group group-id="ProjectViewPopupMenu"/>
52+
</action>
5053
</actions>
5154
</idea-plugin>

src/ServiceStackIDEA/README.MD

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## AndroidStudio ServiceStack Plugin
2+
3+
ServiceStackIDEA is a plugin for AndroidStudio to make working with ServiceStack services easier when building Android apps.
4+
5+
Using this plugin, you can add a ServiceStack reference to your existing Android application which generates required POJOs for interactive with the specific ServiceStack server.
6+
7+
![](https://github.com/ServiceStack/Assets/raw/master/img/servicestackidea/android-context-menu.png)
8+
9+
Once added, the plugin also adds a reference to the ServiceStack.Android library which uses the ServiceStack.Client Java library to to make HTTP requests.
10+
11+
```
12+
AndroidServiceClient client = new AndroidServiceClient("http://techstacks.io");
13+
client.getAsync(new AppOverview(), new AsyncResult<AppOverviewResponse>() {
14+
@Override
15+
public void success(AppOverviewResponse response){
16+
appOverviewResponse = response;
17+
onUpdate(DataType.AppOverview);
18+
}
19+
});
20+
```
21+
22+
This reduces the amount of code required when interacting with ServiceStack web services and also reduces guesswork around request and response types by using the generated POJOs.
23+
24+
![](https://github.com/ServiceStack/Assets/raw/master/img/servicestackidea/android-client-example.gif)
25+
26+
#### Add a ServiceStack Reference
27+
28+
To add a ServiceStack reference, right click on a file or folder inside your project module.
29+
> Alternatively, select the module/package folder/Java file and press **Ctrl+Alt+Shift+R**.
30+
31+
![](https://github.com/ServiceStack/Assets/raw/master/img/servicestackidea/android-dialog.png)
32+
33+
If you right click of an existing Java class (with a package) or package folder, the package field will be populated automatically.
34+
35+
![](https://github.com/ServiceStack/Assets/raw/master/img/servicestackidea/android-dialog-example.gif)
36+
37+
Then provide the base URL to the ServiceStack server. This is usually the domian where your ServiceStack application is hosted.
38+
39+
Also, you can change the required file name for where the POJOs will be stored.
40+
41+
The Java file will then be added to the related package or `/src/main/java` folder of the module. If it has not already been added, the Module's `build.gradle` dependencies will be updated with the `net.servicestack:android` client dependency.
42+
43+
#### Update ServiceStack Reference
44+
45+
Once you have added a ServiceStack reference, it can be easily updated by using AndroidStudio `Intension` shortcut, usually Alt+Enter when in the file.
46+
47+
![](https://github.com/ServiceStack/Assets/raw/master/img/servicestackidea/android-update-example.gif)
48+
49+
This will read all of the used options in the commented file header to generate a new request. This can be handy if the server has been updated and you need to update your client side POJOs, or if you want to include get/set methods by default.
50+
51+
For documentation on all options for both server and client, see the Java Add ServiceStack Reference wiki page.
695 KB
Binary file not shown.

src/ServiceStackIDEA/out/production/ServiceStackIDEA/intentionDescriptions/UpdateServiceStackReference/description.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/ServiceStackIDEA/out/production/ServiceStackIDEA/intentionDescriptions/UpdateServiceStackReference/after.java.template renamed to src/ServiceStackIDEA/out/production/ServiceStackIDEA/intentionDescriptions/UpdateServiceStackReferenceIntention/after.java.template

File renamed without changes.

src/ServiceStackIDEA/out/production/ServiceStackIDEA/intentionDescriptions/UpdateServiceStackReference/before.java.template renamed to src/ServiceStackIDEA/out/production/ServiceStackIDEA/intentionDescriptions/UpdateServiceStackReferenceIntention/before.java.template

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<html>
2+
<body>
3+
Update the current ServiceStack reference.
4+
<!-- tooltip end -->
5+
6+
</body>
7+
</html>

src/ServiceStackIDEA/src/AddRef.form

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<maximumSize width="550" height="220"/>
1010
<minimumSize width="400" height="220"/>
1111
<opaque value="true"/>
12-
<preferredSize width="550" height="220"/>
12+
<preferredSize width="550" height="300"/>
1313
<requestFocusEnabled value="true"/>
1414
</properties>
1515
<border type="none"/>
@@ -65,20 +65,6 @@
6565
</properties>
6666
<border type="none"/>
6767
<children>
68-
<component id="e88c4" class="javax.swing.JTextPane" binding="errorTextPane">
69-
<constraints>
70-
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
71-
<preferred-size width="150" height="50"/>
72-
</grid>
73-
</constraints>
74-
<properties>
75-
<editable value="false"/>
76-
<focusCycleRoot value="false"/>
77-
<focusable value="false"/>
78-
<opaque value="false"/>
79-
<visible value="false"/>
80-
</properties>
81-
</component>
8268
<component id="bc9e3" class="javax.swing.JTextPane" binding="infoTextPane">
8369
<constraints>
8470
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
@@ -95,6 +81,31 @@
9581
<text value="To generate the DTO Service Model types for a specific ServiceStack instance, enter the base URI for the remote ServiceStack server and click OK."/>
9682
</properties>
9783
</component>
84+
<grid id="76624" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
85+
<margin top="0" left="0" bottom="0" right="0"/>
86+
<constraints>
87+
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
88+
</constraints>
89+
<properties/>
90+
<border type="none"/>
91+
<children>
92+
<component id="e88c4" class="javax.swing.JTextPane" binding="errorTextPane">
93+
<constraints>
94+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="2" hsize-policy="2" anchor="0" fill="3" indent="0" use-parent-layout="false">
95+
<preferred-size width="150" height="25"/>
96+
</grid>
97+
</constraints>
98+
<properties>
99+
<editable value="false"/>
100+
<focusCycleRoot value="false"/>
101+
<focusable value="true"/>
102+
<font name="Arial"/>
103+
<opaque value="false"/>
104+
<visible value="false"/>
105+
</properties>
106+
</component>
107+
</children>
108+
</grid>
98109
</children>
99110
</grid>
100111
<grid id="d865d" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

0 commit comments

Comments
 (0)