Search in sources :

Example 1 with AbstractEndpointNode

use of org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode in project ecf by eclipse.

the class EndpointDiscoveryView method handleRSAEent.

public void handleRSAEent(RemoteServiceAdminEvent event) {
    final int type = event.getType();
    Throwable t = event.getException();
    if (t == null) {
        TreeViewer treeViewer = this.viewer;
        if (treeViewer == null)
            return;
        switch(type) {
            case RemoteServiceAdminEvent.IMPORT_UNREGISTRATION:
                final ImportReference ir = (ImportReference) event.getImportReference();
                if (ir != null) {
                    treeViewer.getControl().getDisplay().asyncExec(new Runnable() {

                        @Override
                        public void run() {
                            EndpointGroupNode egn = contentProvider.getRootNode();
                            for (AbstractEndpointNode aen : egn.getChildren()) {
                                if (aen instanceof EndpointNode) {
                                    EndpointNode en = (EndpointNode) aen;
                                    ImportReference iRef = en.getImportReference();
                                    if (iRef != null && iRef.equals(ir))
                                        en.setImportReference(null);
                                }
                            }
                            viewer.refresh();
                        }
                    });
                }
                break;
        }
    }
}
Also used : ImportReference(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference) EndpointNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointNode) AbstractEndpointNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode) TreeViewer(org.eclipse.jface.viewers.TreeViewer) EndpointGroupNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointGroupNode) AbstractEndpointNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode)

Example 2 with AbstractEndpointNode

use of org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode in project ecf by eclipse.

the class EndpointDiscoveryView method findEndpointNode.

EndpointNode findEndpointNode(final ImportReference ir) {
    EndpointGroupNode egn = contentProvider.getRootNode();
    for (AbstractEndpointNode aen : egn.getChildren()) {
        if (aen instanceof EndpointNode) {
            EndpointNode en = (EndpointNode) aen;
            ImportReference iRef = en.getImportReference();
            if (iRef != null && iRef.equals(ir))
                return en;
        }
    }
    return null;
}
Also used : EndpointNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointNode) AbstractEndpointNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode) ImportReference(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference) EndpointGroupNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointGroupNode) AbstractEndpointNode(org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode)

Aggregations

ImportReference (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference)2 AbstractEndpointNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode)2 EndpointGroupNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointGroupNode)2 EndpointNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointNode)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1