public static void showRealPropertyDetails(AccountEditor editor, RealProperty property) throws PartInitException { /* * This may not be the best way. Inputs are not set for the editors within * the multi-page editor, so they all match the input for the containing editor. * We then look through and test the class implementation. */ IEditorPart realPropertyDetailsEditor = null; IEditorPart[] editors = editor.findEditors(editor.getEditorInput()); for (IEditorPart childEditor : editors) { if (childEditor instanceof AssetDetailsEditor) { AssetDetailsEditor eachEditor = (AssetDetailsEditor) childEditor; if (eachEditor.getAsset() == property) { realPropertyDetailsEditor = eachEditor; break; } } } if (realPropertyDetailsEditor == null) { realPropertyDetailsEditor = new AssetDetailsEditor(property); editor.addPage(realPropertyDetailsEditor, property.getName()); } editor.setActiveEditor(realPropertyDetailsEditor); }
public Object execute(ExecutionEvent event) throws ExecutionException { Shell shell = HandlerUtil.getActiveShellChecked(event); AccountEditorInput cInput = (AccountEditorInput) editor.getEditorInput(); DatastoreManager sessionManager = (DatastoreManager) editor.getSite().getPage().getInput(); Account account = sessionManager.getSession().getAccountByFullName(cInput.getFullAccountName()); RealPropertyAccount stockAccount = (RealPropertyAccount) account; // TODO: complete this return null; }