This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
539 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
.idea/* | ||
*.iml | ||
*.ipr | ||
*.iws | ||
target/* | ||
*.zip | ||
.gradle/* | ||
.idea/* | ||
.classPath | ||
.project | ||
.settings/* | ||
bin/* | ||
build/* | ||
lib/* | ||
out/* | ||
*.zip | ||
lib/* | ||
target/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "disabled" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<code_scheme name="Default" version="173"> | ||
<JavaCodeStyleSettings> | ||
<option name="CLASS_NAMES_IN_JAVADOC" value="2" /> | ||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" /> | ||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" /> | ||
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> | ||
<value /> | ||
</option> | ||
</JavaCodeStyleSettings> | ||
</code_scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Fri Jan 12 14:51:45 GMT 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-rc-2-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/aerogear/plugin/intellij/mobile/ui/MobileIcons.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.aerogear.plugin.intellij.mobile.ui; | ||
|
||
import com.intellij.openapi.util.IconLoader; | ||
|
||
import javax.swing.*; | ||
|
||
public class MobileIcons { | ||
public static final Icon FEEDHENRY = IconLoader.getIcon("/icons/fh_icon.png"); | ||
public static final Icon AEROGEAR = IconLoader.getIcon("/icons/aerogear.png"); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/org/aerogear/plugin/intellij/mobile/wizard/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.aerogear.plugin.intellij.mobile.wizard; | ||
|
||
class Constants { | ||
public static final String[] CLIENT_TYPES = new String[]{ | ||
"android", | ||
"cordova", | ||
"iOS" | ||
}; | ||
|
||
public static final String MODULE_ID = "MOBILE_MODULE"; | ||
public static final String MODULE_NAME = "Mobile Client App"; | ||
public static final String MODULE_DESCRIPTION = "Mobile Client App Representation"; | ||
} |
63 changes: 63 additions & 0 deletions
63
src/main/java/org/aerogear/plugin/intellij/mobile/wizard/CreateClientBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.aerogear.plugin.intellij.mobile.wizard; | ||
|
||
import com.intellij.ide.util.projectWizard.ModuleBuilder; | ||
import com.intellij.ide.util.projectWizard.ModuleBuilderListener; | ||
import com.intellij.ide.util.projectWizard.ModuleWizardStep; | ||
import com.intellij.ide.util.projectWizard.WizardContext; | ||
import com.intellij.openapi.Disposable; | ||
import com.intellij.openapi.module.Module; | ||
import com.intellij.openapi.module.ModuleType; | ||
import com.intellij.openapi.options.ConfigurationException; | ||
import com.intellij.openapi.roots.ModifiableRootModel; | ||
import com.intellij.openapi.roots.ui.configuration.ModulesProvider; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
|
||
public class CreateClientBuilder extends ModuleBuilder implements ModuleBuilderListener { | ||
private String commandOutput; | ||
|
||
@Override | ||
public void setupRootModel(ModifiableRootModel modifiableRootModel) throws ConfigurationException { | ||
} | ||
|
||
@Override | ||
public ModuleType getModuleType() { | ||
return CreateClientType.getInstance(); | ||
} | ||
|
||
|
||
@Nullable | ||
@Override | ||
public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable) { | ||
return new CreateClientFirstStep(this); | ||
} | ||
|
||
|
||
@Override | ||
public void moduleCreated(@NotNull Module module) { | ||
//TODO what do we do after the wizard has been created | ||
} | ||
|
||
|
||
@Override | ||
public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider) { | ||
return new ModuleWizardStep[]{new CreateClientSecondStep(this)}; | ||
} | ||
|
||
/** | ||
* returns output of the create client command that was set in first step | ||
* @return output of create client command | ||
*/ | ||
public String getCommandOutput() { | ||
return commandOutput; | ||
} | ||
|
||
/** | ||
* sets commandOutput, used in first step to save the state between two steps. | ||
* @param commandOutput | ||
*/ | ||
public void setCommandOutput(String commandOutput) { | ||
this.commandOutput = commandOutput; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/main/java/org/aerogear/plugin/intellij/mobile/wizard/CreateClientFirstStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package org.aerogear.plugin.intellij.mobile.wizard; | ||
|
||
import com.intellij.ide.util.projectWizard.ModuleWizardStep; | ||
import org.aerogear.plugin.intellij.mobile.api.CLIException; | ||
import org.aerogear.plugin.intellij.mobile.api.CLIRunnerImpl; | ||
import org.aerogear.plugin.intellij.mobile.api.MobileAPI; | ||
import org.aerogear.plugin.intellij.mobile.models.MobileClient; | ||
|
||
import javax.swing.JComponent; | ||
|
||
|
||
class CreateClientFirstStep extends ModuleWizardStep { | ||
private CreateClientForm clientForm; | ||
private CreateClientFormInputs clientFormInputs; | ||
private MobileAPI mobileAPI; | ||
private CreateClientBuilder createClientBuilder; | ||
|
||
|
||
CreateClientFirstStep(CreateClientBuilder createClientBuilder) { | ||
this.createClientBuilder = createClientBuilder; | ||
clientForm = new CreateClientForm(); | ||
mobileAPI = new MobileAPI(new CLIRunnerImpl()); | ||
} | ||
|
||
@Override | ||
public JComponent getComponent() { | ||
return clientForm; | ||
} | ||
|
||
@Override | ||
public void updateDataModel() { | ||
String output; | ||
try { | ||
MobileClient mobileClient = mobileAPI.createClient( | ||
clientFormInputs.getName(), | ||
clientFormInputs.getClientType(), | ||
clientFormInputs.getAppIdentifier() | ||
); | ||
output = mobileClient.getSpec().toString(); | ||
|
||
} catch (CLIException e) { | ||
output = e.getMessage(); | ||
} | ||
createClientBuilder.setCommandOutput(output); | ||
System.out.println(output); | ||
} | ||
|
||
@Override | ||
public boolean validate() { | ||
clientFormInputs = clientForm.getInputs(); | ||
clientForm.resetValidationNotifications(); | ||
boolean validName = true; | ||
boolean validId = true; | ||
|
||
if (clientFormInputs.isInvalidName()) { | ||
clientForm.invalidNameNotify(); | ||
validName = false; | ||
} | ||
|
||
if (clientFormInputs.isInvalidAppIdentifier()) { | ||
clientForm.invalidAppIdNotify(); | ||
validId = false; | ||
} | ||
|
||
return validName && validId; | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
src/main/java/org/aerogear/plugin/intellij/mobile/wizard/CreateClientForm.form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.aerogear.plugin.intellij.mobile.wizard.CreateClientForm"> | ||
<grid id="27dc6" binding="clientPanel" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="0" left="0" bottom="0" right="0"/> | ||
<constraints> | ||
<xy x="20" y="20" width="397" height="179"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none"/> | ||
<children> | ||
<component id="50367" class="javax.swing.JLabel" binding="clientNameLabel"> | ||
<constraints> | ||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<labelFor value="674d1"/> | ||
<text value="Client name"/> | ||
</properties> | ||
</component> | ||
<component id="674d1" class="javax.swing.JTextField" binding="clientNameTxtField"> | ||
<constraints> | ||
<grid row="0" column="1" row-span="3" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> | ||
<preferred-size width="300" height="-1"/> | ||
</grid> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="f995c" class="javax.swing.JLabel" binding="clientTypeLabel"> | ||
<constraints> | ||
<grid row="2" column="0" row-span="3" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<labelFor value="8328c"/> | ||
<text value="Client Type"/> | ||
</properties> | ||
</component> | ||
<component id="8328c" class="javax.swing.JComboBox" binding="clientTypeComboBox" custom-create="true"> | ||
<constraints> | ||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="a0234" class="javax.swing.JLabel" binding="errorLabel"> | ||
<constraints> | ||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value=""/> | ||
</properties> | ||
</component> | ||
<component id="ef699" class="javax.swing.JLabel" binding="errorMessage"> | ||
<constraints> | ||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value=""/> | ||
</properties> | ||
</component> | ||
<component id="54d91" class="javax.swing.JLabel" binding="appIdLabel"> | ||
<constraints> | ||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<labelFor value="496a7"/> | ||
<text value="App Identifier"/> | ||
</properties> | ||
</component> | ||
<component id="496a7" class="javax.swing.JTextField" binding="clientAppIdTxtField"> | ||
<constraints> | ||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> | ||
<preferred-size width="150" height="-1"/> | ||
</grid> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
</children> | ||
</grid> | ||
</form> |
Oops, something went wrong.