From a8c5b53bc3fbbfc14d9169114e00a9b4dd17160b Mon Sep 17 00:00:00 2001 From: rsuen Date: Sat, 13 Dec 2008 13:53:21 +0000 Subject: Remove the unused TreeItem class. --- .../collab/share/EclipseCollabSharedObject.java | 33 -------- .../eclipse/ecf/example/collab/share/TreeItem.java | 92 ---------------------- .../example/collab/ui/LineChatClientView.java | 16 ---- 3 files changed, 141 deletions(-) delete mode 100644 examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/TreeItem.java (limited to 'examples') diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java index 05cf0bd8b..3ca75859b 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java +++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java @@ -78,7 +78,6 @@ public class EclipseCollabSharedObject extends GenericSharedObject { private static final String HANDLE_OPEN_AND_SELECT_FOR_FILE_MSG = "handleOpenAndSelectForFile"; //$NON-NLS-1$ private static final String HANDLE_ADD_MARKER_FOR_FILE_MSG = "handleAddMarkerForFile"; //$NON-NLS-1$ private static final String HANDLE_USER_UPDATE_MSG = "handleUserUpdate"; //$NON-NLS-1$ - private static final String HANDLE_UPDATE_TREE_DISPLAY_MSG = "handleUpdateTreeDisplay"; //$NON-NLS-1$ private static final String HANDLE_UNREGISTER_PROXY_MSG = "handleUnregisterProxy"; //$NON-NLS-1$ private static final String HANDLE_SHOW_TEXT_MSG = "handleShowTextMsg"; //$NON-NLS-1$ private static final String HANDLE_USER_MSG = "handleUserMessage"; //$NON-NLS-1$ @@ -328,19 +327,6 @@ public class EclipseCollabSharedObject extends GenericSharedObject { showLineOnGUI(remote, aString); } - protected void handleUpdateTreeDisplay(final ID fromID, final TreeItem item) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - try { - if (localGUI != null) - localGUI.updateTreeDisplay(fromID, item); - } catch (final Exception e) { - log("Exception in showLineOnGUI", e); //$NON-NLS-1$ - } - } - }); - } - protected void handleUserUpdate(final IUser ud) { Display.getDefault().asyncExec(new Runnable() { public void run() { @@ -614,14 +600,6 @@ public class EclipseCollabSharedObject extends GenericSharedObject { } } - public void sendUpdateTreeDisplay(ID target, TreeItem item) { - try { - forwardMsgTo(target, SharedObjectMsg.createMsg(null, HANDLE_UPDATE_TREE_DISPLAY_MSG, localContainerID, item)); - } catch (final Exception e) { - log("Exception on sendUpdateTreeDisplay to remote clients", e); //$NON-NLS-1$ - } - } - public void sendUserUpdate(ID target) { try { forwardMsgTo(target, SharedObjectMsg.createMsg(null, HANDLE_USER_UPDATE_MSG, localUser)); @@ -1015,17 +993,6 @@ public class EclipseCollabSharedObject extends GenericSharedObject { }; } - public void updateTreeDisplay(final TreeItem item) { - Display.getDefault().syncExec(new Runnable() { - public void run() { - if (localGUI != null) - localGUI.updateTreeDisplay(localContainerID, item); - } - }); - // Send update message to all replicas - sendUpdateTreeDisplay(null, item); - } - public ViewPart getViewPart() { if (localGUI == null) return null; diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/TreeItem.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/TreeItem.java deleted file mode 100644 index 57a53e0ed..000000000 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/TreeItem.java +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2004 Composent, Inc. and others. - * 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: - * Composent, Inc. - initial API and implementation - *****************************************************************************/ - -package org.eclipse.ecf.example.collab.share; - -import java.io.Serializable; - -public class TreeItem implements Serializable { - - private static final long serialVersionUID = -1223990714505395727L; - public static final String DEFAULT_SEPARATOR = ": "; //$NON-NLS-1$ - protected String label; - protected String labelValue; - protected String name; - protected String separator; - protected Object value; - - public TreeItem(String name, String labelValue) { - this(name, labelValue, null); - } - - public TreeItem(String name, String labelValue, Object value) { - this(name, name, labelValue, value); - } - - public TreeItem(String name, String label, String labelValue, Object val) { - this(name, label, DEFAULT_SEPARATOR, labelValue, val); - } - - public TreeItem(String name, String label, String separator, - String labelValue, Object value) { - this.name = name; - this.label = label; - this.separator = separator; - this.labelValue = labelValue; - this.value = value; - } - - public boolean equals(Object o) { - if (name == null) - return false; - if (o instanceof TreeItem) { - return name.equals(((TreeItem) o).name); - } else - return false; - } - - public String getLabel() { - return label; - } - - public String getLabelValue() { - return labelValue; - } - - public String getName() { - return name; - } - - public String getSeparator() { - return separator; - } - - public Object getValue() { - return value; - } - - public int hashCode() { - return name.hashCode(); - } - - public void setLabelValue(String lv) { - this.labelValue = lv; - } - - public String toString() { - String lv = getLabelValue(); - if (lv == null || lv.equals("")) { //$NON-NLS-1$ - return getLabel(); - } else - return getLabel() + getSeparator() + getLabelValue(); - } - -} diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java index 6633009c4..f2403bec7 100644 --- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java +++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java @@ -26,7 +26,6 @@ import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.user.IUser; import org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject; import org.eclipse.ecf.example.collab.share.HelloMessageSharedObject; -import org.eclipse.ecf.example.collab.share.TreeItem; import org.eclipse.ecf.example.collab.share.url.ShowURLSharedObject; import org.eclipse.ecf.example.collab.share.url.StartProgramSharedObject; import org.eclipse.ecf.internal.example.collab.ClientPlugin; @@ -352,21 +351,6 @@ public class LineChatClientView implements FileSenderUI { view.setActiveTab(name); } - public boolean updateTreeDisplay(ID id, TreeItem item) { - if (id == null) { - return false; - } else { - for (int i = 0; i < users.size(); i++) { - final IUser user = (IUser) users.get(i); - if (user.getID().equals(id)) { - teamChat.getTableViewer().refresh(user); - return true; - } - } - return false; - } - } - private class ViewerToolTip extends ToolTip { public static final String HEADER_BG_COLOR = ClientPlugin.PLUGIN_ID + ".TOOLTIP_HEAD_BG_COLOR"; //$NON-NLS-1$ -- cgit v1.2.3