[
https://issues.jboss.org/browse/JBIDE-21828?page=com.atlassian.jira.plugi...
]
Viacheslav Kabanovich commented on JBIDE-21828:
-----------------------------------------------
At refresh now deployment mapper flushes - removes all children, sending a lot of events,
then creates new children sending again a lot of events. This is why tree is collapsed, at
stripping the parent node of old children, it forgot about them and there 'expand'
state, and receiving new children it does not recognize in them 'clones' of old
children.
I would suggest the approach that I followed always in doing models for UI. At request to
refresh a substructure of the model, new substracture is created internally in a silent
manner, then merge like oldModelObject.merge(newModelObject, listOfChanges) is done; which
matches objects in the current structure to objects in the new structure, and if match is
found, it just passes merge deeper with these matching old-new objects, doing the best to
avoid removing/creating objects in the current structure (e.g. if one object is to be
removed and one is to be created and they both have not matches, we still can merge new
object to the old!), and along the way collecting changes made during the merge in a
listOfChanges object (it may also be tree-like). When merge is completed, _one_ event is
sent with 'listOfChanges'. When the listener responsible for refreshing the tree
viewer gets this one event, it is sufficient to run once viewer.refresh(parent) for the
parent to all nodes affected, and because most children remain the same instances - tree
will refresh smartly without collapsing nodes.
This is an UI-friendly solution, and it could be good to find a way to apply it to the
openshift UI model.
OpenShift Explorer view flickers when refreshing a service
----------------------------------------------------------
Key: JBIDE-21828
URL:
https://issues.jboss.org/browse/JBIDE-21828
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: openshift
Affects Versions: 4.3.1.Beta2
Reporter: Xavier Coulon
Attachments: Screenshot 2016-03-08 10.32.39.png
When calling the "Refresh" command on a service, the tree view flickers because
of too many refresh calls.
Adding some traces revealed 25 calls to
{{BaseExplorerContentProvider#refreshViewer(Object)}}, which seems way too much for a
service with a single pod.
Attachement: screenshot of the OpenShift Server view, showing 2 projects, one of which
has 3 services.
Custom/added logs in the console:
{code}
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/mongodb
Refreshing viewer from sample/mongodb
Refreshing viewer from sample/mongodb
Refreshing viewer from sample/nodejs-mongodb-example
Refreshing viewer from sample/nodejs-mongodb-example
Refreshing viewer from sample/nodejs-mongodb-example
Refreshing viewer from sample/nodejs-mongodb-example
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/jee-sample
Refreshing viewer from sample/nodejs-mongodb-example
Refreshing viewer from sample/nodejs-mongodb-example
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
Refreshing viewer from
org.jboss.tools.openshift.internal.ui.models.OpenShiftProjectUIModel@431dafbc
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)