当前位置: 首页>>代码示例>>Java>>正文


Java DiagramEditor.getAdapter方法代码示例

本文整理汇总了Java中org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.getAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java DiagramEditor.getAdapter方法的具体用法?Java DiagramEditor.getAdapter怎么用?Java DiagramEditor.getAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor的用法示例。


在下文中一共展示了DiagramEditor.getAdapter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof StatemachineAbstractNavigatorItem) {
		return;
	}

	StatemachineAbstractNavigatorItem abstractNavigatorItem = (StatemachineAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof StatemachineNavigatorItem) {
		navigatorView = ((StatemachineNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof StatemachineNavigatorGroup) {
		StatemachineNavigatorGroup navigatorGroup = (StatemachineNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof StatemachineNavigatorItem) {
			navigatorView = ((StatemachineNavigatorItem) navigatorGroup
					.getParent()).getView();
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:53,代码来源:StatemachineNavigatorLinkHelper.java

示例2: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {

	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof DomainNavigatorItem) {
		return;
	}

	DomainNavigatorItem abstractNavigatorItem = (DomainNavigatorItem) aSelection
			.getFirstElement();

	View navigatorView = abstractNavigatorItem.getView();
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
			graphicalViewer.reveal(selectedEditPart);
		}
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:43,代码来源:NavigatorLinkHelper.java

示例3: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof SmcAbstractNavigatorItem) {
		return;
	}

	SmcAbstractNavigatorItem abstractNavigatorItem = (SmcAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof SmcNavigatorItem) {
		navigatorView = ((SmcNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof SmcNavigatorGroup) {
		SmcNavigatorGroup navigatorGroup = (SmcNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof SmcNavigatorItem) {
			navigatorView = ((SmcNavigatorItem) navigatorGroup.getParent())
					.getView();
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:53,代码来源:SmcNavigatorLinkHelper.java

示例4: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof Wc2014AbstractNavigatorItem) {
		return;
	}

	Wc2014AbstractNavigatorItem abstractNavigatorItem = (Wc2014AbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof Wc2014NavigatorItem) {
		navigatorView = ((Wc2014NavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof Wc2014NavigatorGroup) {
		Wc2014NavigatorGroup navigatorGroup = (Wc2014NavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof Wc2014NavigatorItem) {
			navigatorView = ((Wc2014NavigatorItem) navigatorGroup
					.getParent()).getView();
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:53,代码来源:Wc2014NavigatorLinkHelper.java

示例5: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof SimpleBPMN.diagram.navigator.SimpleBPMNAbstractNavigatorItem) {
		return;
	}

	SimpleBPMN.diagram.navigator.SimpleBPMNAbstractNavigatorItem abstractNavigatorItem = (SimpleBPMN.diagram.navigator.SimpleBPMNAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorItem) {
		navigatorView = ((SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorGroup) {
		SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorGroup navigatorGroup = (SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorItem) {
			navigatorView = ((SimpleBPMN.diagram.navigator.SimpleBPMNNavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent())
					.getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:56,代码来源:SimpleBPMNNavigatorLinkHelper.java

示例6: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
* @generated
*/
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection
			.getFirstElement() instanceof edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVOAbstractNavigatorItem) {
		return;
	}

	edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVOAbstractNavigatorItem abstractNavigatorItem = (edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVOAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorItem) {
		navigatorView = ((edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorItem) abstractNavigatorItem)
				.getView();
	} else
		if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorGroup) {
		edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorGroup navigatorGroup = (edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup
				.getParent() instanceof edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorItem) {
			navigatorView = ((edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.navigator.ICSE15_SequenceDiagram_MAVONavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent()).getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:53,代码来源:ICSE15_SequenceDiagram_MAVONavigatorLinkHelper.java

示例7: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramAbstractNavigatorItem) {
		return;
	}

	edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramAbstractNavigatorItem abstractNavigatorItem = (edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem) {
		navigatorView = ((edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorGroup) {
		edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorGroup navigatorGroup = (edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem) {
			navigatorView = ((edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent())
					.getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:56,代码来源:NECSIS14_ClassDiagramNavigatorLinkHelper.java

示例8: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaAbstractNavigatorItem) {
		return;
	}

	edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaAbstractNavigatorItem abstractNavigatorItem = (edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorItem) {
		navigatorView = ((edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorGroup) {
		edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorGroup navigatorGroup = (edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorItem) {
			navigatorView = ((edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.navigator.NECSIS14_DatabaseSchemaNavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent())
					.getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:56,代码来源:NECSIS14_DatabaseSchemaNavigatorLinkHelper.java

示例9: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof MIDAbstractNavigatorItem) {
		return;
	}

	MIDAbstractNavigatorItem abstractNavigatorItem = (MIDAbstractNavigatorItem) aSelection.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof MIDNavigatorItem) {
		navigatorView = ((MIDNavigatorItem) abstractNavigatorItem).getView();
	}
	else if (abstractNavigatorItem instanceof MIDNavigatorGroup) {
		MIDNavigatorGroup navigatorGroup = (MIDNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof MIDNavigatorItem) {
			navigatorView = ((MIDNavigatorItem) navigatorGroup.getParent()).getView();
		}
		else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent()).getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:49,代码来源:MIDNavigatorLinkHelper.java

示例10: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
* @generated
*/
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof MIDAbstractNavigatorItem) {
		return;
	}

	MIDAbstractNavigatorItem abstractNavigatorItem = (MIDAbstractNavigatorItem) aSelection.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof MIDNavigatorItem) {
		navigatorView = ((MIDNavigatorItem) abstractNavigatorItem).getView();
	} else if (abstractNavigatorItem instanceof MIDNavigatorGroup) {
		MIDNavigatorGroup navigatorGroup = (MIDNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof MIDNavigatorItem) {
			navigatorView = ((MIDNavigatorItem) navigatorGroup.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent()).getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:47,代码来源:MIDNavigatorLinkHelper.java

示例11: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
* @generated
*/
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection
			.getFirstElement() instanceof edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVOAbstractNavigatorItem) {
		return;
	}

	edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVOAbstractNavigatorItem abstractNavigatorItem = (edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVOAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorItem) {
		navigatorView = ((edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorItem) abstractNavigatorItem)
				.getView();
	} else
		if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorGroup) {
		edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorGroup navigatorGroup = (edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup
				.getParent() instanceof edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorItem) {
			navigatorView = ((edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.navigator.RelationalDatabase_MAVONavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent()).getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:53,代码来源:RelationalDatabase_MAVONavigatorLinkHelper.java

示例12: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof RelationalDatabaseAbstractNavigatorItem) {
		return;
	}

	RelationalDatabaseAbstractNavigatorItem abstractNavigatorItem = (RelationalDatabaseAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof RelationalDatabaseNavigatorItem) {
		navigatorView = ((RelationalDatabaseNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof RelationalDatabaseNavigatorGroup) {
		RelationalDatabaseNavigatorGroup navigatorGroup = (RelationalDatabaseNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof RelationalDatabaseNavigatorItem) {
			navigatorView = ((RelationalDatabaseNavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent())
					.getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:56,代码来源:RelationalDatabaseNavigatorLinkHelper.java

示例13: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
* @generated
*/
public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection
			.getFirstElement() instanceof edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVOAbstractNavigatorItem) {
		return;
	}

	edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVOAbstractNavigatorItem abstractNavigatorItem = (edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVOAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem) {
		navigatorView = ((edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem) abstractNavigatorItem)
				.getView();
	} else
		if (abstractNavigatorItem instanceof edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorGroup) {
		edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorGroup navigatorGroup = (edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup
				.getParent() instanceof edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem) {
			navigatorView = ((edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent()).getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:53,代码来源:IStar_MAVONavigatorLinkHelper.java

示例14: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof IStarAbstractNavigatorItem) {
		return;
	}

	IStarAbstractNavigatorItem abstractNavigatorItem = (IStarAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof IStarNavigatorItem) {
		navigatorView = ((IStarNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof IStarNavigatorGroup) {
		IStarNavigatorGroup navigatorGroup = (IStarNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof IStarNavigatorItem) {
			navigatorView = ((IStarNavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent())
					.getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:56,代码来源:IStarNavigatorLinkHelper.java

示例15: activateEditor

import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; //导入方法依赖的package包/类
/**
 * @generated
 */
public void activateEditor(IWorkbenchPage aPage,
		IStructuredSelection aSelection) {
	if (aSelection == null || aSelection.isEmpty()) {
		return;
	}
	if (false == aSelection.getFirstElement() instanceof StateMachineAbstractNavigatorItem) {
		return;
	}

	StateMachineAbstractNavigatorItem abstractNavigatorItem = (StateMachineAbstractNavigatorItem) aSelection
			.getFirstElement();
	View navigatorView = null;
	if (abstractNavigatorItem instanceof StateMachineNavigatorItem) {
		navigatorView = ((StateMachineNavigatorItem) abstractNavigatorItem)
				.getView();
	} else if (abstractNavigatorItem instanceof StateMachineNavigatorGroup) {
		StateMachineNavigatorGroup navigatorGroup = (StateMachineNavigatorGroup) abstractNavigatorItem;
		if (navigatorGroup.getParent() instanceof StateMachineNavigatorItem) {
			navigatorView = ((StateMachineNavigatorItem) navigatorGroup
					.getParent()).getView();
		} else if (navigatorGroup.getParent() instanceof IAdaptable) {
			navigatorView = (View) ((IAdaptable) navigatorGroup.getParent())
					.getAdapter(View.class);
		}
	}
	if (navigatorView == null) {
		return;
	}
	IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
	IEditorPart editor = aPage.findEditor(editorInput);
	if (editor == null) {
		return;
	}
	aPage.bringToTop(editor);
	if (editor instanceof DiagramEditor) {
		DiagramEditor diagramEditor = (DiagramEditor) editor;
		ResourceSet diagramEditorResourceSet = diagramEditor
				.getEditingDomain().getResourceSet();
		EObject selectedView = diagramEditorResourceSet.getEObject(
				EcoreUtil.getURI(navigatorView), true);
		if (selectedView == null) {
			return;
		}
		GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
				.getAdapter(GraphicalViewer.class);
		EditPart selectedEditPart = (EditPart) graphicalViewer
				.getEditPartRegistry().get(selectedView);
		if (selectedEditPart != null) {
			graphicalViewer.select(selectedEditPart);
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:56,代码来源:StateMachineNavigatorLinkHelper.java


注:本文中的org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.getAdapter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。