NOTE THIS IS A TRANSLATED COPY OF 中文文档, MAY OUT OF DATE.
Thanks for XieEDeHeiShou
A plugin that designed for Intellij IDEA
and Android Studio
, used to generate Mvp interfaces and classes.
Issue Report
welcomed, Feature Request
welcomed, Pull Request
welcomed
Contract
mode:
Presenter
mode(with suffix 'Impl'):
Suffix support:
Log (unexpected balloon may appear, just disable it in the Event Log):
Error dialog:
For Mvp, define an interface Contract
to place Model
, View
, Presenter
will greatly reduce the number of source files:
public interface GoodsInfoContract {
interface View {
}
interface Presenter {
}
interface Model {
}
}
Download MvpHelper_v2_3_release.jar or redirect to releases
Install it.
In Contract
or Presenter
,click Generate
menu or try hot-key Alt + Insert
,
select Mvp Helper
.
- Remove hot-key
Meta + 1
- MvpHelper menu will not appear in un-java files when use hot key
Alt + Insert
- No more root package limit (v1.0 only support com,org,me...)
- No more
contract
package location limit, and support sub-package:com.example.project.package1.contract.package2.AContract
will generatecom.example.project.package1.model.package2.AModel
andcom.example.project.package1.presenter.package2.APresenter
- While
AContract
underpresenter
package, an error dialog will occur.(used to generate wrong files) - Support File Header Template
Contract
mode achievedContract
MUST under a path witch has at least one package END WITHcontract
- Force
Contract
to be apublic interface
- Remove unnecessary modifier form inner interfaces of
Contract
- Re-generate will delete old files then generate new files.
Presenter
mode achievedPresenter
MUST under a path witch has at least one package END WITHpresenter
- When launch with
Presenter
mode, it will callContract
mode later. - When launch with
Presenter
mode with custom suffix, the oldPresenter
, which without suffix, will not be delete automatically. So we recommendContract
mode.
- Achieve
Activity
mode - Achieve
Fragment
mode - Add generated files to git automatically (may take long time to learn command grammar of git)
- Intellij Platform SDK DevGuide
- Persisting State of Components How to save and load plugin configs
- Customizing the IDEA Settings Dialog
- IDEA Online Source Code
- ApplicationConfigurable, ProjectConfigurable
- PersistStateComponent
- Java Api Sample
- Moxun's bolg (Chinese blog)
- AndroidStudio/IDEA插件开发学习 (Chinese blog)
v2.x -Based on Intellij Open Api, by XieEDeHeiShou
- 2017-07-19
- Fix NPE(#20)
- MvpHelper_v2_3_release.jar
- 2017-04-27
- Fix generated class modifier bug:package-private -> public
- Add EventLogger
- MvpHelper_v2_2_release.jar
- 2017-04-25
- Save and load configurations.
- Load config while running.
- MvpHelper_v2_0_release.jar
- Add guide.gif
- Pull request to Original Repo
- Test under Android Studio Environment with Java project and Android project
- Fix bug caused by merge: generated
Contract
losepublic
modifier, force to bepublic interface PrefixContract
- Fix
AbstractMethodException
caused by platform resource release - MvpHelper_v2_1_release.jar
- 2017-04-24
- Layout config panel
- Achieve
PresenterModeDirGenerator
- Extract interface, re-package
- Change the way to update
Contract
- force
Contract
to beinterface
- Remove unnecessary modifier form inner interfaces of
Contract
- force
- 2017-04-23
- Achieve file generation , package inject, support File Head Template
- Achieve generated class implement special interface
- Update README.CN.MD(Removed later)
- 2017-04-15 Update Environment check rule
- 2017-04-12 Achieve plugin visibility control, when launched by hot-key
Alt + Insert
,if current file is not a javaFile.java, the plugin menu will be invisible. - 2017-04-11 Achieve
DirGenerator
andFileGenerator
used to generate dirs and files - 2017-04-10 Achieve
EnvironmentChecker
used to check plugin runtime condition:- Is the document END WITH
Contract
and UNDER acontract
package - Is the document END WITH
Presneter
and UNDER apresenter
package
- Is the document END WITH
v1.x -Based on Java IO Api, by githubwing
- 2017-04-10 Try to rebuild the project with Intellij Open Api.
- 2017-04-09 Remove
C
smell form original source code. - 2017-04-06 Fork form original repe, add comment lines for reading.
Copyright 2016 androidwing1992
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.