/** * First tries to find a suitable instance to reuse for the given context, * then creates a new instance if necessary. * * @param event * @return an instance for the given context * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart activePart = HandlerUtil.getActivePartChecked(event); PropertyShowInContext context = getShowInContext(event); try { PropertySheet sheet = findPropertySheet(event, context); sheet.show(context); if (activePart instanceof PropertySheet) { PropertySheet parent = (PropertySheet) activePart; parent.setPinned(true); } else if(!sheet.isPinned()) { sheet.setPinned(PIN_NEW_PROPERTY_VIEW); } } catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ } return null; }
/** * First tries to find a suitable instance to reuse for the given context, * then creates a new instance if necessary. * * @param event * @return an instance for the given context * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart activePart = HandlerUtil.getActivePartChecked(event); PropertyShowInContext context = getShowInContext(event); try { PropertySheet sheet = findPropertySheet(event, context); sheet.show(context); if (activePart instanceof PropertySheet) { PropertySheet parent = (PropertySheet) activePart; parent.setPinned(true); } else if(!sheet.isPinned()) { sheet.setPinned(PIN_NEW_PROPERTY_VIEW); } } catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ } return null; }