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


Java Viewer類代碼示例

本文整理匯總了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;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:17,代碼來源:PropEditor.java

示例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);
}
 
開發者ID:de-jcup,項目名稱:eclipse-bash-editor,代碼行數:22,代碼來源:AbstractTreeViewerFilter.java

示例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();
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:18,代碼來源:DesignDocumentTreeObject.java

示例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);
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:47,代碼來源:ResourceInterfacePropertiesEditionComponent.java

示例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();
		}
	}
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:10,代碼來源:SlaActionBarContributor.java

示例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();
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:13,代碼來源:AbstractTreeViewerFilter.java

示例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;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:34,代碼來源:PerformanceView.java

示例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);
    }
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:9,代碼來源:BaseOpenAction.java

示例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);
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:45,代碼來源:MemoryPartitionTimingPropertiesEditionComponent.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:43,代碼來源:HiveFieldDialogCellModifier.java

示例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);
	}
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:9,代碼來源:DetectorContentProvider.java

示例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 () );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:EntryTimestampViewerComparator.java

示例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 ();
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:VisualInterfaceActionBarContributor.java

示例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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:8,代碼來源:ItemDropAdapter.java

示例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 );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:16,代碼來源:ItemListContentProvider.java


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