Skip to content
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

Configuration flag for deactivating an annex #2288

Closed
jjhugues opened this issue Apr 17, 2020 · 8 comments · Fixed by #2561 or #2643
Closed

Configuration flag for deactivating an annex #2288

jjhugues opened this issue Apr 17, 2020 · 8 comments · Fixed by #2561 or #2643
Assignees
Milestone

Comments

@jjhugues
Copy link
Contributor

In some cases, one may want to deactivate an annex from the regular parsing phase. For instance apply analyses that do not depend on them

One may imagine a configuration parameter for that, that would simply deactivate the corresponding registered parser

An open question could be: how about analysis? We could have a warning if EMV2 is disabled when trying to run FHA or FTA

@lwrage
Copy link
Contributor

lwrage commented Jan 15, 2021

We need the following:

  • A preference dialog that lists the installed annexes with a checkbox that allows deselecting the annex
  • Modification of parser, validator, etc, to check is processing of some annex is disabled.

@asazonova
Copy link
Contributor

@jjhugues did you intend the flag to be project specific (project A can use annex B, but project C can NOT use annex B) or is the flag should be applied to all projects (if annex B flag is unchecked, then it can NOT be used in project A and project C)

@asazonova
Copy link
Contributor

@AaronGreenhouse Do you know if it is possible to access preferences from stand alone java programs (jar files) that you can run from command line to process aadl file?

@yoogx
Copy link

yoogx commented Jan 19, 2021

The flag should be project specific

@AaronGreenhouse
Copy link
Contributor

@asazonova I don't know for sure, but I think it would probably work. The core Workspace preference and project properties data structures are not UI-specific.

@asazonova
Copy link
Contributor

@lwrage

for workspace preference, we use final IPreferenceStore store = OsateCorePlugin.getDefault().getPreferenceStore();
for project preference, we use
final IScopeContext context = new ProjectScope(project);
final Preferences prefs = context.getNode(PREFS_QUALIFIER);

This Preferences prefs object does not have a method to set a default value. However, unlike workspace preference, for projects we set the preference explicitly with prefs.putBoolean(annexExtensionId.toLowerCase(), value); - see implementation below:
@OverRide
public void putBoolean(String key, boolean value) {
wrapped.putBoolean(key, value);
}

this one does not have a check if oldValue == newValue, which is good for us, it will just set the preference to false without ignoring it

Conclusion,

  • workspace preference has a default of true and only resets the value if it has changed. Here, setting a default value guarantees that we can turn off the preference and it will be set to false.
  • project preference does not have a default value, but it is capable of setting a value to false on first try. So if the value is set, then we can use that, if the value is not set then we use 'true' as a preference is turned on (this also assumes that the flag 'use project preferences' is turned on for this specific project)

@asazonova
Copy link
Contributor

Add screenshots and explanation how to use this feature to Advanced section of help (org.osate.help)

@lwrage lwrage reopened this Mar 4, 2021
@lwrage
Copy link
Contributor

lwrage commented Mar 4, 2021

  • Help text is not visible in product
  • Screenshots for help need to be updated
  • Verify that annex names are sorted for display in preference dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment