private void addCabalImplementation() { IStructuredSelection prev = (IStructuredSelection) getSelection(); CabalImplementationDialog dialog = new CabalImplementationDialog(table.getShell(), null); dialog.setTitle(UITexts.cabalImplsBlock_dlgAdd); if (dialog.open() == Window.OK) { CabalImplementation impl = dialog.getResult(); if (validateImpl(impl)) { add(impl); viewer.setInput(impl); viewer.refresh(); } autoSelectSingle(prev); } }
private void editCabalImplementation() { IStructuredSelection prev = (IStructuredSelection) getSelection(); int selected = table.getSelectionIndex(); if (selected >= 0) { CabalImplementation impl = impls.get(selected); String implIdent = impl.getUserIdentifier(); CabalImplementationDialog dialog = new CabalImplementationDialog(table.getShell(), impl); dialog.setTitle(UITexts.cabalImplsBlock_dlgEdit); if (dialog.open() == Window.OK) { CabalImplementation updatedImpl = dialog.getResult(); if (validateImpl(updatedImpl)) { update(implIdent, updatedImpl); setCheckedCabalImplementation(updatedImpl.getUserIdentifier()); viewer.setInput(impl); } viewer.refresh(); autoSelectSingle(prev); } } }