summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-10 06:15:59 (EDT)
committerEike Stepper2007-10-10 06:15:59 (EDT)
commit2d5f81a3fc0db86fd5c1fa81f63bc180cc7e8832 (patch)
tree2a85867df42f2e77a91249a05a7f4cbfd840d2a3
parent7e62855416745c6c8e8c0d3cda6407a81c4da03c (diff)
downloadcdo-2d5f81a3fc0db86fd5c1fa81f63bc180cc7e8832.zip
cdo-2d5f81a3fc0db86fd5c1fa81f63bc180cc7e8832.tar.gz
cdo-2d5f81a3fc0db86fd5c1fa81f63bc180cc7e8832.tar.bz2
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/BuddiesManager.java255
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/bundle/OM.java11
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java196
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java32
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManager.java41
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManagerStateChangedEvent.java26
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java5
8 files changed, 386 insertions, 183 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
index 4f38168..f11917f 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
@@ -19,5 +19,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
org.eclipse.net4j.buddies;bundle-version="[0.8.0,0.9.0)";visibility:=reexport
Export-Package: org.eclipse.net4j.buddies.internal.ui;version="0.8.0",
org.eclipse.net4j.buddies.internal.ui.preferences;version="0.8.0",
- org.eclipse.net4j.buddies.internal.ui.views;version="0.8.0"
+ org.eclipse.net4j.buddies.internal.ui.views;version="0.8.0",
+ org.eclipse.net4j.buddies.ui;version="0.8.0"
Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/BuddiesManager.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/BuddiesManager.java
new file mode 100644
index 0000000..1707f0b
--- /dev/null
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/BuddiesManager.java
@@ -0,0 +1,255 @@
+package org.eclipse.net4j.buddies.internal.ui;
+
+import org.eclipse.net4j.IConnector;
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.buddies.BuddiesUtil;
+import org.eclipse.net4j.buddies.IBuddySession;
+import org.eclipse.net4j.buddies.internal.ui.bundle.OM;
+import org.eclipse.net4j.buddies.protocol.IBuddy;
+import org.eclipse.net4j.buddies.ui.IBuddiesManager;
+import org.eclipse.net4j.buddies.ui.IBuddiesManagerStateChangedEvent;
+import org.eclipse.net4j.internal.buddies.Self;
+import org.eclipse.net4j.internal.util.event.Event;
+import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
+import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.container.IContainerDelta;
+import org.eclipse.net4j.util.container.IContainerEvent;
+import org.eclipse.net4j.util.container.IPluginContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+
+public class BuddiesManager extends Lifecycle implements IBuddiesManager, IListener
+{
+ public static final BuddiesManager INSTANCE = new BuddiesManager();
+
+ private IBuddySession session;
+
+ private State state;
+
+ private boolean flashing;
+
+ private BuddiesManager()
+ {
+ }
+
+ public IBuddySession getSession()
+ {
+ return session;
+ }
+
+ public State getState()
+ {
+ return state;
+ }
+
+ public void setState(State state)
+ {
+ if (this.state != state)
+ {
+ IEvent event = new StateChangedEvent(this.state, state, session);
+ this.state = state;
+ fireEvent(event);
+ }
+ }
+
+ public boolean isConnecting()
+ {
+ return state == IBuddiesManager.State.CONNECTING;
+ }
+
+ public String getConnectorDescription()
+ {
+ return OM.PREF_CONNECTOR_DESCRIPTION.getValue();
+ }
+
+ public String getUserID()
+ {
+ return OM.PREF_USER_ID.getValue();
+ }
+
+ public String getPassword()
+ {
+ return OM.PREF_PASSWORD.getValue();
+ }
+
+ public Boolean isAutoConnect()
+ {
+ return OM.PREF_AUTO_CONNECT.getValue();
+ }
+
+ public void connect()
+ {
+ new Thread("buddies-connector")
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ setState(IBuddiesManager.State.CONNECTING);
+ while (session == null && isConnecting())
+ {
+ IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, getConnectorDescription());
+ if (connector == null)
+ {
+ throw new IllegalStateException("connector == null");
+ }
+
+ boolean connected = connector.waitForConnection(5000L);
+ if (connected)
+ {
+ session = BuddiesUtil.openSession(connector, getUserID(), getPassword(), 5000L);
+ if (session != null)
+ {
+ if (isConnecting())
+ {
+ session.addListener(BuddiesManager.this);
+ setState(IBuddiesManager.State.CONNECTED);
+ }
+ else
+ {
+ session.close();
+ session = null;
+ setState(IBuddiesManager.State.DISCONNECTED);
+ }
+ }
+ }
+ else
+ {
+ LifecycleUtil.deactivate(connector);
+ }
+ }
+ }
+ finally
+ {
+ setState(IBuddiesManager.State.DISCONNECTED);
+ }
+ }
+ }.start();
+ }
+
+ public void disconnect()
+ {
+ if (session != null)
+ {
+ session.removeListener(this);
+ session.close();
+ session = null;
+ }
+
+ setState(IBuddiesManager.State.DISCONNECTED);
+ }
+
+ public void flashMe()
+ {
+ if (session != null && !flashing)
+ {
+ final Self self = (Self)session.getSelf();
+ final IBuddy.State original = self.getState();
+ new Thread("buddies-flasher")
+ {
+ @Override
+ public void run()
+ {
+ flashing = true;
+ IBuddy.State state = original == IBuddy.State.AVAILABLE ? IBuddy.State.LONESOME : IBuddy.State.AVAILABLE;
+ for (int i = 0; i < 15; i++)
+ {
+ self.setState(state);
+ ConcurrencyUtil.sleep(200);
+ state = state == IBuddy.State.AVAILABLE ? IBuddy.State.LONESOME : IBuddy.State.AVAILABLE;
+ }
+
+ self.setState(original);
+ flashing = false;
+ }
+ }.start();
+ }
+ }
+
+ public void notifyEvent(IEvent event)
+ {
+ if (event.getSource() == session)
+ {
+ if (event instanceof ILifecycleEvent)
+ {
+ if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.DEACTIVATED)
+ {
+ disconnect();
+ if (isAutoConnect())
+ {
+ connect();
+ }
+ }
+ }
+ else if (event instanceof IContainerEvent)
+ {
+ IContainerEvent<IBuddy> e = (IContainerEvent<IBuddy>)event;
+ if (e.getDeltaKind() == IContainerDelta.Kind.ADDED)
+ {
+ e.getDeltaElement().addListener(this);
+ }
+ else if (e.getDeltaKind() == IContainerDelta.Kind.REMOVED)
+ {
+ e.getDeltaElement().removeListener(this);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ super.doActivate();
+ if (isAutoConnect())
+ {
+ connect();
+ }
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ disconnect();
+ super.doDeactivate();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private final class StateChangedEvent extends Event implements IBuddiesManagerStateChangedEvent
+ {
+ private static final long serialVersionUID = 1L;
+
+ private State oldState;
+
+ private State newState;
+
+ private IBuddySession session;
+
+ public StateChangedEvent(State oldState, State newState, IBuddySession session)
+ {
+ super(BuddiesManager.this);
+ this.oldState = oldState;
+ this.newState = newState;
+ this.session = session;
+ }
+
+ public State getOldState()
+ {
+ return oldState;
+ }
+
+ public State getNewState()
+ {
+ return newState;
+ }
+
+ public IBuddySession getSession()
+ {
+ return session;
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/bundle/OM.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/bundle/OM.java
index 00c308c..62a1634 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/bundle/OM.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/bundle/OM.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.buddies.internal.ui.bundle;
+import org.eclipse.net4j.buddies.internal.ui.BuddiesManager;
import org.eclipse.net4j.util.om.OMBundle;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.log.OMLogger;
@@ -45,6 +46,16 @@ public abstract class OM
public static final OMPreference<Boolean> PREF_AUTO_CONNECT = //
PREFS.init("PREF_AUTO_CONNECT", true); //$NON-NLS-1$
+ static void start() throws Exception
+ {
+ BuddiesManager.INSTANCE.activate();
+ }
+
+ static void stop() throws Exception
+ {
+ BuddiesManager.INSTANCE.deactivate();
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java
index 00d732b..48d81a8 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java
@@ -1,25 +1,17 @@
package org.eclipse.net4j.buddies.internal.ui.views;
-import org.eclipse.net4j.IConnector;
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.buddies.BuddiesUtil;
import org.eclipse.net4j.buddies.IBuddySession;
import org.eclipse.net4j.buddies.internal.ui.SharedIcons;
-import org.eclipse.net4j.buddies.internal.ui.bundle.OM;
import org.eclipse.net4j.buddies.protocol.IBuddy;
import org.eclipse.net4j.buddies.protocol.IBuddyStateChangedEvent;
import org.eclipse.net4j.buddies.protocol.IBuddy.State;
+import org.eclipse.net4j.buddies.ui.IBuddiesManager;
+import org.eclipse.net4j.buddies.ui.IBuddiesManagerStateChangedEvent;
import org.eclipse.net4j.internal.buddies.Self;
-import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.container.IContainerDelta;
-import org.eclipse.net4j.util.container.IContainerEvent;
-import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
-import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.ui.actions.SafeAction;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.views.ContainerView;
@@ -33,6 +25,10 @@ import org.eclipse.swt.widgets.Control;
public class BuddiesView extends ContainerView implements IListener
{
+ private static BuddiesView INSTANCE;
+
+ private IBuddySession session;
+
private ConnectAction connectAction = new ConnectAction();
private DisconnectAction disconnectAction = new DisconnectAction();
@@ -48,20 +44,8 @@ public class BuddiesView extends ContainerView implements IListener
private StateAction doNotDisturbAction = new StateAction("Do Not Disturb", State.DO_NOT_DISTURB,
SharedIcons.OBJ_BUDDY_DO_NOT_DISTURB);
- private IBuddySession session;
-
- private boolean connecting;
-
- private boolean flashing;
-
- private static BuddiesView INSTANCE;
-
public BuddiesView()
{
- if (isAutoConnect())
- {
- connect();
- }
}
public static synchronized BuddiesView getINSTANCE()
@@ -69,140 +53,21 @@ public class BuddiesView extends ContainerView implements IListener
return INSTANCE;
}
- public IBuddySession getSession()
- {
- return session;
- }
-
- protected Boolean isAutoConnect()
- {
- return OM.PREF_AUTO_CONNECT.getValue();
- }
-
- protected void connect()
- {
- new Thread("buddies-connector")
- {
- @Override
- public void run()
- {
- try
- {
- connecting = true;
- while (session == null && connecting)
- {
- String connectorDescription = OM.PREF_CONNECTOR_DESCRIPTION.getValue();
- IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, connectorDescription);
- if (connector == null)
- {
- throw new IllegalStateException("connector == null");
- }
-
- boolean connected = connector.waitForConnection(5000L);
- if (connected)
- {
- String userID = OM.PREF_USER_ID.getValue();
- String password = OM.PREF_PASSWORD.getValue();
- session = BuddiesUtil.openSession(connector, userID, password, 5000L);
- if (session != null)
- {
- if (connecting)
- {
- resetInput();
- connectAction.setEnabled(false);
- disconnectAction.setEnabled(true);
- flashAction.setEnabled(true);
- updateState();
- session.addListener(BuddiesView.this);
- session.getSelf().addListener(BuddiesView.this);
- }
- else
- {
- session.close();
- session = null;
- }
- }
- }
- else
- {
- LifecycleUtil.deactivate(connector);
- }
- }
- }
- finally
- {
- connecting = false;
- }
- }
- }.start();
- }
-
- protected void disconnect()
- {
- connecting = false;
- session.getSelf().removeListener(BuddiesView.this);
- session.removeListener(this);
- session.close();
- session = null;
- resetInput();
-
- connectAction.setEnabled(true);
- disconnectAction.setEnabled(false);
- flashAction.setEnabled(false);
- availableAction.setEnabled(false);
- availableAction.setChecked(false);
- lonesomeAction.setEnabled(false);
- lonesomeAction.setChecked(false);
- awayAction.setEnabled(false);
- awayAction.setChecked(false);
- doNotDisturbAction.setEnabled(false);
- doNotDisturbAction.setChecked(false);
- }
-
@Override
public synchronized void dispose()
{
INSTANCE = null;
- disconnect();
+ IBuddiesManager.INSTANCE.removeListener(this);
+ session = null;
super.dispose();
}
- @Override
- protected Control createUI(Composite parent)
- {
- Control control = super.createUI(parent);
- updateState();
- INSTANCE = this;
- return control;
- }
-
public void notifyEvent(IEvent event)
{
- if (event.getSource() == session)
+ if (event instanceof IBuddiesManagerStateChangedEvent)
{
- if (event instanceof ILifecycleEvent)
- {
- if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.DEACTIVATED)
- {
- disconnect();
- if (isAutoConnect())
- {
- connect();
- }
- }
- }
- else if (event instanceof IContainerEvent)
- {
- IContainerEvent<IBuddy> e = (IContainerEvent<IBuddy>)event;
- if (e.getDeltaKind() == IContainerDelta.Kind.ADDED)
- {
- e.getDeltaElement().addListener(this);
- }
- else if (e.getDeltaKind() == IContainerDelta.Kind.REMOVED)
- {
- e.getDeltaElement().removeListener(this);
- }
- }
+ session = IBuddiesManager.INSTANCE.getSession();
+ updateState();
}
else if (event instanceof IBuddyStateChangedEvent)
{
@@ -214,6 +79,17 @@ public class BuddiesView extends ContainerView implements IListener
}
@Override
+ protected Control createUI(Composite parent)
+ {
+ Control control = super.createUI(parent);
+ session = IBuddiesManager.INSTANCE.getSession();
+ IBuddiesManager.INSTANCE.addListener(this);
+ INSTANCE = this;
+ updateState();
+ return control;
+ }
+
+ @Override
protected IContainer<?> getContainer()
{
return session != null ? session : ContainerUtil.emptyContainer();
@@ -283,7 +159,7 @@ public class BuddiesView extends ContainerView implements IListener
@Override
protected void safeRun() throws Exception
{
- connect();
+ IBuddiesManager.INSTANCE.connect();
}
}
@@ -300,7 +176,7 @@ public class BuddiesView extends ContainerView implements IListener
@Override
protected void safeRun() throws Exception
{
- disconnect();
+ IBuddiesManager.INSTANCE.disconnect();
}
}
@@ -343,29 +219,7 @@ public class BuddiesView extends ContainerView implements IListener
@Override
protected void safeRun() throws Exception
{
- if (session != null && !flashing)
- {
- final Self self = (Self)session.getSelf();
- final State original = self.getState();
- new Thread("buddies-flasher")
- {
- @Override
- public void run()
- {
- flashing = true;
- IBuddy.State state = original == IBuddy.State.AVAILABLE ? IBuddy.State.LONESOME : IBuddy.State.AVAILABLE;
- for (int i = 0; i < 15; i++)
- {
- self.setState(state);
- ConcurrencyUtil.sleep(200);
- state = state == IBuddy.State.AVAILABLE ? IBuddy.State.LONESOME : IBuddy.State.AVAILABLE;
- }
-
- self.setState(original);
- flashing = false;
- }
- }.start();
- }
+ IBuddiesManager.INSTANCE.flashMe();
}
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
index 0b0588b..4cd76ab 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
@@ -1,6 +1,9 @@
package org.eclipse.net4j.buddies.internal.ui.views;
import org.eclipse.net4j.buddies.IBuddySession;
+import org.eclipse.net4j.buddies.protocol.IBuddyStateChangedEvent;
+import org.eclipse.net4j.buddies.ui.IBuddiesManager;
+import org.eclipse.net4j.buddies.ui.IBuddiesManagerStateChangedEvent;
import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.event.IEvent;
@@ -30,6 +33,8 @@ public class CollaborationsView extends ContainerView implements IListener
private static CollaborationsView INSTANCE;
+ private IBuddySession session;
+
private Sash sash;
private Control leftControl;
@@ -49,9 +54,27 @@ public class CollaborationsView extends ContainerView implements IListener
public synchronized void dispose()
{
INSTANCE = null;
+ IBuddiesManager.INSTANCE.removeListener(this);
+ session = null;
super.dispose();
}
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof IBuddiesManagerStateChangedEvent)
+ {
+ session = IBuddiesManager.INSTANCE.getSession();
+ updateState();
+ }
+ else if (event instanceof IBuddyStateChangedEvent)
+ {
+ if (session != null && event.getSource() == session.getSelf())
+ {
+ updateState();
+ }
+ }
+ }
+
@Override
protected synchronized Control createUI(final Composite parent)
{
@@ -98,19 +121,16 @@ public class CollaborationsView extends ContainerView implements IListener
rightControlData.bottom = new FormAttachment(100, 0);
rightControl.setLayoutData(rightControlData);
+ session = IBuddiesManager.INSTANCE.getSession();
+ IBuddiesManager.INSTANCE.addListener(this);
INSTANCE = this;
+ updateState();
return composite;
}
- public void notifyEvent(IEvent event)
- {
- }
-
@Override
protected IContainer<?> getContainer()
{
- BuddiesView buddiesView = BuddiesView.getINSTANCE();
- IBuddySession session = buddiesView == null ? null : buddiesView.getSession();
return session != null ? session.getSelf() : ContainerUtil.emptyContainer();
}
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManager.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManager.java
new file mode 100644
index 0000000..c9ca23a
--- /dev/null
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManager.java
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.buddies.ui;
+
+import org.eclipse.net4j.buddies.IBuddySession;
+import org.eclipse.net4j.buddies.internal.ui.BuddiesManager;
+import org.eclipse.net4j.util.event.INotifier;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IBuddiesManager extends INotifier
+{
+ public static final IBuddiesManager INSTANCE = BuddiesManager.INSTANCE;
+
+ public IBuddySession getSession();
+
+ public State getState();
+
+ public void connect();
+
+ public void disconnect();
+
+ public void flashMe();
+
+ /**
+ * @author Eike Stepper
+ */
+ public enum State
+ {
+ CONNECTING, CONNECTED, DISCONNECTED
+ }
+}
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManagerStateChangedEvent.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManagerStateChangedEvent.java
new file mode 100644
index 0000000..9a2a4d1
--- /dev/null
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/ui/IBuddiesManagerStateChangedEvent.java
@@ -0,0 +1,26 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.buddies.ui;
+
+import org.eclipse.net4j.buddies.IBuddySession;
+import org.eclipse.net4j.util.event.IEvent;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IBuddiesManagerStateChangedEvent extends IEvent
+{
+ public IBuddiesManager.State getOldState();
+
+ public IBuddiesManager.State getNewState();
+
+ public IBuddySession getSession();
+}
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
index c1f3026..05004e9 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
@@ -139,11 +139,6 @@ public abstract class TCPConnector extends Connector implements ITCPConnector, I
leaveConnecting();
}
}
- // catch (ConnectException ex)
- // {
- // // if (TRACER.isEnabled()) TRACER.trace(ex.getMessage());
- // OM.LOG.error(ex);
- // }
catch (ClosedChannelException ex)
{
deactivate();