Add action to Changes view?

I'm investigating whether it's possible to add an action to the Changes view.
In particular, I'd like to add an action to the context menu that appears
when right-clicking on selected file(s) and/or changelist(s). Ideally I'd
also like to add an icon to the LHS of the Changes view too. The key thing
is that my action would need to get hold of what changes have been selected
so it can act accordingly.

I've looked at the ChangeListManager, ChangeProvider, ChangeListDecorator
etc classes, but I can't spot anything suitable. Am I missing something or
does the OpenAPI currently not allow me to do this? If so, would it be possible
to add that functionality to the OpenAPI at some point in the future?

Many thanks,
Chris


7 comments

Hello Chris,

CM> I'm investigating whether it's possible to add an action to the
CM> Changes view. In particular, I'd like to add an action to the
CM> context menu that appears when right-clicking on selected file(s)
CM> and/or changelist(s). Ideally I'd also like to add an icon to the
CM> LHS of the Changes view too. The key thing is that my action would
CM> need to get hold of what changes have been selected so it can act
CM> accordingly.
CM>
CM> I've looked at the ChangeListManager, ChangeProvider,
CM> ChangeListDecorator etc classes, but I can't spot anything suitable.
CM> Am I missing something or does the OpenAPI currently not allow me to
CM> do this? If so, would it be possible to add that functionality to
CM> the OpenAPI at some point in the future?

Right now the set of actions used there is hard-coded. It's definitely a
good idea to make it pluggable.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

OK thanks for the info. I've filed a Jira request:

http://www.jetbrains.net/jira/browse/IDEA-10228

Right now the set of actions used there is hard-coded. It's definitely
a good idea to make it pluggable.



0

+1 I'd like it too for the Changes Bar plugin.

Dmitry Jemerov wrote:

Hello Chris,

CM> I'm investigating whether it's possible to add an action to the
CM> Changes view. In particular, I'd like to add an action to the
CM> context menu that appears when right-clicking on selected file(s)
CM> and/or changelist(s). Ideally I'd also like to add an icon to the
CM> LHS of the Changes view too. The key thing is that my action would
CM> need to get hold of what changes have been selected so it can act
CM> accordingly.
CM> CM> I've looked at the ChangeListManager, ChangeProvider,
CM> ChangeListDecorator etc classes, but I can't spot anything suitable.
CM> Am I missing something or does the OpenAPI currently not allow me to
CM> do this? If so, would it be possible to add that functionality to
CM> the OpenAPI at some point in the future?

Right now the set of actions used there is hard-coded. It's definitely a
good idea to make it pluggable.

0

Hi Dmitry,

I see that you've now added some action groups to allow actions to be plugged in. Many thanks for doing this so quickly, I look forward to the next EAP.

The one thing that (I think?) is still missing is the ability to get a list of changes that have been selected by the user. Eg, in the attached screenshot, I'd like to be able to get a list that contained build.xml, PnlDataRoot.java and VolatilityTable.java. Is that now possible or likely to become possible?

Regards,
Chris

Right now the set of actions used there is hard-coded. It's definitely
a good idea to make it pluggable.



Attachment(s):
changes.PNG
0

Hello Chris,

CM> I see that you've now added some action groups to allow actions to
CM> be plugged in. Many thanks for doing this so quickly, I look forward
CM> to the next EAP.

It won't actually be included in the next EAP. The change will go into version
6.5.

CM> The one thing that (I think?) is still missing is the ability to get
CM> a list of changes that have been selected by the user. Eg, in the
CM> attached screenshot, I'd like to be able to get a list that
CM> contained build.xml, PnlDataRoot.java and VolatilityTable.java. Is
CM> that now possible or likely to become possible?

(Change[]) DataProvider.getData(DataConstants.CHANGES)

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

It won't actually be included in the next EAP. The change will go into
version 6.5.


Ah OK. In that case I'll look forward to the 6.5 EAP starting instead :)

(Change[]) DataProvider.getData(DataConstants.CHANGES)


Thanks, I didn't realise it was available already. In fact I didn't even
know about the whole DataProvider/DataConstants API so thanks kindly for
the pointer. As you can tell I'm still very new to the OpenAPI so still have
a fair bit to learn but hopefully I'll get there eventually...

Regards,
Chris


0

Hello Chris,

CM> Thanks, I didn't realise it was available already. In fact I didn't
CM> even know about the whole DataProvider/DataConstants API so thanks
CM> kindly for the pointer. As you can tell I'm still very new to the
CM> OpenAPI so still have a fair bit to learn but hopefully I'll get
CM> there eventually...

The DataProvider API is covered in the basic documentation that we provide:
http://www.jetbrains.com/idea/plugins/plugin_developers.html

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.