本文整理汇总了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
};
}
示例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);
}
}
示例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);
}
示例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);
}
示例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
};
}
示例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
};
}