当前位置: 首页>>代码示例>>Java>>正文


Java PropertyDescriptor类代码示例

本文整理汇总了Java中org.eclipse.ui.views.properties.PropertyDescriptor的典型用法代码示例。如果您正苦于以下问题:Java PropertyDescriptor类的具体用法?Java PropertyDescriptor怎么用?Java PropertyDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyDescriptor类属于org.eclipse.ui.views.properties包,在下文中一共展示了PropertyDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addProperty

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
/**
 * Adds a new property to this {@link PropertyHolder}.
 *
 * @param displayName
 *        the display name of the generated {@link IPropertyDescriptor}
 * @param description
 *        the description of the generated {@link IPropertyDescriptor}
 * @param value
 *        the property value
 */
public void addProperty(final String displayName, final String description, final Object value) {
    final Object id = new Integer(nextId++);

    propertyValues.put(id, value);

    final PropertyDescriptor propertyDescriptor = new PropertyDescriptor(id, displayName);
    propertyDescriptor.setDescription(description);

    /*
     * Calling setAlwaysIncompatible(true) keeps this property from showing
     * up in the properties view when the selection contains more than one
     * element.
     */
    propertyDescriptor.setAlwaysIncompatible(true);

    propertyDescriptors.add(propertyDescriptor);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:28,代码来源:PropertyHolder.java

示例2: createPropertyDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
public static void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap, String preID, String prefix) {
	PropertyDescriptor pd = new DoublePropertyDescriptor(preID + PadUtil.PADDING_TOP, Messages.common_top);
	pd.setDescription(Messages.common_top);
	pd.setCategory(prefix);
	desc.add(pd);

	pd = new DoublePropertyDescriptor(preID + PadUtil.PADDING_BOTTOM, Messages.common_bottom);
	pd.setDescription(Messages.common_bottom);
	pd.setCategory(prefix);
	desc.add(pd);

	pd = new DoublePropertyDescriptor(preID + PadUtil.PADDING_LEFT, Messages.common_left);
	pd.setDescription(Messages.common_left);
	pd.setCategory(prefix);
	desc.add(pd);

	pd = new DoublePropertyDescriptor(preID + PadUtil.PADDING_RIGHT, Messages.common_right);
	pd.setDescription(Messages.common_right);
	pd.setCategory(prefix);
	desc.add(pd);

	defaultsMap.put(preID + PadUtil.PADDING_TOP, 0.0d);
	defaultsMap.put(preID + PadUtil.PADDING_BOTTOM, 0.0d);
	defaultsMap.put(preID + PadUtil.PADDING_LEFT, 0.0d);
	defaultsMap.put(preID + PadUtil.PADDING_RIGHT, 0.0d);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:PadUtil.java

示例3: getPropertyDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
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()]);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:BaseElementPropertySource.java

示例4: MarkerPropertySource

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
public MarkerPropertySource(IMarker marker) {
    this.marker = marker;
    List<IPropertyDescriptor> props = new ArrayList<IPropertyDescriptor>();
    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]);
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:20,代码来源:PropertyPageAdapterFactory.java

示例5: evaluationDescriptor

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
/**
 * @param descriptors
 * @param attr
 * @param propertyid
 */
private void evaluationDescriptor(Collection descriptors, EStructuralFeature attr, PropertyID propertyid) {
    if (attr.getName() == "evaluation") { //$NON-NLS-1$
        TextPropertyDescriptor pd = new TextPropertyDescriptor(propertyid, "evaluationLevel (100 to -100)"); //$NON-NLS-1$

        ((PropertyDescriptor) pd).setValidator(new ICellEditorValidator() {
            public String isValid(Object value) {
                int intValue = -1;
                try {
                    intValue = Integer.parseInt((String) value);
                    return null;
                } catch (NumberFormatException exc) {
                    return "Not Number"; //$NON-NLS-1$
                }
            }
        });
        pd.setCategory("Strategy"); //$NON-NLS-1$
        descriptors.add(pd);
    }
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:25,代码来源:IndicatorPropertySource.java

示例6: addPropertyToDescriptor

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
/**
 * This function will add an attribute to the current descriptor. Currently, it handles a limited number of types.
 * 
 * @param descriptors
 * @param attr
 * @param c
 */
public void addPropertyToDescriptor(Collection descriptors, EStructuralFeature attr, EClass c) {
    // Get type for the structural feature
    EClassifier type = getFeatureType(attr);

    String propertyname = attr.getName();

    // we are changing the passed property parameter because our feature id
    // depends on the Eclass, which it does not contain.
    // String propertyid = Integer.toString(attr.getFeatureID());
    PropertyID propertyid = new PropertyID(c, attr);

    if (attr instanceof EAttribute && ((EAttribute) attr).isID()) {
        // shouldn't be editable
        descriptors.add(new PropertyDescriptor(propertyid, propertyname));
    } else if (type.getInstanceClass() == String.class) {
        stringDescriptor(descriptors, attr, propertyid);
    } else if (type.getInstanceClass() == boolean.class) {
        booleanDescriptor(descriptors, attr, propertyid);
    } else if (type.getInstanceClass() == int.class) {
        intDescriptor(descriptors, attr, propertyid);
    } else if (type.getInstanceClass() == double.class) {
        doubleDescriptor(descriptors, attr, propertyid);
    }

}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:33,代码来源:EObjectPropertySource.java

示例7: intDescriptor

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
/**
 * int property descriptor
 * 
 * @param descriptors
 * @param attr
 * @param propertyid
 */
protected void intDescriptor(Collection descriptors, EStructuralFeature attr, PropertyID propertyid) {
    TextPropertyDescriptor desc = new TextPropertyDescriptor(propertyid, attr.getName());

    ((PropertyDescriptor) desc).setValidator(new ICellEditorValidator() {
        public String isValid(Object value) {
            int intValue = -1;
            try {
                intValue = Integer.parseInt((String) value);
                return null;
            } catch (NumberFormatException exc) {
                return Messages.getString("EObjectPropertySource.notNumber"); //$NON-NLS-1$
            }
        }
    });
    String name = attr.getName().toLowerCase();
    if (name.equals("x") || name.equals("y") || name.equals("deltax") || name.equals("deltay") || name.equals("height") || name.equals("width")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
        desc.setCategory(Messages.getString("EObjectPropertySource.appearance")); //$NON-NLS-1$
    } else if (object.eClass() != propertyid.getEClass()) {
        desc.setCategory(Messages.getString("EObjectPropertySource.reference")); //$NON-NLS-1$
    } else {
        desc.setCategory(Messages.getString("EObjectPropertySource.misc")); //$NON-NLS-1$
    }

    descriptors.add(desc);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:33,代码来源:EObjectPropertySource.java

示例8: doubleDescriptor

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
/**
 * int property descriptor
 * 
 * @param descriptors
 * @param attr
 * @param propertyid
 */
protected void doubleDescriptor(Collection descriptors, EStructuralFeature attr, PropertyID propertyid) {
    TextPropertyDescriptor desc = new TextPropertyDescriptor(propertyid, attr.getName());

    ((PropertyDescriptor) desc).setValidator(new ICellEditorValidator() {
        public String isValid(Object value) {
            double doubleValue = -1;
            try {
                doubleValue = Double.parseDouble(value.toString());
                return null;
            } catch (NumberFormatException exc) {
                return Messages.getString("EObjectPropertySource.notValidNumber"); //$NON-NLS-1$
            }
        }
    });

    desc.setCategory(Messages.getString("EObjectPropertySource.misc")); //$NON-NLS-1$

    descriptors.add(desc);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:27,代码来源:EObjectPropertySource.java

示例9: loadDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
@Override
protected IPropertyDescriptor[] loadDescriptors() {
	IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[3];
	propertyDescriptors[0] = new TextPropertyDescriptor("tagname", "Column tag name");
	((PropertyDescriptor)propertyDescriptors[0]).setCategory("Configuration");
	propertyDescriptors[1] = new TextPropertyDescriptor("colxpath", "Column XPath");
	((PropertyDescriptor)propertyDescriptors[1]).setCategory("Selection");
	propertyDescriptors[2] = new ComboBoxPropertyDescriptor("extract", "Extract children", new String[]{"false","true"});
	((PropertyDescriptor)propertyDescriptors[2]).setCategory("Selection");
	return propertyDescriptors;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:12,代码来源:XMLTableDescriptionColumnTreeObject.java

示例10: loadDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
@Override
protected IPropertyDescriptor[] loadDescriptors() {
	IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[3];
	propertyDescriptors[0] = new TextPropertyDescriptor("name", "Data tag name");
	((PropertyDescriptor)propertyDescriptors[0]).setCategory("Configuration");
	propertyDescriptors[1] = new TextPropertyDescriptor("xpath", "Data XPath");
	((PropertyDescriptor)propertyDescriptors[1]).setCategory("Selection");
	propertyDescriptors[2] = new ComboBoxPropertyDescriptor("extract", "Extract children", new String[]{"false","true"});
	((PropertyDescriptor)propertyDescriptors[2]).setCategory("Selection");
	return propertyDescriptors;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:12,代码来源:XMLRecordDescriptionRowTreeObject.java

示例11: loadDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
@Override
protected IPropertyDescriptor[] loadDescriptors() {
	IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[2];
	propertyDescriptors[0] = new TextPropertyDescriptor("tagname", "Row tag name");
	((PropertyDescriptor)propertyDescriptors[0]).setCategory("Configuration");
	propertyDescriptors[1] = new TextPropertyDescriptor("rowxpath", "Row XPath");
	((PropertyDescriptor)propertyDescriptors[1]).setCategory("Selection");
	return propertyDescriptors;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:10,代码来源:XMLTableDescriptionRowTreeObject.java

示例12: getDynamicPropertyDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
protected List<PropertyDescriptor> getDynamicPropertyDescriptors() {
	/*List<PropertyDescriptor> l = new ArrayList<PropertyDescriptor>();
	if (this instanceof IDynamicPropertyProvider) {
		IDynamicPropertyProvider provider = (IDynamicPropertyProvider)this;
       	l.addAll(provider.getDynamicPropertyDescriptorProvider().
       								getDynamicPropertyDescriptors());
	}
	return l;*/
	return new ArrayList<PropertyDescriptor>();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:11,代码来源:DatabaseObjectTreeObject.java

示例13: getPropertyDescriptor

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
protected java.beans.PropertyDescriptor getPropertyDescriptor(String propertyName) {
	int len = databaseObjectPropertyDescriptors.length;

	java.beans.PropertyDescriptor databaseObjectPropertyDescriptor = null;
	for (int i = 0; i < len; i++) {
		databaseObjectPropertyDescriptor = databaseObjectPropertyDescriptors[i];
		if (propertyName.equals(databaseObjectPropertyDescriptor.getName()))
			return databaseObjectPropertyDescriptor;
	}

	return null;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:13,代码来源:DatabaseObjectTreeObject.java

示例14: getPropertyDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
  return new IPropertyDescriptor[] {new PropertyDescriptor(DetailPropertySource.ID, "ID"),
      new PropertyDescriptor(DetailPropertySource.LENGTH, "Length"),
      new PropertyDescriptor(DetailPropertySource.LINE_NUMBER, "Line Number"),
      new PropertyDescriptor(DetailPropertySource.OFFSET, "Offset"),
      new PropertyDescriptor(DetailPropertySource.PATH, "Path"),
      new PropertyDescriptor(DetailPropertySource.TEXT, "Text"),
      new PropertyDescriptor(DetailPropertySource.TYPE, "Type")};
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:11,代码来源:DetailPropertySource.java

示例15: getPropertyDescriptors

import org.eclipse.ui.views.properties.PropertyDescriptor; //导入依赖的package包/类
public IPropertyDescriptor[] getPropertyDescriptors() {
	int size = 1;
	if(Platform.Android == getPlatform())
		size = 2;
	IPropertyDescriptor[] descr = new IPropertyDescriptor[size];
	descr[0] = new PropertyDescriptor(Diagram.PLATFORM, Diagram.PLATFORM);
	if(Platform.Android == getPlatform())
		descr[1] = new ResolutionPropertyDescriptor(getPlatform(), Diagram.RESOLUTION);
	return descr;
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:11,代码来源:Screen.java


注:本文中的org.eclipse.ui.views.properties.PropertyDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。