[jbosstools-issues] [JBoss JIRA] (JBIDE-21755) "Eager-er" loading of the project properties
Viacheslav Kabanovich (JIRA)
issues at jboss.org
Thu Feb 25 21:33:00 EST 2016
[ https://issues.jboss.org/browse/JBIDE-21755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168697#comment-13168697 ]
Viacheslav Kabanovich commented on JBIDE-21755:
-----------------------------------------------
I have a simple solution for 'autoloading' which may have side effects, so that I put it here as snippet, not a PR:
Replace method inputChanged() in org.jboss.tools.openshift.internal.common.ui.explorer.BaseExplorerContentProvider with this code:
{code}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if(this.viewer != null) {
this.viewer.removeSelectionChangedListener(selectionListener);
}
this.viewer = (TreeViewer) viewer;
if(this.viewer != null) {
this.viewer.addSelectionChangedListener(selectionListener);
}
if(input != null && connectionListener != null) {
input.removeListener(connectionListener);
}
if(newInput instanceof ConnectionsRegistry) {
input = (ConnectionsRegistry) newInput;
if(connectionListener != null) {
input.addListener(connectionListener);
}
}
}
SelectionListener selectionListener = new SelectionListener();
class SelectionListener implements ISelectionChangedListener {
@Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection s = event.getSelection();
if(!s.isEmpty() && s instanceof IStructuredSelection) {
IStructuredSelection st = (IStructuredSelection)s;
final Object o = st.getFirstElement();
if(o instanceof IConnection) {
return;
}
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
TreeViewer v = BaseExplorerContentProvider.this.viewer;
if(v != null && v.getControl() != null && !v.getControl().isDisposed()) {
boolean b = v.getExpandedState(o);
if(!b) {
v.setExpandedState(o, true);
v.setExpandedState(o, false);
}
}
}
});
}
}
}
{code}
> "Eager-er" loading of the project properties
> --------------------------------------------
>
> Key: JBIDE-21755
> URL: https://issues.jboss.org/browse/JBIDE-21755
> Project: Tools (JBoss Tools)
> Issue Type: Enhancement
> Components: openshift
> Affects Versions: 4.3.1.Beta2
> Reporter: Xavier Coulon
>
> Once I logged in the OpenShift Explorer, if I expand the connection and select my project, all tables on the tabbed properties view are empty. I need to expand the project in the OpenShift Explorer view to trigger a loading which then allows for displaying the data in the properties view. This is somehow confusing because the user may think that the OpenShift project is empty.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jbosstools-issues
mailing list