diff options
| author | slewis | 2005-02-24 06:15:35 +0000 |
|---|---|---|
| committer | slewis | 2005-02-24 06:15:35 +0000 |
| commit | 579077e5cbe15b8bb850437242306a4f44b8a5a0 (patch) | |
| tree | c3204d1bf114b3fc09a4a8d39392a243650af28b | |
| parent | 8770b76c5612da3c8f52509bb6a6da2413bdb9ec (diff) | |
| download | org.eclipse.ecf-579077e5cbe15b8bb850437242306a4f44b8a5a0.tar.gz org.eclipse.ecf-579077e5cbe15b8bb850437242306a4f44b8a5a0.tar.xz org.eclipse.ecf-579077e5cbe15b8bb850437242306a4f44b8a5a0.zip | |
Added presence_member.gif to org.eclipse.ecf.ui plugin. Added image registry to ui plugin. Changed RosterView to use image from ui plugin image registry
4 files changed, 61 insertions, 5 deletions
diff --git a/framework/bundles/org.eclipse.ecf.ui/icons/presence_member.gif b/framework/bundles/org.eclipse.ecf.ui/icons/presence_member.gif Binary files differnew file mode 100644 index 000000000..d307b2006 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.ui/icons/presence_member.gif diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPlugin.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPlugin.java index 252cb1bae..3bdcbe709 100644 --- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPlugin.java +++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPlugin.java @@ -11,6 +11,9 @@ package org.eclipse.ecf.ui; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.*; import org.osgi.framework.BundleContext; import java.util.*; @@ -22,6 +25,8 @@ public class UiPlugin extends AbstractUIPlugin { public static final String PLUGIN_ID = "org.eclipse.ecf.ui"; + private ImageRegistry registry = null; + public static final String PREF_DISPLAY_TIMESTAMP = "TextChatComposite.displaytimestamp"; //The shared instance. @@ -85,4 +90,23 @@ public class UiPlugin extends AbstractUIPlugin { } return resourceBundle; } + /* (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry() + */ + protected ImageRegistry createImageRegistry() { + registry = super.createImageRegistry(); + + + registry.put(UiPluginConstants.DECORATION_PROJECT, PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER)); + registry.put(UiPluginConstants.DECORATION_USER, AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.ecf.example.collab", "icons/presence_member.gif").createImage()); + registry.put(UiPluginConstants.DECORATION_TIME, PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_FORWARD)); + registry.put(UiPluginConstants.DECORATION_TASK, PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT)); + + registry.put(UiPluginConstants.DECORATION_SEND , PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_UNDO)); + registry.put(UiPluginConstants.DECORATION_RECEIVE , PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_REDO)); + registry.put(UiPluginConstants.DECORATION_PRIVATE , PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); + registry.put(UiPluginConstants.DECORATION_SYSTEM_MESSAGE , PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK)); + return registry; + } + } diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPluginConstants.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPluginConstants.java new file mode 100644 index 000000000..68de49193 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/UiPluginConstants.java @@ -0,0 +1,27 @@ +/**************************************************************************** +* 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.ui; + +/** + * + */ +public interface UiPluginConstants { + + public static final String DECORATION_PROJECT = "project"; + public static final String DECORATION_USER = "user"; + public static final String DECORATION_TIME = "time"; + public static final String DECORATION_TASK = "task"; + public static final String DECORATION_SEND = "send"; + public static final String DECORATION_RECEIVE = "receive"; + public static final String DECORATION_PRIVATE = "private"; + public static final String DECORATION_SYSTEM_MESSAGE = "system message"; +} diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/RosterView.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/RosterView.java index 4ba8b1f64..8385840b4 100644 --- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/RosterView.java +++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/ui/views/RosterView.java @@ -22,6 +22,8 @@ import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDFactory; import org.eclipse.ecf.core.user.IUser; import org.eclipse.ecf.core.user.User; +import org.eclipse.ecf.ui.UiPlugin; +import org.eclipse.ecf.ui.UiPluginConstants; import org.eclipse.ecf.ui.messaging.IMessageViewer; import org.eclipse.ecf.ui.presence.IPresence; import org.eclipse.ecf.ui.presence.IPresenceViewer; @@ -37,6 +39,7 @@ import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelection; @@ -315,11 +318,13 @@ public class RosterView extends ViewPart implements ILocalUserSettable, } public Image getImage(Object obj) { - String imageKey = null; - if (obj instanceof TreeParent) - imageKey = ISharedImages.IMG_OBJ_FOLDER; - return PlatformUI.getWorkbench().getSharedImages().getImage( - imageKey); + Image image = null; //By default, no image exists for obj, but if found to be a specific instance, load from plugin repository. + ImageRegistry registry = UiPlugin.getDefault().getImageRegistry(); + + if (obj instanceof TreeParent) { + image = registry.get(UiPluginConstants.DECORATION_USER); + } + return image; } } |
