Revision 1066 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/composer/DefaultJScriptingComposer.java
DefaultJScriptingComposer.java | ||
---|---|---|
93 | 93 |
import org.gvsig.scripting.swing.impl.DefaultScriptingUIManager; |
94 | 94 |
import org.gvsig.scripting.swing.impl.JDialogContent; |
95 | 95 |
import org.gvsig.scripting.swing.impl.composer.DefaultJScriptingComposer.DefaultProblems.ProblemsTableMode.DefaultProblem; |
96 |
import org.gvsig.scripting.swing.impl.composer.editors.ScriptEditor; |
|
96 |
import org.gvsig.scripting.swing.impl.composer.editors.ScriptUnitEditor;
|
|
97 | 97 |
import org.gvsig.tools.ToolsLocator; |
98 | 98 |
import org.gvsig.tools.i18n.I18nManager; |
99 | 99 |
import org.gvsig.tools.observer.Observable; |
... | ... | |
115 | 115 |
*/ |
116 | 116 |
private static final long serialVersionUID = 1L; |
117 | 117 |
|
118 |
private static final Logger logger = LoggerFactory.getLogger(DefaultJScriptingComposer.class);
|
|
118 |
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultJScriptingComposer.class);
|
|
119 | 119 |
|
120 | 120 |
public static final int CLOSE_ACTION = 1; |
121 | 121 |
|
... | ... | |
146 | 146 |
|
147 | 147 |
private static final long serialVersionUID = -7353913671104893812L; |
148 | 148 |
|
149 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
149 | 150 |
public GoToLineAction() { |
150 | 151 |
super(uimanager.getTranslation("go_to_line_Xhorizontal_ellipsisX")); |
151 | 152 |
int c = getToolkit().getMenuShortcutKeyMask(); |
... | ... | |
186 | 187 |
|
187 | 188 |
private static final long serialVersionUID = -7840632153011361661L; |
188 | 189 |
|
190 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
189 | 191 |
public ShowFindDialogAction() { |
190 | 192 |
super(uimanager.getTranslation("find_Xhorizontal_ellipsisX")); |
191 | 193 |
int c = getToolkit().getMenuShortcutKeyMask(); |
... | ... | |
212 | 214 |
|
213 | 215 |
private static final long serialVersionUID = 7209167803487996060L; |
214 | 216 |
|
217 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
215 | 218 |
public ShowReplaceDialogAction() { |
216 | 219 |
super(uimanager.getTranslation("replace_Xhorizontal_ellipsisX")); |
217 | 220 |
int c = getToolkit().getMenuShortcutKeyMask(); |
... | ... | |
238 | 241 |
|
239 | 242 |
private static final long serialVersionUID = 6257776255757689286L; |
240 | 243 |
|
244 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
241 | 245 |
public LauncherAction() { |
242 | 246 |
super(uimanager.getTranslation("Launcher")); |
243 | 247 |
putValue(ACTION_COMMAND_KEY, "ShowLauncher"); |
... | ... | |
258 | 262 |
|
259 | 263 |
private static final long serialVersionUID = 2725549699989067383L; |
260 | 264 |
|
265 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
261 | 266 |
public SelectAllAction() { |
262 | 267 |
super(uimanager.getTranslation("Select_all")); |
263 |
putValue(Action.SMALL_ICON, uimanager.getIcon("edit-select-all")); |
|
268 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-edit-select-all"));
|
|
264 | 269 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Select_all")); |
265 | 270 |
putValue(ACTION_COMMAND_KEY, "DocumentSelectAll"); |
266 | 271 |
} |
... | ... | |
282 | 287 |
|
283 | 288 |
private static final long serialVersionUID = 8020393562984016720L; |
284 | 289 |
|
290 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
285 | 291 |
public PackageScriptAction() { |
286 | 292 |
super(uimanager.getTranslation("_Package_script")); |
287 |
putValue(Action.SMALL_ICON, uimanager.getIcon("package")); |
|
293 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-package"));
|
|
288 | 294 |
putValue(ACTION_COMMAND_KEY, "PackageScript"); |
289 | 295 |
} |
290 | 296 |
|
... | ... | |
299 | 305 |
|
300 | 306 |
private static final long serialVersionUID = -4928359535828269502L; |
301 | 307 |
|
308 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
302 | 309 |
public AboutAction() { |
303 | 310 |
super(uimanager.getTranslation("About_scripts_editor")); |
304 |
putValue(Action.SMALL_ICON, uimanager.getIcon("about")); |
|
311 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-about"));
|
|
305 | 312 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("About_scripts_editor")); |
306 | 313 |
putValue(ACTION_COMMAND_KEY, "About"); |
307 | 314 |
} |
... | ... | |
321 | 328 |
|
322 | 329 |
private static final long serialVersionUID = -8549655706085425411L; |
323 | 330 |
|
331 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
324 | 332 |
public CutAction() { |
325 | 333 |
super(uimanager.getTranslation("Cut")); |
326 |
putValue(Action.SMALL_ICON, uimanager.getIcon("edit-cut")); |
|
334 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-edit-cut"));
|
|
327 | 335 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Cut")); |
328 | 336 |
putValue(ACTION_COMMAND_KEY, "DocumentCut"); |
329 | 337 |
} |
... | ... | |
345 | 353 |
|
346 | 354 |
private static final long serialVersionUID = -6870773810752024874L; |
347 | 355 |
|
356 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
348 | 357 |
public CopyAction() { |
349 | 358 |
super(uimanager.getTranslation("Copy")); |
350 |
putValue(Action.SMALL_ICON, uimanager.getIcon("edit-copy")); |
|
359 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-edit-copy"));
|
|
351 | 360 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Copy")); |
352 | 361 |
putValue(ACTION_COMMAND_KEY, "DocumentCopy"); |
353 | 362 |
} |
... | ... | |
369 | 378 |
|
370 | 379 |
private static final long serialVersionUID = -5829551248494873061L; |
371 | 380 |
|
381 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
372 | 382 |
public PasteAction() { |
373 | 383 |
super(uimanager.getTranslation("Paste")); |
374 |
putValue(Action.SMALL_ICON, uimanager.getIcon("edit-paste")); |
|
384 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-edit-paste"));
|
|
375 | 385 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Paste")); |
376 | 386 |
putValue(ACTION_COMMAND_KEY, "DocumentPaste"); |
377 | 387 |
} |
... | ... | |
393 | 403 |
|
394 | 404 |
private static final long serialVersionUID = 9165363564675325925L; |
395 | 405 |
|
406 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
396 | 407 |
public ExitAction() { |
397 | 408 |
super(uimanager.getTranslation("Close")); |
398 |
putValue(Action.SMALL_ICON, uimanager.getIcon("exit")); |
|
409 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-exit"));
|
|
399 | 410 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Close")); |
400 | 411 |
putValue(ACTION_COMMAND_KEY, "CloseComposer"); |
401 | 412 |
} |
... | ... | |
416 | 427 |
|
417 | 428 |
private static final long serialVersionUID = -870379961486387727L; |
418 | 429 |
|
430 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
419 | 431 |
public SaveAction() { |
420 | 432 |
super(uimanager.getTranslation("Save")); |
421 | 433 |
int c = getToolkit().getMenuShortcutKeyMask(); |
422 | 434 |
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, c)); |
423 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-save")); |
|
435 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-save"));
|
|
424 | 436 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Save")); |
425 | 437 |
putValue(ACTION_COMMAND_KEY, "DocumentSave"); |
426 | 438 |
} |
... | ... | |
441 | 453 |
|
442 | 454 |
private static final long serialVersionUID = 4851968883766990149L; |
443 | 455 |
|
456 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
444 | 457 |
public RunAction() { |
445 | 458 |
super(uimanager.getTranslation("Run")); |
446 | 459 |
int c = getToolkit().getMenuShortcutKeyMask(); |
447 | 460 |
// putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); |
448 |
putValue(Action.SMALL_ICON, uimanager.getIcon("run")); |
|
461 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-run"));
|
|
449 | 462 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Run")); |
450 | 463 |
putValue(ACTION_COMMAND_KEY, "DocumentRun"); |
451 | 464 |
} |
... | ... | |
466 | 479 |
|
467 | 480 |
private static final long serialVersionUID = 4851968883766990149L; |
468 | 481 |
|
482 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
469 | 483 |
public SaveAndRunAction() { |
470 | 484 |
super(uimanager.getTranslation("Save and run")); |
471 | 485 |
int c = getToolkit().getMenuShortcutKeyMask(); |
472 | 486 |
putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); |
473 |
putValue(Action.SMALL_ICON, uimanager.getIcon("save_and_run"));
|
|
487 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-save-and-run"));
|
|
474 | 488 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Save and run")); |
475 | 489 |
putValue(ACTION_COMMAND_KEY, "DocumentSaveAndRun"); |
476 | 490 |
} |
... | ... | |
492 | 506 |
|
493 | 507 |
private static final long serialVersionUID = 3385142920283598457L; |
494 | 508 |
|
509 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
495 | 510 |
public CloseAllAction() { |
496 | 511 |
super(uimanager.getTranslation("Close_all_documents")); |
497 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-closeall")); |
|
512 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-closeall"));
|
|
498 | 513 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Close_all_documents")); |
499 | 514 |
putValue(ACTION_COMMAND_KEY, "CloseAll"); |
500 | 515 |
} |
... | ... | |
516 | 531 |
|
517 | 532 |
private static final long serialVersionUID = 4152188500446249755L; |
518 | 533 |
|
534 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
519 | 535 |
public CloseDocumentAction() { |
520 | 536 |
super(uimanager.getTranslation("Close_document")); |
521 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-close")); |
|
537 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-close"));
|
|
522 | 538 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Close_current_tab")); |
523 | 539 |
putValue(ACTION_COMMAND_KEY, "DocumentClose"); |
524 | 540 |
} |
... | ... | |
540 | 556 |
|
541 | 557 |
private static final long serialVersionUID = -7545333555439711068L; |
542 | 558 |
|
559 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
543 | 560 |
public ShowConsoleAction() { |
544 | 561 |
super(uimanager.getTranslation("Console")); |
545 |
putValue(Action.SMALL_ICON, uimanager.getIcon("show-console")); |
|
562 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-show-console"));
|
|
546 | 563 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Show_console_panel")); |
547 | 564 |
putValue(ACTION_COMMAND_KEY, "ShowConsole"); |
548 | 565 |
} |
... | ... | |
557 | 574 |
|
558 | 575 |
private static final long serialVersionUID = 5276964996914550830L; |
559 | 576 |
|
577 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
560 | 578 |
public ShowProblemsAction() { |
561 | 579 |
super(uimanager.getTranslation("Problems")); |
562 |
putValue(Action.SMALL_ICON, uimanager.getIcon("show-problems")); |
|
580 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-show-problems"));
|
|
563 | 581 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Show_problems_panel")); |
564 | 582 |
putValue(ACTION_COMMAND_KEY, "ShowProblems"); |
565 | 583 |
} |
... | ... | |
574 | 592 |
|
575 | 593 |
private static final long serialVersionUID = 5873598740133693862L; |
576 | 594 |
|
595 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
577 | 596 |
public ShowProjectsAction() { |
578 | 597 |
super(uimanager.getTranslation("Projects")); |
579 |
putValue(Action.SMALL_ICON, uimanager.getIcon("show-projects")); |
|
598 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-show-projects"));
|
|
580 | 599 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Show_projects_panel")); |
581 | 600 |
putValue(ACTION_COMMAND_KEY, "ShowProjects"); |
582 | 601 |
} |
... | ... | |
591 | 610 |
|
592 | 611 |
private static final long serialVersionUID = 7889613706183211620L; |
593 | 612 |
|
613 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
594 | 614 |
public NewDocumentAction() { |
595 | 615 |
super(uimanager.getTranslation("New")); |
596 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-add")); |
|
616 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-add"));
|
|
597 | 617 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("New")); |
598 | 618 |
putValue(ACTION_COMMAND_KEY, "DocumentNew"); |
599 | 619 |
} |
... | ... | |
603 | 623 |
try { |
604 | 624 |
scriptNew(); |
605 | 625 |
} catch (Exception e1) { |
606 |
logger.warn("Can't create a new document", e1);
|
|
626 |
LOGGER.warn("Can't create a new document", e1);
|
|
607 | 627 |
} |
608 | 628 |
} |
609 | 629 |
|
... | ... | |
613 | 633 |
|
614 | 634 |
private static final long serialVersionUID = 7889613706183211620L; |
615 | 635 |
|
636 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
616 | 637 |
public NewFolderAction() { |
617 | 638 |
super(uimanager.getTranslation("New folder")); |
618 |
putValue(Action.SMALL_ICON, uimanager.getIcon("folder-add")); |
|
639 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-folder-add"));
|
|
619 | 640 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("New folder")); |
620 | 641 |
putValue(ACTION_COMMAND_KEY, "FolderNew"); |
621 | 642 |
} |
... | ... | |
625 | 646 |
try { |
626 | 647 |
FolderNew(); |
627 | 648 |
} catch (Exception e1) { |
628 |
logger.warn("Can't create a new folder", e1);
|
|
649 |
LOGGER.warn("Can't create a new folder", e1);
|
|
629 | 650 |
} |
630 | 651 |
} |
631 | 652 |
|
... | ... | |
635 | 656 |
|
636 | 657 |
private static final long serialVersionUID = -3393464285985649074L; |
637 | 658 |
|
659 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
638 | 660 |
public ProjectEditAction() { |
639 | 661 |
super(uimanager.getTranslation("Edit")); |
640 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-edit")); |
|
662 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-edit"));
|
|
641 | 663 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Open_edition_mode")); |
642 | 664 |
putValue(ACTION_COMMAND_KEY, "DocumentEdit"); |
643 | 665 |
} |
... | ... | |
646 | 668 |
public void actionPerformed(ActionEvent e) { |
647 | 669 |
try { |
648 | 670 |
ScriptingUnit selectedItem = getLauncherSelectedScript(); |
649 |
if (selectedItem instanceof ScriptingBaseScript) {
|
|
650 |
scriptEdit((ScriptingBaseScript) selectedItem);
|
|
671 |
if( uimanager.hasEditor(selectedItem) ) {
|
|
672 |
scriptEdit(selectedItem); |
|
651 | 673 |
} |
652 | 674 |
} catch (Exception e1) { |
653 |
logger.warn("Can't edit document", e1);
|
|
675 |
LOGGER.warn("Can't edit document", e1);
|
|
654 | 676 |
} |
655 | 677 |
} |
656 | 678 |
} |
... | ... | |
659 | 681 |
|
660 | 682 |
private static final long serialVersionUID = 1944121660002532563L; |
661 | 683 |
|
684 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
662 | 685 |
public ProjectRefreshAction() { |
663 | 686 |
super(uimanager.getTranslation("Refresh")); |
664 |
putValue(Action.SMALL_ICON, uimanager.getIcon("refresh")); |
|
687 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-refresh"));
|
|
665 | 688 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Refresh_directories")); |
666 | 689 |
putValue(ACTION_COMMAND_KEY, "ProjectsRefresh"); |
667 | 690 |
} |
... | ... | |
677 | 700 |
|
678 | 701 |
private static final long serialVersionUID = 7469858242486966790L; |
679 | 702 |
|
703 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
680 | 704 |
public ProjectRenameAction() { |
681 | 705 |
super(uimanager.getTranslation("Rename")); |
682 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-rename")); |
|
706 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-rename"));
|
|
683 | 707 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Set_file_properties")); |
684 | 708 |
putValue(ACTION_COMMAND_KEY, "Rename"); |
685 | 709 |
} |
... | ... | |
689 | 713 |
try { |
690 | 714 |
scriptRename(getLauncherSelectedScript()); |
691 | 715 |
} catch (Exception e1) { |
692 |
logger.warn("Can't rename document", e1);
|
|
716 |
LOGGER.warn("Can't rename document", e1);
|
|
693 | 717 |
} |
694 | 718 |
} |
695 | 719 |
} |
... | ... | |
698 | 722 |
|
699 | 723 |
private static final long serialVersionUID = -8857101021126773295L; |
700 | 724 |
|
725 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
701 | 726 |
public ProjectMoveAction() { |
702 | 727 |
super(uimanager.getTranslation("Move")); |
703 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-move")); |
|
728 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-move"));
|
|
704 | 729 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Move_files")); |
705 | 730 |
putValue(ACTION_COMMAND_KEY, "Move"); |
706 | 731 |
} |
... | ... | |
710 | 735 |
try { |
711 | 736 |
scriptMove(getLauncherSelectedScript()); |
712 | 737 |
} catch (Exception e1) { |
713 |
logger.warn("Can't move document", e1);
|
|
738 |
LOGGER.warn("Can't move document", e1);
|
|
714 | 739 |
} |
715 | 740 |
} |
716 | 741 |
} |
... | ... | |
719 | 744 |
|
720 | 745 |
private static final long serialVersionUID = 9039455504757742743L; |
721 | 746 |
|
747 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
722 | 748 |
public ProjectDeleteAction() { |
723 | 749 |
super(uimanager.getTranslation("Delete")); |
724 |
putValue(Action.SMALL_ICON, uimanager.getIcon("doc-remove")); |
|
750 |
putValue(Action.SMALL_ICON, uimanager.getIcon("scripting-doc-remove"));
|
|
725 | 751 |
putValue(Action.SHORT_DESCRIPTION, uimanager.getTranslation("Delete_selected_script")); |
726 | 752 |
putValue(ACTION_COMMAND_KEY, "Delete"); |
727 | 753 |
} |
... | ... | |
731 | 757 |
try { |
732 | 758 |
scriptDelete(getLauncherSelectedScript(), false); |
733 | 759 |
} catch (Exception e1) { |
734 |
logger.warn("Can't delete document", e1);
|
|
760 |
LOGGER.warn("Can't delete document", e1);
|
|
735 | 761 |
} |
736 | 762 |
} |
737 | 763 |
} |
... | ... | |
872 | 898 |
public void stateChanged(ChangeEvent e) { |
873 | 899 |
updateMenusAndTools(); |
874 | 900 |
try { |
875 |
((ScriptEditor)((JTabbedPane)e.getSource()).getSelectedComponent()).getJTextComponent().requestFocusInWindow(); |
|
901 |
((ScriptUnitEditor)((JTabbedPane)e.getSource()).getSelectedComponent()).getJTextComponent().requestFocusInWindow();
|
|
876 | 902 |
} catch(Throwable th) { |
877 |
logger.debug("Can't set focus in the editor", th);
|
|
903 |
LOGGER.debug("Can't set focus in the editor", th);
|
|
878 | 904 |
} |
879 | 905 |
} |
880 | 906 |
}); |
... | ... | |
969 | 995 |
JMenuItem menu = menuBarHelper.add(entry.getText(), entry.getAction(), this); |
970 | 996 |
entry.setComponent(menu); |
971 | 997 |
} catch(Throwable th) { |
972 |
logger.warn("Can't add entry '"+entry.getName()+"' to the toolbar.", th);
|
|
998 |
LOGGER.warn("Can't add entry '"+entry.getName()+"' to the toolbar.", th);
|
|
973 | 999 |
} |
974 | 1000 |
} |
975 | 1001 |
|
... | ... | |
979 | 1005 |
this.toolBar.add(button); |
980 | 1006 |
entry.setComponent(button); |
981 | 1007 |
} catch(Throwable th) { |
982 |
logger.warn("Can't add entry '"+entry.getName()+"' to the toolbar.", th);
|
|
1008 |
LOGGER.warn("Can't add entry '"+entry.getName()+"' to the toolbar.", th);
|
|
983 | 1009 |
} |
984 | 1010 |
|
985 | 1011 |
} |
... | ... | |
1015 | 1041 |
scriptEdit(script); |
1016 | 1042 |
panel = getDock().get(id); |
1017 | 1043 |
if( panel == null ) { |
1018 |
logger.warn("Can't load script '"+id+"'.");
|
|
1044 |
LOGGER.warn("Can't load script '"+id+"'.");
|
|
1019 | 1045 |
return; |
1020 | 1046 |
} |
1021 | 1047 |
} |
... | ... | |
1067 | 1093 |
BrowserActionEvent e2 = (BrowserActionEvent) e; |
1068 | 1094 |
switch (e.getID()) { |
1069 | 1095 |
case JScriptingBrowser.DEFAULT_ACTION: |
1070 |
if( uimanager.hasEditor(e2.getUnit()) ) { |
|
1071 |
scriptEdit(e2.getUnit()); |
|
1096 |
ScriptingUnit unit = e2.getUnit(); |
|
1097 |
if( unit instanceof ScriptingFolder ) { |
|
1098 |
return; |
|
1072 | 1099 |
} |
1100 |
if( uimanager.hasEditor(unit) ) { |
|
1101 |
scriptEdit(unit); |
|
1102 |
} |
|
1073 | 1103 |
break; |
1074 | 1104 |
case JScriptingBrowser.DROPDOWN_ACTION: |
1075 | 1105 |
case JScriptingBrowser.SELECTION_ACTION: |
... | ... | |
1128 | 1158 |
this.changeEditorListeners.add(listener); |
1129 | 1159 |
} |
1130 | 1160 |
|
1161 |
@Override |
|
1131 | 1162 |
public void removeChangeEditorListener(ChangeListener listener) { |
1132 | 1163 |
if (this.changeEditorListeners == null) { |
1133 | 1164 |
return; |
... | ... | |
1503 | 1534 |
* Funci?n que ejecuta el ScriptingBaseScript de la pesta?a actual |
1504 | 1535 |
* |
1505 | 1536 |
*/ |
1537 |
@SuppressWarnings("UseSpecificCatch") |
|
1506 | 1538 |
public void currentScriptExecute() { |
1507 | 1539 |
ScriptingScript script = this.getCurrentScript(); |
1508 | 1540 |
if (script != null) { |
... | ... | |
1523 | 1555 |
script.compile(); |
1524 | 1556 |
script.runAsTask(null); |
1525 | 1557 |
} catch (Throwable e) { |
1526 |
logger.info("Can't execute script", e);
|
|
1558 |
LOGGER.info("Can't execute script", e);
|
|
1527 | 1559 |
} |
1528 | 1560 |
} |
1529 | 1561 |
} |
... | ... | |
1776 | 1808 |
private final Font fontNormal; |
1777 | 1809 |
private final Font fontBold; |
1778 | 1810 |
|
1811 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
1779 | 1812 |
public TabTitleComponent(String title, final ActionListener onclose) { |
1780 | 1813 |
this.setOpaque(true); |
1781 | 1814 |
this.label = new JLabel(title + " "); |
... | ... | |
1795 | 1828 |
this.button.setContentAreaFilled(false); |
1796 | 1829 |
this.button.setCursor(new Cursor(Cursor.HAND_CURSOR)); |
1797 | 1830 |
this.button.setRolloverEnabled(true); |
1798 |
this.button.setIcon(uimanager.getIcon("tabclose-inactive")); |
|
1799 |
this.button.setRolloverIcon(uimanager.getIcon("tabclose-active")); |
|
1831 |
this.button.setIcon(uimanager.getIcon("scripting-tabclose-inactive"));
|
|
1832 |
this.button.setRolloverIcon(uimanager.getIcon("scripting-tabclose-active"));
|
|
1800 | 1833 |
this.button.addActionListener(new ActionListener() { |
1801 | 1834 |
@Override |
1802 | 1835 |
public void actionPerformed(ActionEvent ae) { |
... | ... | |
1930 | 1963 |
} |
1931 | 1964 |
|
1932 | 1965 |
public DefaultProblem(String type, String message, String resourceName, String location, File resource) { |
1933 |
String[] row = new String[NUM_COLUMNS];
|
|
1934 |
row[COLUMN_TYPE] = type;
|
|
1935 |
row[COLUMN_MESSAGE] = message;
|
|
1936 |
row[COLUMN_RESOURCE] = resourceName;
|
|
1937 |
row[COLUMN_LOCATION] = location;
|
|
1966 |
String[] theRow = new String[NUM_COLUMNS];
|
|
1967 |
theRow[COLUMN_TYPE] = type;
|
|
1968 |
theRow[COLUMN_MESSAGE] = message;
|
|
1969 |
theRow[COLUMN_RESOURCE] = resourceName;
|
|
1970 |
theRow[COLUMN_LOCATION] = location;
|
|
1938 | 1971 |
this.resource = resource; |
1939 |
this.row = row;
|
|
1972 |
this.row = theRow;
|
|
1940 | 1973 |
} |
1941 | 1974 |
|
1942 | 1975 |
public String get(int index) { |
... | ... | |
1972 | 2005 |
} |
1973 | 2006 |
|
1974 | 2007 |
@Override |
2008 |
@SuppressWarnings("UseSpecificCatch") |
|
1975 | 2009 |
public int getLineNumber() { |
1976 | 2010 |
try { |
1977 | 2011 |
String[] lineAndColumn = this.row[COLUMN_LOCATION].split(":"); |
... | ... | |
2496 | 2530 |
|
2497 | 2531 |
private static final long serialVersionUID = -7434255417630073101L; |
2498 | 2532 |
|
2533 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
2499 | 2534 |
public ButtonWithContext(Action action) { |
2500 | 2535 |
super(action); |
2501 | 2536 |
this.setBorderPainted(false); |
Also available in: Unified diff