Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
IntelliJ Plugin 開発で実装したこと
Search
Takahiro Shimokawa
September 15, 2015
Programming
0
440
IntelliJ Plugin 開発で実装したこと
IntelliJ Plugin開発をしている中で学んだことをまとめました
Takahiro Shimokawa
September 15, 2015
Tweet
Share
More Decks by Takahiro Shimokawa
See All by Takahiro Shimokawa
PlayStoreでの新しいユーザー訴求 -LiveOpsの活用とその成果-
androhi
0
2.3k
ConcatAdapterを深掘る
androhi
1
360
Android Studio 4.1推しポイント!
androhi
0
1.2k
一人開発でつまづいたときの処方箋
androhi
0
290
Androidの物理ベースアニメーション
androhi
1
550
ConstraintLayout再入門
androhi
2
3.4k
Firebase Analytics 使用感
androhi
0
850
Support Library v23.2 overview
androhi
0
640
Support Library 総復習
androhi
2
2.4k
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
5
1.5k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Ethereum_.pdf
nekomatu
0
470
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
360
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Better Code Design in PHP
afilina
PRO
0
130
みんなでプロポーザルを書いてみた
yuriko1211
0
280
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Vapor Revolution
kazupon
1
140
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Designing for humans not robots
tammielis
250
25k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Build your cross-platform service in a week with App Engine
jlugia
229
18k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
BBQ
matthewcrist
85
9.3k
KATA
mclloyd
29
14k
Transcript
IntelliJ(Plugin(։ൃͰ࣮ͨ͜͠ͱ androhi(at(IntelliJ(Plugin(ษڧձ(#2
࡞ͬͨ!Plugin • Android(Drawable(Viewer • 1,300(DL͑ͨ • ॳ(Android(Arsenal • ॳ(Pull(Request((shiraji(͞Μ)
࣮ͨ͜͠ͱ • ToolWindow • FactoryΫϥε • setToolbarϝιου • setContentϝιου •
refresh?
ToolWindow)*)extensions plugin.xml <idea-plugin version="2"> <extensions defaultExtensionNs="com.intellij"> <!-- Add your extensions
here --> <toolWindow anchor="right" canCloseContents="true" id="DrawableViewer" factoryClass="xxx.AndroidDrawableViewerToolWindowFactory" /> ... </extensions> ...
ToolWindow)*)ToolWindowFactory AndroidDrawableViewerToolWindowFactory public class AndroidDrawableViewerToolWindowFactory implements ToolWindowFactory { @Override public
void createToolWindowContent(Project project, ToolWindow toolWindow) { DrawableViewer viewer = new DrawableViewer(project); final ContentManager contentManager = toolWindow.getContentManager(); final Content content = contentManager.getFactory().createContent(viewer, null, false); contentManager.addContent(content); } }
ToolWindow)*)SimpleToolWindowPanel DrawableViewer public class DrawableViewer extends SimpleToolWindowPanel implements ActionListener {
public DrawableViewer(final Project project) { super(true, true); ... setToolbar(createToolbarPanel()); setContent(createContentPanel()); } ...
ToolWindow)ͷߏ
ToolWindow)*)setToolbar(JComponent) private JComponent createToolbarPanel() { final DefaultActionGroup actionGroup = new
DefaultActionGroup(); actionGroup.add(new EditTargetResDirAction()); final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar( "AndroidDrawableViewer", actionGroup, true); return actionToolbar.getComponent(); }
ToolWindow)*)setContent(JComponent) private JScrollPane createContentPanel() { ... itemList = new JBList(panels);
... return ScrollPaneFactory.createScrollPane(itemList); }
ToolWindow)*)refresh? Se#ngsDialog @Override protected void doOKAction() { super.doOKAction(); ... resetContent(project);
} private void resetContent(Project project) { DrawableViewer drawableViewer = new DrawableViewer(project); ContentManager contentManager = ToolWindowManager.getInstance(project) .getToolWindow(Constants.TOOL_WINDOW_ID).getContentManager(); Content content = contentManager.getFactory().createContent(drawableViewer, null, false); contentManager.removeAllContents(true); contentManager.addContent(content); } ...
ToolWindow)·ͱΊ • anchor(Ͱࢦఆͨ͠ॴʹৗறͰ͖Δίϯϙʔωϯτ • Toolbar(ͱ(Content(Ͱߏ͞Ε͍ͯΔ • ToolWindow(Λߋ৽͢Δʹ࠶ੜ͢Δ͔͠ͳ͍ʢʁʣ