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


Java IViewerProvider類代碼示例

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


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

示例1: selectInstruction

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
/**
 * Selects the given instruction in the given {@link IEditorPart}.
 * 
 * @param editorPart
 *            the {@link IEditorPart}
 * @param instructionUri
 *            the instruction {@link URI}
 */
public static void selectInstruction(IEditorPart editorPart, final URI instructionUri) {
	if (editorPart instanceof IViewerProvider) {
		if (editorPart instanceof IEditingDomainProvider) {
			final EditingDomain domain = ((IEditingDomainProvider)editorPart).getEditingDomain();
			final EObject selection = domain.getResourceSet().getEObject(instructionUri, false);
			if (selection != null) {
				((IViewerProvider)editorPart).getViewer().setSelection(
						new StructuredSelection(selection), true);
			} else {
				DebugIdeUiPlugin.getPlugin().log(
						new IllegalStateException("can't find source for " + instructionUri));
			}
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:24,代碼來源:EMFEditorUtils.java

示例2: selectInstructions

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
/**
 * Selects the given instruction in the given {@link IEditorPart}.
 * 
 * @param editorPart
 *            the {@link IEditorPart}
 * @param instructionUris
 *            the {@link List} of instruction {@link URI}
 */
public static void selectInstructions(IEditorPart editorPart, final List<URI> instructionUris) {
	if (editorPart instanceof IViewerProvider) {
		if (editorPart instanceof IEditingDomainProvider) {
			final EditingDomain domain = ((IEditingDomainProvider)editorPart).getEditingDomain();
			final List<EObject> selection = new ArrayList<EObject>();
			for (URI uri : instructionUris) {
				EObject eObject = domain.getResourceSet().getEObject(uri, false);
				if (eObject != null) {
					selection.add(eObject);
				}
			}
			if (!selection.isEmpty()) {
				((IViewerProvider)editorPart).getViewer().setSelection(
						new StructuredSelection(selection), true);
			} else {
				DebugIdeUiPlugin.getPlugin().log(
						new IllegalStateException("can't find source for " + instructionUris));
			}
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:30,代碼來源:EMFEditorUtils.java

示例3: run

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
@Override
public void run() {
	if (activeEditorPart instanceof IViewerProvider) {
		Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
		if (viewer != null) {
			viewer.refresh();
		}
	}
}
 
開發者ID:IncQueryLabs,項目名稱:smarthome-cep-demonstrator,代碼行數:10,代碼來源:SmarthomeActionBarContributor.java

示例4: run

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
@Override
public void run ()
{
    if ( activeEditorPart instanceof IViewerProvider )
    {
        Viewer viewer = ( (IViewerProvider)activeEditorPart ).getViewer ();
        if ( viewer != null )
        {
            viewer.refresh ();
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:ProtocolActionBarContributor.java

示例5: run

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
@Override
public void run() {
	if (activeEditorPart instanceof IViewerProvider) {
		Viewer viewer = ((IViewerProvider) activeEditorPart)
				.getViewer();
		if (viewer != null) {
			viewer.refresh();
		}
	}
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:11,代碼來源:ChartActionBarContributor.java

示例6: run

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
@Override
public void run ()
{
    if ( ChartActionBarContributor.this.activeEditorPart instanceof IViewerProvider )
    {
        final Viewer viewer = ( (IViewerProvider)ChartActionBarContributor.this.activeEditorPart ).getViewer ();
        if ( viewer != null )
        {
            viewer.refresh ();
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:ChartActionBarContributor.java

示例7: run

import org.eclipse.emf.common.ui.viewer.IViewerProvider; //導入依賴的package包/類
@Override
public void run ()
{
    if ( activeEditorPart instanceof IViewerProvider )
    {
        Viewer viewer = ( (IViewerProvider)activeEditorPart ).getViewer ();
        if ( viewer != null )
        {
            viewer.refresh ( );
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:DeploymentActionBarContributor.java


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