1 20 21 package org.apache.directory.ldapstudio.schemas.view.dialogs; 22 23 24 import org.apache.directory.ldapstudio.schemas.Activator; 25 import org.apache.directory.ldapstudio.schemas.PluginConstants; 26 import org.apache.directory.ldapstudio.schemas.model.ObjectClass; 27 import org.apache.directory.ldapstudio.schemas.view.ViewUtils; 28 import org.apache.directory.ldapstudio.schemas.view.views.wrappers.ObjectClassWrapper; 29 import org.eclipse.jface.viewers.ITableLabelProvider; 30 import org.eclipse.jface.viewers.LabelProvider; 31 import org.eclipse.swt.graphics.Image; 32 import org.eclipse.ui.plugin.AbstractUIPlugin; 33 34 35 41 public class ObjectClassSelectionDialogLabelProvider extends LabelProvider implements ITableLabelProvider 42 { 43 46 public Image getColumnImage( Object element, int columnIndex ) 47 { 48 if ( element instanceof ObjectClassWrapper ) 49 { 50 return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, PluginConstants.IMG_OBJECT_CLASS ) 51 .createImage(); 52 } 53 54 return null; 56 } 57 58 59 62 public String getColumnText( Object element, int columnIndex ) 63 { 64 if ( element instanceof ObjectClassWrapper ) 65 { 66 ObjectClass oc = ( ( ObjectClassWrapper ) element ).getMyObjectClass(); 67 return ViewUtils.concateAliases( oc.getNames() ) + " [" + oc.getOid() + "]"; } 69 70 return null; 72 } 73 } 74 | Popular Tags |