Skip to content

[FEATURE] Adds category group #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ public DynamicGenericNodeSetFactory() {
public abstract IPluginConfiguration getPluginConfig();

protected abstract String getCategoryPath();


/**
* Add additional grouping in category independent of CTD category
* definition and after the plugin version. This can be useful if a single
* plugin contains sources from multiple projects.
*
* @return String with the name of the group. Use null to omit the category
* group.
*/
protected abstract String getCategoryGroup();

protected abstract String getIdForTool(String relPath);

@Override
Expand Down Expand Up @@ -77,6 +87,10 @@ public String getCategoryPath(String id) {
logger.error("Could not read node category from CTD, using '/' instead.", e);
category = "";
}
String categoryGroup = getCategoryGroup();
if (categoryGroup != null)
category = categoryGroup + "/" + category;

return getCategoryPath() + "/" + getPluginConfig().getPluginVersion() + "/" + category;
}

Expand Down