Search in sources :

Example 6 with ImportReference

use of org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference 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 7 with ImportReference

use of org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference 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)7 AbstractEndpointNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode)4 EndpointNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointNode)4 RemoteServiceAdmin (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin)3 ImportRegistration (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportRegistration)3 EndpointDescription (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)2 EndpointGroupNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointGroupNode)2 EndpointPropertyNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.EndpointPropertyNode)2 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 Date (java.util.Date)1 ID (org.eclipse.ecf.core.identity.ID)1 EndpointDescriptionReader (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionReader)1 IEndpointDescriptionLocator (org.eclipse.ecf.osgi.services.remoteserviceadmin.IEndpointDescriptionLocator)1 ExportReference (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference)1 EndpointDescriptionRSANode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.EndpointDescriptionRSANode)1 ImportRegistrationNode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ImportRegistrationNode)1 ServiceIdNode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ServiceIdNode)1 Action (org.eclipse.jface.action.Action)1 ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)1