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


Java Viewer.getInput方法代碼示例

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


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

示例1: isLeafMatch

import org.eclipse.jface.viewers.Viewer; //導入方法依賴的package包/類
@Override
   protected boolean isLeafMatch(Viewer viewer, Object element){
	try {
		INamedNode ob = (INamedNode)element;
		boolean matched = super.isLeafMatch(viewer, ob.getName());
		if (!matched && ob.getParentName()!=null) {
			final ControlTree tree = (ControlTree)viewer.getInput();
			return isLeafMatch(viewer, tree.getNode(ob.getParentName()));
		}
		return matched;
	} catch (Exception ne) {
		return super.isLeafMatch(viewer, element);
	}
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:15,代碼來源:NamedNodeFilter.java

示例2: select

import org.eclipse.jface.viewers.Viewer; //導入方法依賴的package包/類
@Override
public boolean select(Viewer viewer,
        Object parentElement,
        Object element) {
    if (searchString == null || searchString.length() == 0) {
        return true;
    }
    if (element instanceof String) {
    	if (((String) element).toLowerCase().indexOf(searchString) > -1) {
    		return true;
    	}
    	Object input = viewer.getInput();
    	if (input instanceof IPreferenceProvider) {
    		KeyValue[] prefs = ((IPreferenceProvider) input).getPrefsFor((String) element);
    		for (KeyValue keyValue : prefs) {
	if (keyValue.getKey().toLowerCase().indexOf(searchString) > -1) {
		return true;
	}
}
    	}
    	return false;
    }
    if (element instanceof KeyValue) {
    	return ((KeyValue) element).getKey().toLowerCase().indexOf(searchString) > -1 ||
    			((KeyValue) element).getParentNode().toLowerCase().indexOf(searchString) > -1;
    }
    return false;
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:29,代碼來源:PreferenceFilter.java

示例3: validatePartitionKeyTable

import org.eclipse.jface.viewers.Viewer; //導入方法依賴的package包/類
/**
    * Returns a boolean value
    * 
    * @param viewer
    * 
    * @param errorLabel
    * 
    * This method will always return a boolean value to the caller.
    * The viewer argument is the specific table viewer for which the user
    * wants to validate the data. The errorLabel is used just for checking the present status
    * like whether the calling class has already set its value or not.
    * 
    */
public static boolean validatePartitionKeyTable(Viewer viewer,Label errorLabel) {
	errorLabel.setVisible(false);
	for (HivePartitionFields row : (List<HivePartitionFields>) viewer.getInput()) {
		if (errorLabel.getVisible()) {
			return false;
		}
		for (int i = 0; i < row.getRowFields().size()- 1; i++) {
			List<FilterProperties> list=(List<FilterProperties> ) viewer.getData(Constants.PARTITION_KEYS);
			if (StringUtils.isBlank(row.getRowFields().get(0))) {
				errorLabel.setVisible(true);
				errorLabel.setText("Column " + list.get(i).getPropertyname() + " " + Messages.HIVE_FIELD_DIALOG_ERROR);
				break;
			} else {
				if ((StringUtils.isBlank(row.getRowFields().get(i)))
						&& (StringUtils.isNotBlank((row.getRowFields().get(i + 1))))) {
					errorLabel.setVisible(true);
					errorLabel.setText("Column " + list.get(i).getPropertyname()+ " " + Messages.HIVE_FIELD_DIALOG_ERROR);
					break;
				} else {
					errorLabel.setVisible(false);
				}
			}
		}
	}
	if (!errorLabel.getVisible()) {
		return true;
	}
	return false;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:43,代碼來源:HiveFieldDialogCellModifier.java


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