當前位置: 首頁>>代碼示例>>Java>>正文


Java CellEditor.setValidator方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.CellEditor.setValidator方法的典型用法代碼示例。如果您正苦於以下問題:Java CellEditor.setValidator方法的具體用法?Java CellEditor.setValidator怎麽用?Java CellEditor.setValidator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.CellEditor的用法示例。


在下文中一共展示了CellEditor.setValidator方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPropertyEditor

import org.eclipse.jface.viewers.CellEditor; //導入方法依賴的package包/類
@Override
public CellEditor createPropertyEditor(Composite parent) {
	if (dataOrNullCellEditorClass != null) {
   		try {
   			Constructor<?> constructor = dataOrNullCellEditorClass.getConstructor(new Class[] { Composite.class, int.class });
   			editor = (CellEditor)constructor.newInstance(new Object[] { parent, style });
		} catch (Exception e) {
			ConvertigoPlugin.logException(e, "Unexpected exception");
		}
		
		if (editor != null) {
			((INullEditor)editor).setNullProperty(isNull);
	        if (getValidator() != null) {
				editor.setValidator(getValidator());
			}
		}
	}
	return editor;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:20,代碼來源:DataOrNullPropertyDescriptor.java

示例2: createPropertyEditor

import org.eclipse.jface.viewers.CellEditor; //導入方法依賴的package包/類
public CellEditor createPropertyEditor(Composite parent) {
  	CellEditor editor = new StringComboBoxCellEditor(parent, labels, readOnly ? SWT.READ_ONLY:SWT.NONE);
      if (getValidator() != null) {
	editor.setValidator(getValidator());
}
      return editor;
  }
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:8,代碼來源:StringComboBoxPropertyDescriptor.java

示例3: createPropertyEditor

import org.eclipse.jface.viewers.CellEditor; //導入方法依賴的package包/類
public CellEditor createPropertyEditor(Composite parent) {
       CellEditor editor = new TextCellEditor(parent, SWT.READ_ONLY);
       editor.getControl().setEnabled(false);
       if (getValidator() != null) {
		editor.setValidator(getValidator());
	}
	return editor;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:9,代碼來源:DynamicInfoPropertyDescriptor.java

示例4: createPropertyEditor

import org.eclipse.jface.viewers.CellEditor; //導入方法依賴的package包/類
public CellEditor createPropertyEditor(Composite parent) {
       CellEditor editor = new TextCellEditor(parent);
       editor.getControl().setEnabled(false);
       if (getValidator() != null) {
		editor.setValidator(getValidator());
	}
	return editor;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:9,代碼來源:InfoPropertyDescriptor.java

示例5: createPropertyEditor

import org.eclipse.jface.viewers.CellEditor; //導入方法依賴的package包/類
public CellEditor createPropertyEditor(Composite parent) {
       CellEditor editor = new ScriptCellEditor(parent);
       if (getValidator() != null) {
		editor.setValidator(getValidator());
	}
	return editor;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:8,代碼來源:ScriptablePropertyDescriptor.java

示例6: createTargetTable

import org.eclipse.jface.viewers.CellEditor; //導入方法依賴的package包/類
private void createTargetTable(Composite container) {
	targetTableViewer = new TableViewer(container, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
	targetTable = targetTableViewer.getTable();
	GridData gd_table_1 = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
	gd_table_1.heightHint = 401;
	
	if(OSValidator.isMac()){
		gd_table_1.widthHint = 363;
	}else{
		gd_table_1.widthHint = 352;
	}
	targetTable.setLayoutData(gd_table_1);

	attachTargetTableListeners();

	targetTableViewer.setContentProvider(new SecondaryColumnKeysContentProvider());
	targetTableViewer.setLabelProvider(new SecondaryColumnKeysLabelProvider());
	targetTableViewer.setInput(propertyList);

	TableColumn targetTableColumnFieldName = new TableColumn(targetTable, SWT.LEFT);
	targetTableColumnFieldName.setText(COLUMNNAME); //$NON-NLS-1$
	TableColumn targetTableColumnSortOrder = new TableColumn(targetTable, SWT.LEFT_TO_RIGHT);
	targetTableColumnSortOrder.setText(SORTORDER); //$NON-NLS-1$

	for (int i = 0, n = targetTable.getColumnCount(); i < n; i++) {
		targetTable.getColumn(i).pack();
	}
	targetTableColumnFieldName.setWidth(175);
	
	if(OSValidator.isMac()){
		targetTableColumnSortOrder.setWidth(128);
	}else{
		targetTableColumnSortOrder.setWidth(116);
	}
	
	targetTable.setHeaderVisible(true);
	targetTable.setLinesVisible(true);

	// enables the tab functionality
	TableViewerEditor.create(targetTableViewer, new ColumnViewerEditorActivationStrategy(targetTableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	final CellEditor propertyNameeditor = new TextCellEditor(targetTable);

	ComboBoxViewerCellEditor propertyValueeditor = new ComboBoxViewerCellEditor(targetTable, SWT.READ_ONLY);
	propertyValueeditor.setContentProvider(new ArrayContentProvider());
	propertyValueeditor.setLabelProvider(new LabelProvider());
	propertyValueeditor.setInput(new String[] { Constants.ASCENDING_SORT_ORDER, Constants.DESCENDING_SORT_ORDER, Constants.NONE_SORT_ORDER });

	CellEditor[] editors = new CellEditor[] { propertyNameeditor, propertyValueeditor };

	propertyNameeditor.setValidator(createNameEditorValidator(Messages.EmptyColumnNotification));
	propertyValueeditor.setValidator(createValueEditorValidator(Messages.EmptySortOrderNotification));

	targetTableViewer.setColumnProperties(PROPS);
	targetTableViewer.setCellModifier(new SecondaryColumnKeysWidgetCellModifier(targetTableViewer));
	targetTableViewer.setCellEditors(editors);

	loadProperties(targetTableViewer);
	
	if (propertyList.size() != 0) {
		deleteButton.setEnabled(true);
	}
	if (propertyList.size() >= 2) {
		upButton.setEnabled(true);
		downButton.setEnabled(true);
	}

	dropTarget = new DropTarget(targetTable, DND.DROP_MOVE);
	dropTarget.setTransfer(new Transfer[] { TextTransfer.getInstance() });
	dropTarget.addDropListener(new DropTargetAdapter() {
		public void drop(DropTargetEvent event) {
			for (String fieldName : getformatedData((String) event.data))
					addNewProperty(targetTableViewer, fieldName);
			enableControlButtons();
		}
	});

}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:81,代碼來源:SecondaryColumnKeysDialog.java


注:本文中的org.eclipse.jface.viewers.CellEditor.setValidator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。