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


Java TextPropertyDescriptor.setCategory方法代码示例

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


在下文中一共展示了TextPropertyDescriptor.setCategory方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	// TODO Auto-generated method stub

	TextPropertyDescriptor attr_sysId = new TextPropertyDescriptor("sysId", "sysId");
	attr_sysId.setCategory("Attributes");
	TextPropertyDescriptor attr_model = new TextPropertyDescriptor("model", "model");
	attr_model.setCategory("Attributes");
	TextPropertyDescriptor attr_version = new TextPropertyDescriptor("version", "version");
	attr_version.setCategory("Attributes");
	return new IPropertyDescriptor[]{
			attr_sysId
			,				
			attr_model
			,				
			attr_version
							
	};
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:20,代码来源:WTItemPropertiesSource.java

示例2: evaluationDescriptor

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的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

示例3: intDescriptor

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的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

示例4: doubleDescriptor

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的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

示例5: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	// TODO Auto-generated method stub

	TextPropertyDescriptor attr_sysId = new TextPropertyDescriptor("sysId", "sysId");
	attr_sysId.setCategory("Attributes");
	return new IPropertyDescriptor[]{
			attr_sysId
							
	};
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:12,代码来源:CollectionInputOutputItemPropertiesSource.java

示例6: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	// TODO Auto-generated method stub

	TextPropertyDescriptor attr_sysId = new TextPropertyDescriptor("sysId", "sysId");
	attr_sysId.setCategory("Attributes");
	TextPropertyDescriptor attr_description = new TextPropertyDescriptor("description", "description");
	attr_description.setCategory("Attributes");
	return new IPropertyDescriptor[]{
			attr_sysId
			,				
			attr_description
							
	};
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:16,代码来源:MainSubsystemItemPropertiesSource.java


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