本文整理汇总了Java中org.eclipse.jface.viewers.Viewer类的典型用法代码示例。如果您正苦于以下问题:Java Viewer类的具体用法?Java Viewer怎么用?Java Viewer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Viewer类属于org.eclipse.jface.viewers包,在下文中一共展示了Viewer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 PropertyElement) {
PropertyElement p = (PropertyElement) element;
if (p.getKey().toLowerCase().matches(searchString.toLowerCase())) {
return true;
} else {
return false;
}
}
return true;
}
示例2: selectTreePath
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
private boolean selectTreePath(Viewer viewer, TreePath parentPath, Object element) {
// Cut off children of elements that are shown repeatedly.
for (int i = 0; i < parentPath.getSegmentCount() - 1; i++) {
if (element.equals(parentPath.getSegment(i))) {
return false;
}
}
if (!(viewer instanceof TreeViewer)) {
return true;
}
if (matcher == null) {
return true;
}
TreeViewer treeViewer = (TreeViewer) viewer;
Boolean matchingResult = isMatchingOrNull(element);
if (matchingResult != null) {
return matchingResult;
}
return hasUnfilteredChild(treeViewer, parentPath, element);
}
示例3: DesignDocumentTreeObject
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
public DesignDocumentTreeObject(Viewer viewer, DatabaseObject object, boolean inherited) {
super(viewer, object, inherited);
fFilters = new FolderTreeObject(viewer, "Filters");
fUpdates = new FolderTreeObject(viewer, "Updates");
fViews = new FolderTreeObject(viewer, "Views");
loadFilters();
loadUpdates();
loadViews();
if (object.bNew) {
JSONObject json = getObject().getJSONObject();
CouchKey._id.put(json, CouchKey._design.key() + getObject().getName());
CouchKey._rev.remove(json);
}
syncDocument();
}
示例4: initPart
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ResourceInterface resourceInterface = (ResourceInterface)elt;
final GeneralPropertiesEditionPart generalPart = (GeneralPropertiesEditionPart)editingPart;
// init values
if (isAccessible(GrmViewsRepository.General.Properties.name))
generalPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, resourceInterface.getName()));
if (isAccessible(GrmViewsRepository.General.Properties.ownedService)) {
ownedServiceSettings = new ReferencesTableSettings(resourceInterface, GrmPackage.eINSTANCE.getResourceInterface_OwnedService());
generalPart.initOwnedService(ownedServiceSettings);
}
// init filters
if (isAccessible(GrmViewsRepository.General.Properties.ownedService)) {
generalPart.addFilterToOwnedService(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof String && element.equals("")) || (element instanceof ResourceService); //$NON-NLS-1$
}
});
// Start of user code for additional businessfilters for ownedService
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例5: run
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
@Override
public void run() {
if (activeEditorPart instanceof IViewerProvider) {
Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
if (viewer != null) {
viewer.refresh();
}
}
}
示例6: filter
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
@Override
public Object[] filter(Viewer viewer, TreePath parentPath, Object[] elements) {
int size = elements.length;
ArrayList<Object> out = new ArrayList<>(size);
for (int i = 0; i < size; ++i) {
Object element = elements[i];
if (selectTreePath(viewer, parentPath, element)) {
out.add(element);
}
}
return out.toArray();
}
示例7: compare
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
public int compare(Viewer viewer, Object o1, Object o2) {
int rc = 0;
Execution e1 = (Execution) o1;
Execution e2 = (Execution) o2;
switch (column) {
case ColumnsConst.PROJECT:
rc = e1.getStat().getProject().compareTo(e2.getStat().getProject());
break;
case ColumnsConst.WHEN:
rc = e1.compareTo(e2);
break;
case ColumnsConst.KIND:
rc = e1.getStat().getKind().compareTo(e2.getStat().getKind());
break;
case ColumnsConst.CONTEXT:
rc = e1.getStat().getContext().compareTo(e2.getStat().getContext());
break;
case ColumnsConst.FAILURE:
rc = new Boolean (e1.isFailure()).compareTo(new Boolean(e2.isFailure()));
break;
case ColumnsConst.ELAPSED:
rc = e1.elapsed() >= e2.elapsed() ? 1 : -1;
break;
}
// If descending order, flip the direction
if (direction == DESCENDING)
rc = -rc;
return rc;
}
示例8: unhookViewer
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
@Override
protected void unhookViewer(Viewer viewer) {
super.unhookViewer(viewer);
if (viewer instanceof StructuredViewer) {
((StructuredViewer) viewer).removeOpenListener(_OpenListener);
}
}
示例9: initPart
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final MemoryPartition memoryPartition = (MemoryPartition)elt;
final TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
// init values
if (isAccessible(SrmViewsRepository.Timing.Properties.resCtrlPolicy)) {
resCtrlPolicySettings = new ReferencesTableSettings(memoryPartition, GrmPackage.eINSTANCE.getResourceManager_ResCtrlPolicy());
timingPart.initResCtrlPolicy(resCtrlPolicySettings);
}
// FIXME NO VALID CASE INTO template public updater(editionElement : PropertiesEditionElement, view : View, pec : PropertiesEditionComponent) in widgetControl.mtl module, with the values : concurrentResources, Timing, MemoryPartition.
// init filters
if (isAccessible(SrmViewsRepository.Timing.Properties.resCtrlPolicy)) {
timingPart.addFilterToResCtrlPolicy(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof ResourceControlPolicy);
}
});
// Start of user code for additional businessfilters for resCtrlPolicy
// End of user code
}
// FIXME NO VALID CASE INTO template public filterUpdater(editionElement : PropertiesEditionElement, view : View, pec : PropertiesEditionComponent) in widgetControl.mtl module, with the values : concurrentResources, Timing, MemoryPartition.
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例10: 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;
}
示例11: inputChanged
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
try {
infos = dservice.getDeviceInformation();
} catch (Exception ne ) {
logger.error("Cannot get device information!", ne);
}
}
示例12: compare
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
@Override
public int compare ( final Viewer viewer, final Object e1, final Object e2 )
{
if ( ! ( e1 instanceof Event ) || ! ( e2 instanceof Event ) )
{
return -super.compare ( viewer, e1, e2 );
}
final Event evt1 = (Event)e1;
final Event evt2 = (Event)e2;
return -evt1.getEntryTimestamp ().compareTo ( evt2.getEntryTimestamp () );
}
示例13: run
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
@Override
public void run ()
{
if ( activeEditorPart instanceof IViewerProvider )
{
Viewer viewer = ( (IViewerProvider)activeEditorPart ).getViewer ();
if ( viewer != null )
{
viewer.refresh ();
}
}
}
示例14: ItemDropAdapter
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
public ItemDropAdapter ( final Viewer viewer, final RealtimeListAdapter list )
{
super ( viewer );
this.list = list;
setFeedbackEnabled ( true );
setSelectionFeedbackEnabled ( true );
}
示例15: inputChanged
import org.eclipse.jface.viewers.Viewer; //导入依赖的package包/类
public void inputChanged ( final Viewer viewer, final Object oldInput, final Object newInput )
{
unsubscribe ();
this.viewer = viewer;
if ( viewer != null )
{
this.display = viewer.getControl ().getDisplay ();
}
if ( newInput != null )
{
subcribe ( newInput );
}
}