本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}