org.eclipse.ui.views.properties.PropertyDescriptor Java Examples

The following examples show how to use org.eclipse.ui.views.properties.PropertyDescriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PropertyPageAdapterFactory.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
public MarkerPropertySource(IMarker marker) {
    this.marker = marker;
    List<IPropertyDescriptor> props = new ArrayList<>();
    try {
        Map<?, ?> attributes = marker.getAttributes();
        Set<?> keySet = new TreeSet<Object>(attributes.keySet());
        for (Object object : keySet) {
            props.add(new PropertyDescriptor(object, "" + object));
        }
    } catch (CoreException e) {
        FindbugsPlugin.getDefault().logException(e, "MarkerPropertySource: marker access failed");
    }
    props.add(new PropertyDescriptor(PropId.Bug, "Bug"));
    props.add(new PropertyDescriptor(PropId.Resource, "Resource"));
    props.add(new PropertyDescriptor(PropId.Id, "Marker id"));
    props.add(new PropertyDescriptor(PropId.Type, "Marker type"));
    props.add(new PropertyDescriptor(PropId.CreationTime, "Creation time"));
    propertyDescriptors = props.toArray(new PropertyDescriptor[0]);
}
 
Example #2
Source File: BaseElementPropertySource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		PropertyDescriptor descriptor = new PropertyDescriptor(p, p.getHeader());
		String category = p.getCategory();

		if (!StringUtil.isEmpty(category))
		{
			descriptor.setCategory(category);
		}

		result.add(descriptor);
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #3
Source File: BaseElementPropertySource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		PropertyDescriptor descriptor = new PropertyDescriptor(p, p.getHeader());
		String category = p.getCategory();

		if (!StringUtil.isEmpty(category))
		{
			descriptor.setCategory(category);
		}

		result.add(descriptor);
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #4
Source File: BaseElement.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		PropertyDescriptor descriptor = new PropertyDescriptor(p, p.getHeader());
		String category = p.getCategory();

		if (!StringUtil.isEmpty(category))
		{
			descriptor.setCategory(category);
		}

		result.add(descriptor);
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #5
Source File: PropertyPageAdapterFactory.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
public PropertySource(Object object) {
    this.object = object;
    List<IPropertyDescriptor> props = new ArrayList<>();
    List<Method> getters = getGetters(object);
    for (Method method : getters) {
        props.add(new PropertyDescriptor(method, getReadableName(method)));
    }
    propertyDescriptors = props.toArray(new PropertyDescriptor[0]);
}
 
Example #6
Source File: PropertyPageAdapterFactory.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ArrayPropertySource(Object[] object) {
    this.array = object;
    List<IPropertyDescriptor> props = new ArrayList<>();
    for (Object obj : array) {
        props.add(new PropertyDescriptor(obj, getDisplayName(obj)));
    }
    propertyDescriptors = props.toArray(new PropertyDescriptor[0]);
}
 
Example #7
Source File: BaseNode.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		result.add(new PropertyDescriptor(p, p.getHeader()));
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #8
Source File: CordovaPluginProperties.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
private static IPropertyDescriptor createPropertyDescriptor(String field, String label){
	PropertyDescriptor descriptor = new PropertyDescriptor(field, label);
	descriptor.setCategory("Cordova Plugin");
	descriptor.setAlwaysIncompatible(true);
	return descriptor;

	
}
 
Example #9
Source File: CordovaPlatformProperties.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
private static IPropertyDescriptor createPropertyDescriptor(String field, String label){
	PropertyDescriptor descriptor = new PropertyDescriptor(field, label);
	descriptor.setCategory("Cordova Platform");
	descriptor.setAlwaysIncompatible(true);
	return descriptor;

	
}
 
Example #10
Source File: PropertySource.java    From ice with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * <p>
 * The default implementation that provides one property descriptor.
 * </p>
 * 
 * @return <p>
 *         The array of descriptors
 *         </p>
 * 
 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
 */
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	IPropertyDescriptor[] descriptors = new IPropertyDescriptor[] { new PropertyDescriptor(
			"NONE", "No property") };
	return descriptors;
}