protected void clickAddButton(Shell shell, TableViewer tv) { CurrencyInputDialog d = new CurrencyInputDialog(shell); int open = d.open(); if (CurrencyInputDialog.OK == open) { CompositeMap m = CurrencySetting.createMap(d.getCurrency_type(), d.getUnit()); getTableInput().add(m); setInput(tv); } }
protected void clickEditButton(Shell shell, TableViewer tv) { ISelection s = tv.getSelection(); if (s instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) s; if (ss.isEmpty()) return; CompositeMap firstElement = (CompositeMap) ss.getFirstElement(); CurrencyInputDialog d = new CurrencyInputDialog(shell); d.setCurrency_type(this.getCurType(firstElement)); d.setUnit(this.getUnit(firstElement)); int open = d.open(); if (CurrencyInputDialog.OK == open) { CompositeMap m = CurrencySetting.createMap(d.getCurrency_type(), d.getUnit()); firstElement.put("currency_type", this.getCurType(m)); // $NON-NLS-1$ firstElement.put("unit", this.getUnit(m)); // $NON-NLS-1$ setInput(tv); } } }