Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] orion.page.link.related contributions in Orion 5.0

I am curious though about where contributions to the orion.page.link.related extension point should appear.

These now appear in the navigation menu attached to the left-hand margin.
 
Are the conditions for them appearing any different now?

Yes: contributed links need to have a "category" field, which determines which menu item the link appears in. Orion ships with categories "edit", "git", "search", "shell", "sites". If a link doesn't have a category, it does not appear. (In future maybe we might toss uncategorized links into a "miscellaneous" category-- I'm not sure yet.) The same rules apply to "orion.page.link" contributions.

For example here's Orion's Git Status related link:

provider.registerService("orion.page.link.related", null, {
    id: "eclipse.git.status2",
    category: "git",    // Put link in the Git menu
    order: 10,          // Position of this link within the menu. Default is 100
    uriTemplate: "{+OrionHome}/git/git-status.html#{,GitStatusLocation}"
    nameKey: "Git Status",
    tooltipKey: "Go to Git Status",
    nls: "git/nls/gitmessages",
});


Additional categories are defined by "orion.page.link.category" contributions. Categories need to have an imageClass and id at minimum.

provider.registerService("orion.page.link.category", null, {
    id: "git",
    imageClass: "core-sprite-repository", // CSS icon class
    order: 20,   // Position of this category in the navigation menu
    nameKey: "Git",
    nls: "git/nls/gitmessages",
});


Orion tries to emphasize contextually relevant links, so it doesn't render links whose HREF is the same as your current window.location. Individual links can override this with the boolean flag force.

There's also a default flag, which hides a link unless the category would otherwise be empty. This lets us show a consistent set of categories all the time in the menu, but avoids overloading the user with static links when more relevant links are available instead.

I'll spend some time today updating the API docs on the Orion wiki. Due to the huge volume of changes late in 5.0, the docs fell behind.


Mark


On Thu, Mar 13, 2014 at 6:48 PM, Rafael Chaves <rafael@xxxxxxxxxxxx> wrote:
Hi all,

Trying 5.0 for the first time, it is looking great. I am curious though about where
contributions to the orion.page.link.related extension point should appear. Should they still work? Are the conditions for them appearing any different now?

Cheers,

Rafael

_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top