@Override protected Object getValue(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); Object value = propertySource.getPropertyValue(propertyID); IPropertySource valuePropertySource = propertySourceProvider .getPropertySource(value); if (valuePropertySource != null) { value = valuePropertySource.getEditableValue(); } return value; }
@Override protected Object getValue(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); Object value = propertySource.getPropertyValue(propertyID); IPropertySource valuePropertySource = propertySourceProvider .getPropertySource(value); if (valuePropertySource != null) { value = valuePropertySource.getEditableValue(); } return value; }
@Override protected void setValue(Object object, Object value) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); propertySource.setPropertyValue(propertyID, value); } }
@Override protected void setValue(Object object, Object value) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); propertySource.setPropertyValue(propertyID, value); } }
@Override protected boolean canEdit(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return true; } } return false; }
@Override protected boolean canEdit(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return true; } } return false; }
/** * Returns an property source for the given object. * * @param object * an object for which to obtain a property source or * <code>null</code> if a property source is not available * @return an property source for the given object * @since 3.1 (was previously private) */ protected IPropertySource getPropertySource(Object object) { if (sources.containsKey(object)) return sources.get(object); IPropertySource result = null; IPropertySourceProvider provider = propertySourceProvider; if (provider == null && object != null) { provider = Adapters.adapt(object, IPropertySourceProvider.class); } if (provider != null) { result = provider.getPropertySource(object); } else { result = Adapters.adapt(object, IPropertySource.class); } sources.put(object, result); return result; }
/** * Returns an property source for the given object. * * @param object * an object for which to obtain a property source or * <code>null</code> if a property source is not available * @return an property source for the given object * @since 3.1 (was previously private) */ protected IPropertySource getPropertySource(Object object) { if (sources.containsKey(object)) return (IPropertySource) sources.get(object); IPropertySource result = null; IPropertySourceProvider provider = propertySourceProvider; if (provider == null && object != null) { provider = (IPropertySourceProvider) ViewsPlugin.getAdapter(object, IPropertySourceProvider.class, false); } if (provider != null) { result = provider.getPropertySource(object); } else { result = (IPropertySource)ViewsPlugin.getAdapter(object, IPropertySource.class, false); } sources.put(object, result); return result; }
/** * Returns an property source for the given object. * * @param object * an object for which to obtain a property source or * <code>null</code> if a property source is not available * @return an property source for the given object * @since 3.1 (was previously private) */ protected IPropertySource getPropertySource(Object object) { if (sources.containsKey(object)) return sources.get(object); IPropertySource result = null; IPropertySourceProvider provider = propertySourceProvider; if (provider == null && object != null) { provider = Adapters.adapt(object, IPropertySourceProvider.class); } if (provider != null) { result = provider.getPropertySource(object); } else { result = Adapters.adapt(object, IPropertySource.class); } sources.put(object, result); return result; }
@Override public String getText(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return propertyDescriptor.getLabelProvider().getText( propertySource.getPropertyValue(propertyID)); } } return ""; //$NON-NLS-1$ }
@Override public Image getImage(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return propertyDescriptor.getLabelProvider().getImage( propertySource.getPropertyValue(propertyID)); } } return null; } }
@Override public String getText(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return propertyDescriptor.getLabelProvider().getText( propertySource.getPropertyValue(propertyID)); } } return ""; //$NON-NLS-1$ }
@Override protected CellEditor getCellEditor(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return propertyDescriptor .createPropertyEditor((Composite) getViewer() .getControl()); } } return null; }
@Override public Image getImage(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return propertyDescriptor.getLabelProvider().getImage( propertySource.getPropertyValue(propertyID)); } } return null; } }
@Override protected CellEditor getCellEditor(Object object) { IPropertySource propertySource = propertySourceProvider .getPropertySource(object); IPropertyDescriptor[] propertyDescriptors = propertySource .getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyID.equals(propertyDescriptor.getId())) { return propertyDescriptor .createPropertyEditor((Composite) getViewer() .getControl()); } } return null; }