How to get the "current selected change-list" (not the default one)?

Hi all,

I'm building a plugin that involves analyzing a version control change-list (or rather - a collection of Change events).
Everything works well as long as I'm content in using the default change list, which I can get by


        final DataContext dataContext = DataManager.getInstance().getDataContext();
        final Project project = DataKeys.PROJECT.getData(dataContext);

        final ChangeListManager manager = ChangeListManager.getInstance(project);
        final Collection<Change> changes = manager.getDefaultChangeList().getChanges();


How can I get the "current selected" change-list instead?
Note - I'm working inside an "action", so I have access to the action event object.

Thanks,
Ran.

4 comments
Comment actions Permalink

Hello Ran,

This changelist is in fact the active changelist. The method name is confusing
here.

I'm building a plugin that involves analyzing a version control
change-list (or rather - a collection of Change events).

Everything works well as long as I'm content in using the default
change list, which I can get by

 final DataContext dataContext =
> DataManager.getInstance().getDataContext();
> final Project project = DataKeys.PROJECT.getData(dataContext);
> final ChangeListManager manager =
> ChangeListManager.getInstance(project);
> final Collection changes =
> manager.getDefaultChangeList().getChanges();
> ]]>

How can I get the "current selected" change-list instead? Note - I'm
working inside an "action", so I have access to the action event
object.


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


0
Comment actions Permalink

Dmitry,

I know it's the current change list - I want the "selected" change list (the one I've right-clicked on, not the "active" one).

Thanks,
Ran.

0
Comment actions Permalink

Hello Ran,

e.getData(VcsDataKeys.CHANGE_LISTS)

I know it's the current change list - I want the "selected" change
list (the one I've right-clicked on, not the "active" one).


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


0
Comment actions Permalink

Works perfectly.
Thanks.
Ran.

0

Please sign in to leave a comment.