use of org.eclipse.ecf.core.IContainerListener in project ecf by eclipse.
the class ClientContainerConnectTest method testRemoveListener.
public void testRemoveListener() throws Exception {
final IContainer client = getClients()[0];
final IContainerListener l = createListener();
client.addListener(l);
client.removeListener(l);
client.connect(createServerID(), null);
assertTrue(clientConnectingEvents.size() == 0);
}
use of org.eclipse.ecf.core.IContainerListener in project ecf by eclipse.
the class ClientContainerConnectTest method createServerAndClients.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.tests.connect.ContainerConnectTestCase#createServerAndClients()
*/
protected void createServerAndClients() throws Exception {
clientCount = 5;
super.createServerAndClients();
getServer().addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent)
serverConnectEvents.add(event);
if (event instanceof IContainerDisconnectedEvent)
serverDisconnectEvents.add(event);
}
});
}
use of org.eclipse.ecf.core.IContainerListener in project ecf by eclipse.
the class SSLClientContainerConnectTest method createServerAndClients.
/*
* (non-Javadoc)
*
* @see org.eclipse.ecf.tests.connect.ContainerConnectTestCase#createServerAndClients()
*/
protected void createServerAndClients() throws Exception {
clientCount = 5;
super.createServerAndClients();
getServer().addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent)
serverConnectEvents.add(event);
if (event instanceof IContainerDisconnectedEvent)
serverDisconnectEvents.add(event);
}
});
}
use of org.eclipse.ecf.core.IContainerListener in project ecf by eclipse.
the class SharedObjectContainerUI method setup.
public void setup(final ISharedObjectContainer soContainer, final ClientEntry newClientEntry, final IResource resource, String username) throws Exception {
addObjectToClient(soContainer, newClientEntry, username, resource);
soc.addListener(new IContainerListener() {
public void handleEvent(IContainerEvent evt) {
if (evt instanceof IContainerDisconnectedEvent || evt instanceof IContainerEjectedEvent) {
final ID departedContainerID = ((evt instanceof IContainerDisconnectedEvent) ? ((IContainerDisconnectedEvent) evt).getTargetID() : ((IContainerEjectedEvent) evt).getTargetID());
final ID connectedID = newClientEntry.getContainer().getConnectedID();
if (connectedID == null || connectedID.equals(departedContainerID)) {
if (!newClientEntry.isDisposed()) {
collabclient.disposeClient(resource, newClientEntry);
}
}
}
}
});
}
use of org.eclipse.ecf.core.IContainerListener in project ecf by eclipse.
the class UserSearchView method addMultiRosterAccount.
/**
* Add the MultiRosterAccount for add user contact
* @param multiRosterAccount
* @return boolean
*/
public boolean addMultiRosterAccount(MultiRosterAccount multiRosterAccount) {
Assert.isNotNull(multiRosterAccount);
this.account = multiRosterAccount;
listener = new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerDisconnectedEvent) {
users.clear();
showMessage(Messages.MultiRosterView_HELP_MESSAGE);
}
}
};
account.container.addListener(listener);
return true;
}
Aggregations