Coverage for src/robotide/editor/editordialogs.py: 57%

408 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-05-06 10:40 +0100

1# Copyright 2008-2015 Nokia Networks 

2# Copyright 2016- Robot Framework Foundation 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, 

12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

13# See the License for the specific language governing permissions and 

14# limitations under the License. 

15 

16import builtins 1ab

17import wx 1ab

18 

19from wx import Colour 1ab

20from .. import utils 1ab

21from ..namespace.suggesters import ResourceSuggester, LibrariesSuggester, HistorySuggester 1ab

22from ..validators import (ScalarVariableNameValidator, ListVariableNameValidator, TimeoutValidator, ArgumentsValidator, 1ab

23 TestCaseNameValidator, UserKeywordNameValidator, DictionaryVariableNameValidator) 

24from ..widgets import HelpLabel, RIDEDialog, ButtonWithHandler 1ab

25from .dialoghelps import get_help 1ab

26from .fieldeditors import (ValueEditor, ListValueEditor, MultiLineEditor, ContentAssistEditor, VariableNameEditor, 1ab

27 ArgumentEditor, FileNameEditor) 

28from .formatters import ListToStringFormatter 1ab

29from robotide.lib.compat.parsing import language 1ab

30 

31_ = wx.GetTranslation # To keep linter/code analyser happy 1ab

32builtins.__dict__['_'] = wx.GetTranslation 1ab

33 

34FORCE_TAGS = 'Force Tags' 1ab

35DEFAULT_TAGS = 'Default Tags' 1ab

36TEST_TAGS = 'Test Tags' 1ab

37SUITE_SETUP = 'Suite Setup' 1ab

38SUITE_TEAR = 'Suite Teardown' 1ab

39TEST_SETUP = 'Test Setup' 1ab

40TEST_TEAR = 'Test Teardown' 1ab

41RET_VAL = 'Return Value' 1ab

42TEST_TEMPL = 'Test Template' 1ab

43 

44def editor_dialog(obj, lang='en'): 1ab

45 set_lang = lang if lang and len(lang) > 0 else 'en' 

46 english_label = language.get_english_label(set_lang, obj.label).replace('Task', 'Test') 

47 # print(f"DEBUG: editordialogs.py editor_dialog object name={obj.label} english_label={english_label}" 

48 # f"lang={lang} ") 

49 return globals()[english_label.replace(' ', '') + 'Dialog'] 

50 

51 

52class _Dialog(RIDEDialog): 1ab

53 _title_nt = '' # DEBUG: property(lambda self: utils.name_from_class(self, drop='Dialog')) 1ab

54 _title = '' 1ab

55 

56 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

57 # DEBUG: Get rid of item, everything should be in controller 

58 if not title: 58 ↛ 59line 58 didn't jump to line 59 because the condition on line 58 was never true1pkhiqrljcdefgmno

59 title = self._title 

60 RIDEDialog.__init__(self, title) 1pkhiqrljcdefgmno

61 # set Left to Right direction (while we don't have localization) 

62 self.SetLayoutDirection(wx.Layout_LeftToRight) 1pkhiqrljcdefgmno

63 self.SetExtraStyle(wx.WS_EX_VALIDATE_RECURSIVELY) 1pkhiqrljcdefgmno

64 self._controller = controller 1pkhiqrljcdefgmno

65 self.plugin = plugin 1pkhiqrljcdefgmno

66 self._sizer = wx.BoxSizer(wx.VERTICAL) 1pkhiqrljcdefgmno

67 self._editors = self._get_editors(item) 1pkhiqrljcdefgmno

68 for editor in self._editors: 1pkhiqrljcdefgmno

69 self._sizer.Add(editor, editor.expand_factor, wx.EXPAND) 1pkhiqrljcdefgmno

70 self._add_comment_editor(item) 1pkhiqrljcdefgmno

71 self._create_help() 1pkhiqrljcdefgmno

72 self._create_line() 1pkhiqrljcdefgmno

73 self._create_buttons() 1pkhiqrljcdefgmno

74 self.SetSizer(self._sizer) 1pkhiqrljcdefgmno

75 self._sizer.Fit(self) 1pkhiqrljcdefgmno

76 self.Layout() 1pkhiqrljcdefgmno

77 self._editors[0].set_focus() 1pkhiqrljcdefgmno

78 

79 def _add_comment_editor(self, item): 1ab

80 comment = ListToStringFormatter(item.comment).value if item else '' 

81 self._comment_editor = ValueEditor(self, comment, _('Comment')) 

82 self._sizer.Add(self._comment_editor) 

83 

84 def _create_line(self): 1ab

85 line = wx.StaticLine(self, size=(20, -1), style=wx.LI_HORIZONTAL) 1pkhiqrljcdefgmno

86 if wx.VERSION < (4, 1, 0): 86 ↛ 87line 86 didn't jump to line 87 because the condition on line 86 was never true1pkhiqrljcdefgmno

87 self._sizer.Add(line, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5) 

88 else: 

89 self._sizer.Add(line, 0, wx.GROW | wx.RIGHT | wx.TOP, 5) 1pkhiqrljcdefgmno

90 self._sizer.Fit(self) 1pkhiqrljcdefgmno

91 

92 def _create_help(self): 1ab

93 self._sizer.Add(HelpLabel(self, label=get_help(self._title_nt)), flag=wx.ALL, border=2) 1pkhiqrljcdefgmno

94 self._sizer.Fit(self) 1pkhiqrljcdefgmno

95 

96 def _create_buttons(self, **kwargs): 1ab

97 buttons = self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL) 1pkhiqrljcdefgmno

98 self.SetBackgroundColour(Colour(self.color_background)) 1pkhiqrljcdefgmno

99 self.SetForegroundColour(Colour(self.color_foreground)) 1pkhiqrljcdefgmno

100 for item in self.GetChildren(): 1pkhiqrljcdefgmno

101 if isinstance(item, (wx.Button, wx.BitmapButton, ButtonWithHandler)): 1pkhiqrljcdefgmno

102 item.SetBackgroundColour(Colour(self.color_secondary_background)) 1pkhiqrljcdefgmno

103 # item.SetOwnBackgroundColour(Colour(self.color_secondary_background)) 

104 item.SetForegroundColour(Colour(self.color_secondary_foreground)) 1pkhiqrljcdefgmno

105 # item.SetOwnForegroundColour(Colour(self.color_secondary_foreground)) 

106 self._sizer.Add(buttons, 0, wx.ALIGN_CENTER | wx.ALL, 5) 1pkhiqrljcdefgmno

107 self._sizer.Fit(self) 1pkhiqrljcdefgmno

108 

109 def get_value(self): 1ab

110 return [e.get_value() for e in self._editors] 1hicdefg

111 

112 def get_comment(self): 1ab

113 return self._comment_editor.get_value() 

114 

115 def setFocusToOK(self): 1ab

116 self.FindWindowById(wx.ID_OK).SetFocus() 

117 

118 def _execute(self): 1ab

119 """ Just ignore it """ 

120 pass 

121 

122 def _get_editors(self, item): 1ab

123 """ Just ignore it """ 

124 pass 

125 

126 

127class ScalarVariableDialog(_Dialog): 1ab

128 _title_nt = 'Scalar Variable' 1ab

129 

130 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

131 __ = title 

132 self._title = _('Scalar Variable') 

133 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

134 

135 def _get_editors(self, var): 1ab

136 name = var.name if var and var.name else '${}' 

137 value = utils.join_value(var.value) if var else '' 

138 # print(f"DEBUG: editor.editordialogs.py ScalarVariableDialog _get_editors value={value}") 

139 validator = ScalarVariableNameValidator(self._controller, name) 

140 return [VariableNameEditor(self, name, _('Name'), validator), ValueEditor(self, value, _('Value'), split=True)] 

141 

142 def _execute(self): 1ab

143 """ Just ignore it """ 

144 pass 

145 

146 

147class ListVariableDialog(_Dialog): 1ab

148 _title_nt = 'List Variable' 1ab

149 

150 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

151 __ = title 

152 self._title = _('List Variable') 

153 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

154 

155 def _get_editors(self, var): 1ab

156 name = var.name if var and var.name else '@{}' 

157 value = var.value if var and var.value else '' 

158 validator = ListVariableNameValidator(self._controller, name) 

159 return [VariableNameEditor(self, name, _('Name'), validator), 

160 ListValueEditor(self, value, _('Value'), settings=self.plugin.global_settings)] 

161 

162 def _execute(self): 1ab

163 """ Just ignore it """ 

164 pass 

165 

166 

167class DictionaryVariableDialog(_Dialog): 1ab

168 _title_nt = 'Dictionary Variable' 1ab

169 

170 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

171 __ = title 

172 self._title = _('Dictionary Variable') 

173 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

174 

175 def _get_editors(self, var): 1ab

176 name = var.name if var and var.name else '&{}' 

177 value = var.value if var and var.value else '' 

178 validator = DictionaryVariableNameValidator(self._controller, name) 

179 return [VariableNameEditor(self, name, _('Name'), validator), 

180 ListValueEditor(self, value, _('Value'), settings=self.plugin.global_settings)] 

181 

182 def _execute(self): 1ab

183 """ Just ignore it """ 

184 pass 

185 

186 

187class LibraryDialog(_Dialog): 1ab

188 

189 _history_suggester = HistorySuggester() 1ab

190 

191 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Library'): 1ab

192 __ = title 

193 if title: 

194 self._title = title 

195 else: 

196 self._title = _('Library') 

197 self._title_nt = title_nt 

198 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

199 

200 def _get_editors(self, item): 1ab

201 name = item and item.name or '' 

202 args = item and utils.join_value(item.args) or '' 

203 alias = item.alias if item else '' 

204 self._suggester = LibrariesSuggester(self._controller, self._history_suggester) 

205 return [FileNameEditor(self, name, _('Name'), self._controller, suggestion_source=self._suggester), 

206 ValueEditor(self, args, _('Args')), ValueEditor(self, alias, _('Alias'))] 

207 

208 def get_value(self): 1ab

209 values = _Dialog.get_value(self) 

210 self._history_suggester.store(values[0]) 

211 return values 

212 

213 def _execute(self): 1ab

214 """ Just ignore it """ 

215 pass 

216 

217 

218class VariablesDialog(LibraryDialog): 1ab

219 _title_nt = 'Variables' 1ab

220 

221 _history_suggester = HistorySuggester() 1ab

222 

223 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Variables'): 1ab

224 __ = title 

225 self._title = _('Variables') 

226 LibraryDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

227 

228 def _get_editors(self, item): 1ab

229 path = item and item.name or '' 

230 args = item and utils.join_value(item.args) or '' 

231 return [FileNameEditor(self, path, _('Path'), self._controller, suggestion_source=self._history_suggester), 

232 ValueEditor(self, args, _('Args'))] 

233 

234 def _execute(self): 1ab

235 """ Just ignore it """ 

236 pass 

237 

238 

239class ResourceDialog(_Dialog): 1ab

240 _title_nt = 'Resource' 1ab

241 

242 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

243 __ = title 

244 self._title = _('Resource') 

245 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

246 

247 def _get_editors(self, item): 1ab

248 name = item and item.name or '' 

249 return [FileNameEditor(self, name, _('Path'), self._controller, 

250 suggestion_source=ResourceSuggester(self._controller))] 

251 

252 def _execute(self): 1ab

253 """ Just ignore it """ 

254 pass 

255 

256 

257class DocumentationDialog(_Dialog): 1ab

258 _title_nt = 'Documentation' 1ab

259 

260 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

261 __ = title 

262 self._title = _('Documentation') 

263 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

264 

265 def _get_editors(self, doc): 1ab

266 return [MultiLineEditor(self, doc)] 

267 

268 def _add_comment_editor(self, item): 1ab

269 """ Just ignore it """ 

270 pass 

271 

272 def get_value(self): 1ab

273 return _Dialog.get_value(self) 

274 

275 def get_comment(self): 1ab

276 return '' 

277 

278 def _execute(self): 1ab

279 """ Just ignore it """ 

280 pass 

281 

282 

283class _SettingDialog(_Dialog): 1ab

284 _validator = None 1ab

285 

286 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=None): 1ab

287 __ = title 

288 if title: 

289 self._title = title 

290 else: 

291 self._title = '' 

292 self._title_nt = title_nt 

293 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

294 

295 def _get_editors(self, item): 1ab

296 editor = ValueEditor(self, item.value) 

297 if self._validator: 

298 editor.set_validator(self._validator()) 

299 return [editor] 

300 

301 def _execute(self): 1ab

302 """ Just ignore it """ 

303 pass 

304 

305 

306class ForceTagsDialog(_SettingDialog): 1ab

307 _title_nt = FORCE_TAGS 1ab

308 

309 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=FORCE_TAGS): 1ab

310 __ = title 

311 self._title = _(FORCE_TAGS) 

312 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

313 

314 def _execute(self): 1ab

315 """ Just ignore it """ 

316 pass 

317 

318 

319class DefaultTagsDialog(_SettingDialog): 1ab

320 _title_nt = DEFAULT_TAGS 1ab

321 

322 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=DEFAULT_TAGS): 1ab

323 __ = title 

324 self._title = _(DEFAULT_TAGS) 

325 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

326 

327 def _execute(self): 1ab

328 """ Just ignore it """ 

329 pass 

330 

331 

332class TestTagsDialog(_SettingDialog): 1ab

333 _title_nt = TEST_TAGS 1ab

334 

335 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_TAGS): 1ab

336 __ = title 

337 self._title = _(TEST_TAGS) 

338 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

339 

340 def _execute(self): 1ab

341 """ Just ignore it """ 

342 pass 

343 

344 

345class TagsDialog(_SettingDialog): 1ab

346 _title_nt = 'Tags' 1ab

347 

348 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Tags'): 1ab

349 __ = title 

350 self._title = _('Tags') 

351 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

352 

353 def _execute(self): 1ab

354 """ Just ignore it """ 

355 pass 

356 

357 

358class _FixtureDialog(_SettingDialog): 1ab

359 

360 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=None): 1ab

361 __ = title 

362 if title: 

363 self._title = title 

364 else: 

365 self._title = '' 

366 self._title_nt = title_nt 

367 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

368 

369 def _get_editors(self, item): 1ab

370 return [ContentAssistEditor(self, item.value)] 

371 

372 def _execute(self): 1ab

373 """ Just ignore it """ 

374 pass 

375 

376 

377class SuiteSetupDialog(_FixtureDialog): 1ab

378 tooltip = _("Suite Setup is run before any tests") 1ab

379 _title_nt = SUITE_SETUP 1ab

380 

381 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=SUITE_SETUP): 1ab

382 __ = title 

383 self._title = _(SUITE_SETUP) 

384 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

385 

386 def _execute(self): 1ab

387 """ Just ignore it """ 

388 pass 

389 

390 

391class SuiteTeardownDialog(_FixtureDialog): 1ab

392 _title_nt = SUITE_TEAR 1ab

393 

394 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=SUITE_TEAR): 1ab

395 __ = title 

396 self._title = _(SUITE_TEAR) 

397 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

398 

399 def _execute(self): 1ab

400 """ Just ignore it """ 

401 pass 

402 

403 

404class TestSetupDialog(_FixtureDialog): 1ab

405 __test__ = False 1ab

406 _title_nt = TEST_SETUP 1ab

407 

408 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_SETUP): 1ab

409 __ = title 

410 self._title = _(TEST_SETUP) 

411 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

412 

413 def _execute(self): 1ab

414 """ Just ignore it """ 

415 pass 

416 

417 

418class TestTeardownDialog(_FixtureDialog): 1ab

419 __test__ = False 1ab

420 _title_nt = TEST_TEAR 1ab

421 

422 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_TEAR): 1ab

423 __ = title 

424 self._title = _(TEST_TEAR) 

425 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

426 

427 def _execute(self): 1ab

428 """ Just ignore it """ 

429 pass 

430 

431 

432class SetupDialog(_FixtureDialog): 1ab

433 _title_nt = 'Setup' 1ab

434 

435 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Setup'): 1ab

436 __ = title 

437 self._title = _('Setup') 

438 # print(f"DEBUG: editordialogs.py SetupDialog ENTER item={item}") 

439 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

440 

441 def _execute(self): 1ab

442 """ Just ignore it """ 

443 pass 

444 

445 

446class TeardownDialog(_FixtureDialog): 1ab

447 _title_nt = 'Teardown' 1ab

448 

449 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Teardown'): 1ab

450 __ = title 

451 self._title = _('Teardown') 

452 # print(f"DEBUG: editordialogs.py TeardownDialog ENTER item={item}") 

453 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

454 

455 def _execute(self): 1ab

456 """ Just ignore it """ 

457 pass 

458 

459 

460class TemplateDialog(_FixtureDialog): 1ab

461 _title_nt = 'Template' 1ab

462 

463 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Template'): 1ab

464 __ = title 

465 self._title = _('Template') 

466 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

467 

468 def _execute(self): 1ab

469 """ Just ignore it """ 

470 pass 

471 

472 

473class TestTemplateDialog(_FixtureDialog): 1ab

474 __test__ = False 1ab

475 _title_nt = TEST_TEMPL 1ab

476 

477 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=TEST_TEMPL): 1ab

478 __ = title 

479 self._title = _(TEST_TEMPL) 

480 _FixtureDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

481 

482 def _execute(self): 1ab

483 """ Just ignore it """ 

484 pass 

485 

486 

487class ArgumentsDialog(_SettingDialog): 1ab

488 _title_nt = 'Arguments' 1ab

489 

490 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Arguments'): 1ab

491 __ = title 

492 self._title = _('Arguments') 

493 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

494 

495 def _get_editors(self, item): 1ab

496 return [ArgumentEditor(self, item.value, _('Arguments'), ArgumentsValidator())] 

497 

498 def _execute(self): 1ab

499 """ Just ignore it """ 

500 pass 

501 

502 

503class ReturnValueDialog(_SettingDialog): 1ab

504 _title_nt = RET_VAL 1ab

505 

506 def __init__(self, controller, item=None, plugin=None, title=None, title_nt=RET_VAL): 1ab

507 __ = title 

508 self._title = _(RET_VAL) 

509 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

510 

511 def _execute(self): 1ab

512 """ Just ignore it """ 

513 pass 

514 

515 

516class TestTimeoutDialog(_SettingDialog): 1ab

517 __test__ = False 1ab

518 _validator = TimeoutValidator 1ab

519 

520 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Test Timeout'): 1ab

521 __ = title 

522 if title: 

523 self._title = title 

524 else: 

525 self._title = _('Test Timeout') 

526 self._title_nt = title_nt 

527 _SettingDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

528 

529 def _execute(self): 1ab

530 """ Just ignore it """ 

531 pass 

532 

533 

534class TimeoutDialog(TestTimeoutDialog): 1ab

535 _title_nt = 'Timeout' 1ab

536 

537 def __init__(self, controller, item=None, plugin=None, title=None, title_nt='Timeout'): 1ab

538 __ = title 

539 self._title = _('Timeout') 

540 TestTimeoutDialog.__init__(self, controller, item=item, plugin=plugin, title=self._title, title_nt=title_nt) 

541 

542 def _execute(self): 1ab

543 """ Just ignore it """ 

544 pass 

545 

546 

547class MetadataDialog(_Dialog): 1ab

548 _title_nt = 'Metadata' 1ab

549 

550 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

551 __ = title 

552 self._title = _('Metadata') 

553 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

554 

555 def _get_editors(self, item): 1ab

556 name, value = item and (item.name, item.value) or ('', '') 

557 return [ValueEditor(self, name, _('Name')), 

558 ValueEditor(self, value, _('Value'))] 

559 

560 def _execute(self): 1ab

561 """ Just ignore it """ 

562 pass 

563 

564 

565class TestCaseNameDialog(_Dialog): 1ab

566 __test__ = False 1ab

567 _title_nt = 'New Test Case' 1ab

568 

569 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

570 __ = title 1pkhiqr

571 self._title = _('New Test Case') 1pkhiqr

572 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 1pkhiqr

573 

574 def _add_comment_editor(self, item): 1ab

575 """ Just ignore it """ 

576 pass 1pkhiqr

577 

578 def _get_editors(self, test): 1ab

579 value = test.name if test else '' 1pkhiqr

580 return [ValueEditor(self, value, _('Name'), 1pkhiqr

581 TestCaseNameValidator(self._controller))] 

582 

583 def get_name(self): 1ab

584 return _Dialog.get_value(self)[0] 1hi

585 

586 def _execute(self): 1ab

587 """ Just ignore it """ 

588 pass 1k

589 

590 

591class CopyUserKeywordDialog(_Dialog): 1ab

592 _title_nt = 'Copy User Keyword' 1ab

593 

594 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

595 __ = title 

596 self._title = _('Copy User Keyword') 

597 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 

598 

599 def _add_comment_editor(self, item): 1ab

600 """ Just ignore it """ 

601 pass 

602 

603 def _get_editors(self, uk): 1ab

604 value = uk.name if uk else '' 

605 return [ValueEditor(self, value, _('Name'), 

606 UserKeywordNameValidator(self._controller))] 

607 

608 def get_name(self): 1ab

609 return _Dialog.get_value(self)[0] 

610 

611 def _execute(self): 1ab

612 """ Just ignore it """ 

613 pass 

614 

615 

616class UserKeywordNameDialog(_Dialog): 1ab

617 def _execute(self): 1ab

618 """ Just ignore it """ 

619 pass 1j

620 

621 _title_nt = 'New User Keyword' 1ab

622 

623 def __init__(self, controller, item=None, plugin=None, title=None): 1ab

624 __ = title 1ljcdefgmno

625 self._title = _('New User Keyword') 1ljcdefgmno

626 _Dialog.__init__(self, controller, item=item, plugin=plugin, title=self._title) 1ljcdefgmno

627 

628 def _add_comment_editor(self, item): 1ab

629 """ Just ignore it """ 

630 pass 1ljcdefgmno

631 

632 def _get_editors(self, uk): 1ab

633 value = uk.name if uk else '' 1ljcdefgmno

634 args_value = ' | '.join(uk.args.value) if uk else '' 1ljcdefgmno

635 return [ValueEditor(self, value, _('Name'), 1ljcdefgmno

636 UserKeywordNameValidator(self._controller)), 

637 ArgumentEditor(self, args_value, _('Arguments'), ArgumentsValidator())] 

638 

639 def get_name(self): 1ab

640 return _Dialog.get_value(self)[0] 1fg

641 

642 def get_args(self): 1ab

643 return _Dialog.get_value(self)[1] 1cde