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