-
Notifications
You must be signed in to change notification settings - Fork 27
tmf: Expose state system through data provider factory #325
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
Conversation
|
|
||
| static { | ||
| ImmutableMap.Builder<@NonNull String, @NonNull OutputElementStyle> builder = new ImmutableMap.Builder<>(); | ||
| IPaletteProvider fPalette = new RotatingPaletteProvider.Builder().setNbColors(NUM_COLORS).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-prefix is to indentify class variables. For local variables it would just be 'palette'.
| builder.put(key, outputStyle); | ||
| } | ||
|
|
||
| Map<String, Object> fMapUNKOWN = ImmutableMap.of(StyleProperties.BACKGROUND_COLOR, COLOR_UNKOWN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be 'unknown' but you could just inline it into the constructor below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling mistake. I got it now.
...org/eclipse/tracecompass/internal/tmf/core/statesystem/provider/StateSystemDataProvider.java
Show resolved
Hide resolved
| Status status = fetchTreeIsComplete ? Status.COMPLETED : Status.RUNNING; | ||
| String msg = fetchTreeIsComplete ? CommonStatusMessage.COMPLETED : CommonStatusMessage.RUNNING; | ||
| return new TmfModelResponse<>(new TmfTreeModel<>(Collections.emptyList(), entryList), status, msg); | ||
| TmfTreeModel<TimeGraphEntryModel> treeModel = new TmfTreeModel<>(Collections.emptyList(), entryList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should create two headers inspired by TmfStateSystemExplorer.COLUMN_NAMES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then in AttributeEntryModel constructor, the labels passed to super constructor should be a list of [ name, quark ]
| Status status = fetchTreeIsComplete ? Status.COMPLETED : Status.RUNNING; | ||
| String msg = fetchTreeIsComplete ? CommonStatusMessage.COMPLETED : CommonStatusMessage.RUNNING; | ||
| TmfTreeModel<TimeGraphEntryModel> treeModel = new TmfTreeModel<>(Collections.emptyList(), entryList); | ||
| TmfTreeModel<TimeGraphEntryModel> treeModel = new TmfTreeModel<>( new ArrayList<>(Arrays.asList( Messages.TreeNodeColumnLabel, Messages.QuarkColumnLabel)), entryList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapping into ArrayList not necessary, Arrays.asList() does the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the AttributeEntryModel constructor, both column values should be passed as the label list to the super constructor.
| Map<String, Object> fMapUNKOWN = ImmutableMap.of(StyleProperties.BACKGROUND_COLOR, COLOR_UNKOWN); | ||
| OutputElementStyle unknownoutputStyle = new OutputElementStyle(null, fMapUNKOWN); | ||
| builder.put(UNKNOWN, unknownoutputStyle); | ||
| builder.put( UNKNOWN , new OutputElementStyle(null, ImmutableMap.of(StyleProperties.BACKGROUND_COLOR, COLOR_UNKNOWN))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a TRANSPARENT style with 0.0f opacity and use for the blank states added to module and state system entries. This will prevent the default white color to be used by the web client.
PatrickTasse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix commit header and message to match the PR's header and description.
In both, fix 'auto scale level' to 'autoexpand level'.
732cce3 to
efdfa61
Compare
bhufmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Please fix your ECA setup so that he eclipse foundation check is successful. Please also add you signed-off to the commit message. Please update the commit message to with a description what is done and remove list of previous commit titles.
As a follow-up PR, I suggest working on refreshing the analysis available when opening the view (fetchTree). Right now only state systems are shown that had been opened before the state system explorer is opened the first time. Note, whenever a view is opened a new state system might opened or create. Opening the state system explorer should include those.
1bcb937 to
8679a5e
Compare
It exposes StateSystemDataProvider through StateSystemDataProviderFactory Adds DESCRIPTOR for the clients Sets autoexpand level to 1 Implements fetchStyle Improves tests of all data providers Signed-off-by: Yassine Ibhir <[email protected]>
bhufmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
What it does
How to test
Follow-ups
Make sure that view is updated when new analysis is executed (maybe refresh view when another view is executed). TBD.
Review checklist