本文整理匯總了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));
}
}
}
}
示例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));
}
}
}
}
示例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();
}
}
}
示例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 ();
}
}
}
示例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();
}
}
}
示例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 ();
}
}
}
示例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 ( );
}
}
}