use of org.eclipse.wst.wsdl.ui.internal.actions.OpenInNewEditor in project tesb-studio-se by Talend.
the class LocalWSDLEditor method createActions.
@Override
protected void createActions() {
super.createActions();
ActionRegistry registry = getActionRegistry();
BaseSelectionAction action = new OpenInNewEditor(this) {
@Override
public void run() {
if (getSelectedObjects().size() > 0) {
Object o = getSelectedObjects().get(0);
// should make this generic and be able to get the owner from a facade object
if (o instanceof WSDLBaseAdapter) {
WSDLBaseAdapter baseAdapter = (WSDLBaseAdapter) o;
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
Object object = editorPart.getAdapter(org.eclipse.wst.wsdl.Definition.class);
if (object instanceof org.eclipse.wst.wsdl.Definition) {
EObject eObject = (EObject) baseAdapter.getTarget();
OpenOnSelectionHelper openHelper = new OpenOnSelectionHelper((org.eclipse.wst.wsdl.Definition) object);
openHelper.openEditor(eObject);
}
}
}
}
};
action.setSelectionProvider(getSelectionManager());
registry.registerAction(action);
}
Aggregations