Create a new element in a context? [message #668769] |
Sat, 07 May 2011 09:49 |
Manuel Doninger Messages: 119 Registered: October 2010 |
Senior Member |
|
|
Hi,
how do i manually create and assign a new element to an active context, if it is not a file in the workspace (like the bookmarks in Tasktop Pro)? The reason is, i want to store some task related configurations for EGit in the task context, but so far i couldn't find the right thing in the Mylyn API.
I thought about something like
List<InteractionContextElement> nodes = new ArrayList<InteractionContextElement>();
InteractionContextElement node = new InteractionContextElement(
"meta/setting", "egitbranchsetting", (InteractionContext) activeContext); //$NON-NLS-1$ //$NON-NLS-2$
nodes.add(node);
IInteractionElement newElement = new CompositeContextElement(
"egitbranchsetting", nodes, activeContext.getScaling()); //$NON-NLS-1$
activeContext.getAllElements().add(newElement);
but i don't know, if this is right.
The configuration i want to store would be a list of Strings representing Git repositories, and a String representing a branch in that repositories.
|
|
|
(no subject) [message #671354 is a reply to message #668769] |
Tue, 17 May 2011 15:29 |
Steffen Pingel Messages: 706 Registered: July 2009 |
Senior Member |
|
|
Thanks for raising that and filing a bug. For anyone interested, please join
the discussion on this bug:
345661: API for storing task based SCM configuration in the Mylyn context
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345661
Steffen
Manuel Doninger wrote:
> Hi,
> how do i manually create and assign a new element to an
> active context, if it is not a file in the workspace (like
> the bookmarks in Tasktop Pro)? The reason is, i want to
> store some task related configurations for EGit in the task
> context, but so far i couldn't find the right thing in the
> Mylyn API.
>
> I thought about something like
>
> List<InteractionContextElement> nodes = new
> ArrayList<InteractionContextElement>();
> InteractionContextElement node = new
> InteractionContextElement(
> "meta/setting", "egitbranchsetting",
> (InteractionContext) activeContext); //$NON-NLS-1$
> //$NON-NLS-2$
> nodes.add(node);
> IInteractionElement newElement = new
> CompositeContextElement(
> "egitbranchsetting", nodes, activeContext.getScaling());
> //$NON-NLS-1$
> activeContext.getAllElements().add(newElement);
>
> but i don't know, if this is right.
>
> The configuration i want to store would be a list of Strings
> representing Git repositories, and a String representing a
> branch in that repositories.
--
Steffen Pingel
Committer, http://eclipse.org/mylyn
Senior Developer, http://tasktop.com
|
|
|
|
Powered by
FUDForum. Page generated in 0.05357 seconds