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


Java StructuredViewer類代碼示例

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


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

示例1: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void createContextMenuFor ( StructuredViewer viewer )
{
    MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:22,代碼來源:ProtocolEditor.java

示例2: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well
 * registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated NOT
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    final Transfer[] transfers = new Transfer[] {
            LocalTransfer.getInstance (),
            LocalSelectionTransfer.getTransfer (),
            FileTransfer.getInstance (),
            ItemTransfer.getInstance ()
    };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new DropAdapterExtension ( this.editingDomain, viewer ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:29,代碼來源:ChartEditor.java

示例3: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well
 * registering the menu for extension. <!-- begin-user-doc --> <!--
 * end-user-doc -->
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" );
    contextMenu.add ( new Separator ( "additions" ) );
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    final Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( this.editingDomain, viewer ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:ChartConfiguratorView.java

示例4: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void createContextMenuFor ( StructuredViewer viewer )
{
    MenuManager contextMenu = new MenuManager ( "#PopUp" );
    contextMenu.add ( new Separator ( "additions" ) );
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:22,代碼來源:MemoryEditor.java

示例5: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well
 * registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 *
 * @generated NOT
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    final Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance (), ItemTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new DropAdapterExtension ( this.editingDomain, viewer ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:ComponentEditor.java

示例6: resourceChanged

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if ((event.getDelta().getFlags() ^ IResourceDelta.MARKERS) != 0) {
		try {
			event.getDelta().accept(delta -> {
				if (delta.getResource().equals(this.resource)) {
					viewer.getControl().getDisplay().asyncExec(() -> {
						if (viewer instanceof StructuredViewer) {
							viewer.refresh(true);
						}
					});
				}
				return delta.getResource().getFullPath().isPrefixOf(this.resource.getFullPath());
			});
		} catch (CoreException e) {
			// LanguageServerPlugin.logError(e);
		}
	}
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:20,代碼來源:EditorConfigContentProvider.java

示例7: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
protected void createContextMenuFor(StructuredViewer viewer) {
    MenuManager contextMenu = new MenuManager("#PopUp");
    contextMenu.add(new Separator("additions"));
    contextMenu.setRemoveAllWhenShown(true);
    contextMenu.addMenuListener(this);
    Menu menu = contextMenu.createContextMenu(viewer.getControl());
    viewer.getControl().setMenu(menu);
    getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));

    int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    Transfer[] transfers = new Transfer[] {LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(),
        FileTransfer.getInstance()};
    viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
    viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
 
開發者ID:ObeoNetwork,項目名稱:M2Doc,代碼行數:23,代碼來源:GenconfEditor.java

示例8: getLabel

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
public String getLabel() {
	String label= super.getLabel();
	StructuredViewer viewer= getViewer();
	if (viewer instanceof TableViewer) {
		TableViewer tv= (TableViewer) viewer;

		AbstractTextSearchResult result= getInput();
		if (result != null) {
			int itemCount= ((IStructuredContentProvider) tv.getContentProvider()).getElements(getInput()).length;
			if (showLineMatches()) {
				int matchCount= getInput().getMatchCount();
				if (itemCount < matchCount) {
					return Messages.format(SearchMessages.FileSearchPage_limited_format_matches, new Object[]{label, new Integer(itemCount), new Integer(matchCount)});
				}
			} else {
				int fileCount= getInput().getElements().length;
				if (itemCount < fileCount) {
					return Messages.format(SearchMessages.FileSearchPage_limited_format_files, new Object[]{label, new Integer(itemCount), new Integer(fileCount)});
				}
			}
		}
	}
	return label;
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:25,代碼來源:TypeScriptSearchResultPage.java

示例9: init

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
public void init(ICommonActionExtensionSite actionSite) {
	super.init(actionSite);
	ICommonViewerSite site = actionSite.getViewSite();
	if (site instanceof ICommonViewerWorkbenchSite) {
		StructuredViewer viewer = actionSite.getStructuredViewer();
		if (viewer instanceof CommonViewer) {
			CommonViewer serversViewer = (CommonViewer) viewer;
			serversViewer.addOpenListener(new IOpenListener() {
				public void open(OpenEvent event) {
					ISelection s = event.getSelection();
					if (s instanceof IStructuredSelection) {
						IStructuredSelection selection = (IStructuredSelection) s;
						Object[] selectedObjects = selection.toArray();
						if (selectedObjects.length == 1 && selectedObjects[0] instanceof ModuleServer) {
							ModuleServer moduleServer = (ModuleServer) selectedObjects[0];
							openApplicationPage(moduleServer);
						}
					}
				}
			});
		}
	}
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:24,代碼來源:CloudFoundryActionProvider.java

示例10: select

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
@Override
public boolean select(Viewer viewer, Object parentElement,
		Object element) {

	StructuredViewer sviewer = (StructuredViewer) viewer;
	ITreeContentProvider provider = (ITreeContentProvider) sviewer
			.getContentProvider();
	
	if (element instanceof Group ) {
		for (Object child: provider.getChildren(element)) {
			if (select(viewer, element, child)) 
				return true; 
		}
	}
	else {
		Test test = (Test)element;
		if (test.getTestName().contains(searchTestName)) {
			return true;
		}
	}
	return false;
}
 
開發者ID:FutureProcessing,項目名稱:RFRunnerPlugin,代碼行數:23,代碼來源:Filter.java

示例11: getSearchEntries

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
@Override
public List<E> getSearchEntries(BTSQueryRequest query, 
		Map<String, BTSQueryResultAbstract> queryResultMap,
		StructuredViewer viewer, TreeNodeWrapper parentHolder,
		EReference referenceName, IProgressMonitor monitor) {
	System.out.println(query.getQueryId());
	query.setResponseFields(BTSConstants.SEARCH_BASIC_RESPONSE_FIELDS);
	if (queryResultMap != null) {
		BTSQueryResultAbstract qra = new BTSQueryResultAbstract();
		qra.setViewer(viewer);
		qra.setParentEObject(parentHolder);
		qra.setReferenceName(referenceName);
		qra.setQueryId(query.getQueryId());
		queryResultMap.put(query.getQueryId(), qra);
	}
	System.out.println(query);
	List<E> children =executeTypedQuery(query, BTSConstants.OBJECT_STATE_ACTIVE, monitor);// thsService.query(query,BTSConstants.OBJECT_STATE_ACTIVE);
	sortEntries(children);
	return children;
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:21,代碼來源:AbstractCorpusObjectNavigatorControllerImpl.java

示例12: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void createContextMenuFor(StructuredViewer viewer)
{
	MenuManager contextMenu = new MenuManager("#PopUp");
	contextMenu.add(new Separator("additions"));
	contextMenu.setRemoveAllWhenShown(true);
	contextMenu.addMenuListener(this);
	Menu menu= contextMenu.createContextMenu(viewer.getControl());
	viewer.getControl().setMenu(menu);
	getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));

	int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
	Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
	viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
	viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:22,代碼來源:BtsmodelEditor.java

示例13: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well
 * registering the menu for extension. <!-- begin-user-doc --> <!--
 * end-user-doc -->
 *
 * @generated
 */
protected void createContextMenuFor(StructuredViewer viewer) {
	MenuManager contextMenu = new MenuManager("#PopUp");
	contextMenu.add(new Separator("additions"));
	contextMenu.setRemoveAllWhenShown(true);
	contextMenu.addMenuListener(this);
	Menu menu = contextMenu.createContextMenu(viewer.getControl());
	viewer.getControl().setMenu(menu);
	getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));

	int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
	Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(),
			FileTransfer.getInstance() };
	viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
	viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
 
開發者ID:mondo-project,項目名稱:mondo-demo-wt,代碼行數:23,代碼來源:WTSpec4MEditor.java

示例14: createContextMenuFor

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void createContextMenuFor(StructuredViewer viewer) {
	MenuManager contextMenu = new MenuManager("#PopUp");
	contextMenu.add(new Separator("additions"));
	contextMenu.setRemoveAllWhenShown(true);
	contextMenu.addMenuListener(this);
	Menu menu = contextMenu.createContextMenu(viewer.getControl());
	viewer.getControl().setMenu(menu);
	getSite().registerContextMenu(contextMenu,
			new UnwrappingSelectionProvider(viewer));

	int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
	Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
	viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(
			viewer));
	viewer.addDropSupport(dndOperations, transfers,
			new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:24,代碼來源:Securebpmn2Editor.java

示例15: doUpdate

import org.eclipse.jface.viewers.StructuredViewer; //導入依賴的package包/類
/**
 * Update must be on UI thread because it's on a SWT widget.
 * 
 * @param node
 */
private void doUpdate(final StructuredViewer[] viewers, final IJSONNode node, final String[] properties) {
	final Display display = PlatformUI.getWorkbench().getDisplay();
	display.asyncExec(new Runnable() {
		public void run() {
			if (DEBUG) {
				System.out.println("refresh on: [" + node.getNodeName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
			}

			for (int i = 0; i < viewers.length; i++) {
				if (!viewers[i].getControl().isDisposed()) {
					viewers[i].update(node, properties);
				}
				else {
					if (DEBUG) {
						System.out.println("   !!! skipped refreshing disposed viewer: " + viewers[i]); //$NON-NLS-1$
					}
				}
			}
		}
	});
}
 
開發者ID:angelozerr,項目名稱:eclipse-wtp-json,代碼行數:27,代碼來源:RefreshStructureJob.java


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