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


Java TextPropertyDescriptor.setValidator方法代码示例

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


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

示例1: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	List<IPropertyDescriptor> fullList = new ArrayList<IPropertyDescriptor>();
	fullList.addAll(Arrays.asList(super.getPropertyDescriptors()));
	TextPropertyDescriptor tpd = new TextPropertyDescriptor(PRP_TAB_NUM, PRP_TAB_NUM);
	tpd.setValidator(new ICellEditorValidator() {

		@Override
		public String isValid(Object value) {
			int intValue = -1;
			try {
				intValue = Integer.parseInt((String) value);
			} catch (NumberFormatException exc) {
				return "Not a number";
			}
			return (intValue >= 2) ? null : "Value must be >=  2";
		}
	});
	fullList.add(tpd);

	return fullList.toArray(new IPropertyDescriptor[fullList.size()]);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:23,代码来源:TabGroup.java

示例2: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
/**
 * Children should override this. The default implementation returns an
 * empty array.
 */
public IPropertyDescriptor[] getPropertyDescriptors() {
	IPropertyDescriptor[] descr = new IPropertyDescriptor[descriptors.length + 1];
	System.arraycopy(descriptors, 0, descr, 0, descriptors.length);
	TextPropertyDescriptor nameDescr = new TextPropertyDescriptor(
			PROPERTY_NAME, "Name");
	nameDescr.setValidator(getDiagram().getUniqueNameValidator(this));
	descr[descriptors.length] = nameDescr;
	return descr;
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:14,代码来源:ElementImpl.java

示例3: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	List<IPropertyDescriptor> props = new ArrayList<IPropertyDescriptor>();
	TextPropertyDescriptor masterPropDes = new TextPropertyDescriptor(PROPERTY_MASTER_VIEW, PROPERTY_MASTER_VIEW);
	masterPropDes.setValidator(getDiagram().getUniqueNameValidator(this));
	props.add(masterPropDes);
	TextPropertyDescriptor detailPropDes = new TextPropertyDescriptor(PROPERTY_DETAIL_VIEW, PROPERTY_DETAIL_VIEW);
	detailPropDes.setValidator(getDiagram().getUniqueNameValidator(this));
	props.add(detailPropDes);
	props.add(new BooleanPropertyDescriptor(PROPERTY_SHOW_MASTER_IN_PORTRAIT, PROPERTY_SHOW_MASTER_IN_PORTRAIT,true));
	return props.toArray(new IPropertyDescriptor[props.size()]);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:13,代码来源:SplitWindow.java

示例4: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	List<IPropertyDescriptor> props = new ArrayList<IPropertyDescriptor>();
	TextPropertyDescriptor nameDescr = new TextPropertyDescriptor(PROPERTY_NAME, PROPERTY_NAME);
	nameDescr.setValidator(getDiagram().getUniqueNameValidator(this));
	props.add(nameDescr);
	props.add(new TextPropertyDescriptor(TITLE_PROP, TITLE_PROP));
	props.add(new TextPropertyDescriptor(TITLE_ID_PROP, TITLE_ID_PROP));
	props.add(new TextPropertyDescriptor(OK_PROP, OK_PROP));
	if (!getPlatform().isAndroid()) {
		props.add(new TextPropertyDescriptor(OK_ID_PROP, OK_ID_PROP));
	}
	props.add(new TextPropertyDescriptor(MESSAGE_PROP, MESSAGE_PROP));
	props.add(new TextPropertyDescriptor(MESSAGE_ID_PROP, MESSAGE_ID_PROP));

	NumberPropertyDescriptor npd = new NumberPropertyDescriptor(PROPERTY_CHILDREN, "optionsCount",
			NumberCellEditor.INTEGER, true);
	// set Maximum number of buttons to 3 under Android platform
	int maxValue = Platform.Android.equals(getPlatform()) ? 3 : 30;
	npd.setValidator(new MinmaxValidator(1, maxValue));
	props.add(npd);

	npd = new NumberPropertyDescriptor(CANCEL_PROP, CANCEL_PROP, NumberCellEditor.INTEGER, true);
	npd.setValidator(new MinmaxValidator(0, MinmaxValidator.MIN_ONLY));
	props.add(npd);

	return props.toArray(new IPropertyDescriptor[props.size()]);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:29,代码来源:AlertDialog.java

示例5: getPropertyDescriptors

import org.eclipse.ui.views.properties.TextPropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
	List<IPropertyDescriptor> props = new ArrayList<IPropertyDescriptor>();
	TextPropertyDescriptor nameDescr = new TextPropertyDescriptor(
			PROPERTY_NAME, PROPERTY_NAME);
	nameDescr.setValidator(getDiagram().getUniqueNameValidator(this));
	props.add(nameDescr);
	props.add(new TextPropertyDescriptor(TITLE_PROP, TITLE_PROP));
	props.add(new TextPropertyDescriptor(TITLE_ID_PROP, TITLE_ID_PROP));
	NumberPropertyDescriptor npd = new NumberPropertyDescriptor(PROPERTY_CHILDREN,
			"buttonsCount", NumberCellEditor.INTEGER, false);
	npd.setValidator(new MinmaxValidator(2, 30));
	props.add(npd);
	npd = new NumberPropertyDescriptor(CANCEL_PROP,
			CANCEL_PROP, NumberCellEditor.INTEGER, true);
	npd.setValidator(new MinmaxValidator(0, MinmaxValidator.MIN_ONLY));
	props.add(npd);
	npd = new NumberPropertyDescriptor(DESTRUCTIVE_PROP,
			DESTRUCTIVE_PROP, NumberCellEditor.INTEGER, true);
	npd.setValidator(new MinmaxValidator(0, MinmaxValidator.MIN_ONLY));
	props.add(npd);
	if (getPlatform().isAndroid()){
		npd = new NumberPropertyDescriptor(SELECTED_PROP,
				SELECTED_PROP, NumberCellEditor.INTEGER, true);
		npd.setValidator(new MinmaxValidator(0, MinmaxValidator.MIN_ONLY));
		props.add(npd);
	}
	return props.toArray(new IPropertyDescriptor[props.size()]);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:30,代码来源:OptionDialog.java

示例6: getPropertyDescriptors

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

	List<IPropertyDescriptor> fullList = new ArrayList<IPropertyDescriptor>();
	fullList.addAll(Arrays.asList(getPropertyDescriptorsForElement()));
	TextPropertyDescriptor nameDescr = new TextPropertyDescriptor(PROPERTY_NAME, "name");
	nameDescr.setValidator(getDiagram().getUniqueNameValidator(this));
	fullList.add(nameDescr);
	// now get all descriptors for all the properties that we have ...
	// Note : To do : We need some advanced collapsible editor

	return fullList.toArray(new IPropertyDescriptor[fullList.size()]);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:14,代码来源:TitaniumUIBaseElement.java


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