| /** |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| * |
| */ |
| package org.apache.hdt.ui.internal.zookeeper; |
| |
| import org.apache.hdt.core.internal.model.ZNode; |
| import org.apache.hdt.core.internal.model.ZooKeeperServer; |
| import org.apache.hdt.ui.Activator; |
| import org.eclipse.jface.viewers.ILabelProviderListener; |
| import org.eclipse.swt.graphics.Image; |
| import org.eclipse.ui.IMemento; |
| import org.eclipse.ui.navigator.ICommonContentExtensionSite; |
| import org.eclipse.ui.navigator.ICommonLabelProvider; |
| |
| public class ZooKeeperLabelProvider implements ICommonLabelProvider { |
| |
| @Override |
| public void addListener(ILabelProviderListener listener) { |
| } |
| |
| @Override |
| public void dispose() { |
| } |
| |
| @Override |
| public boolean isLabelProperty(Object element, String property) { |
| return false; |
| } |
| |
| @Override |
| public void removeListener(ILabelProviderListener listener) { |
| } |
| |
| @Override |
| public Image getImage(Object element) { |
| if (element instanceof ZooKeeperServer) |
| return Activator.IMAGE_ZOOKEEPER; |
| if (element instanceof ZNode) |
| return Activator.IMAGE_ZOOKEEPER_NODE; |
| return null; |
| } |
| |
| @Override |
| public String getText(Object element) { |
| if (element instanceof ZooKeeperServer) { |
| ZooKeeperServer zks = (ZooKeeperServer) element; |
| return zks.getName(); |
| } |
| if (element instanceof ZNode) |
| return ((ZNode) element).getNodeName(); |
| return null; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento) |
| */ |
| @Override |
| public void restoreState(IMemento aMemento) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento) |
| */ |
| @Override |
| public void saveState(IMemento aMemento) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.navigator.IDescriptionProvider#getDescription(java.lang.Object) |
| */ |
| @Override |
| public String getDescription(Object anElement) { |
| // TODO Auto-generated method stub |
| return null; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.navigator.ICommonLabelProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite) |
| */ |
| @Override |
| public void init(ICommonContentExtensionSite aConfig) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| } |