- Timestamp:
- 03/05/10 12:43:33 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xul_Wsp/modules/scenariWsp/views/wspNavView/WspNavView.jsm
r15016 r15037 1688 1688 } 1689 1689 1690 /** 1691 * Déclarations des actions des cette view en svc. 1692 * Note : pOverwriteParent n'est forcé à true considérant que des surcharges de ces 1693 * actions devraient généralement être applicables dans toutes les sous-fenêtres (wspDesk, selItem...) 1694 * Dans le cas contraire, il faudra les redéclarer (ces actions sont accessibles une 1695 * fois ce module importé: WspNavView.actionCut...) 1696 */ 1690 1697 function initDefaultActions(pWindow) { 1691 pWindow.extPoints.registerSvcByInst("wspNavView.actionCut", 1, actionCut);1692 pWindow.extPoints.registerSvcByInst("wspNavView.actionPaste", 1, actionPaste);1693 pWindow.extPoints.registerSvcByInst("wspNavView.actionDelete", 1, actionDelete);1694 pWindow.extPoints.registerSvcByInst("wspNavView.actionRename", 1, actionRename);1695 pWindow.extPoints.registerSvcByInst("wspNavView.actionCreateItem", 1, actionCreateItem);1696 pWindow.extPoints.registerSvcByInst("wspNavView.actionCreateSpace", 1, actionCreateSpace);1698 pWindow.extPoints.registerSvcByInst("wspNavView.actionCut", 1, WspNavView.actionCut, false); 1699 pWindow.extPoints.registerSvcByInst("wspNavView.actionPaste", 1, WspNavView.actionPaste, false); 1700 pWindow.extPoints.registerSvcByInst("wspNavView.actionDelete", 1, WspNavView.actionDelete, false); 1701 pWindow.extPoints.registerSvcByInst("wspNavView.actionRename", 1, WspNavView.actionRename, false); 1702 pWindow.extPoints.registerSvcByInst("wspNavView.actionCreateItem", 1, WspNavView.actionCreateItem, false); 1703 pWindow.extPoints.registerSvcByInst("wspNavView.actionCreateSpace", 1, WspNavView.actionCreateSpace, false); 1697 1704 } 1698 1705 … … 1719 1726 * ActionContext : scWsp, fullUri, viewMgr 1720 1727 */ 1721 varactionCreateItem = new actions.Action("actionCreateItem").setGroup("uriCreate").setLabel("Créer un item...");1722 actionCreateItem.isVisible = function(pContext){1728 WspNavView.actionCreateItem = new actions.Action("actionCreateItem").setGroup("uriCreate").setLabel("Créer un item..."); 1729 WspNavView.actionCreateItem.isVisible = function(pContext){ 1723 1730 //Le fullUri doit être dans un espace (SrcUri != "") car pas de création d'item à la racine. 1724 1731 return pContext.scWsp && pContext.fullUri && wsp.extractSrcUriFromFullUri(pContext.fullUri) && ! pContext.viewMgr.isReadOnly(); 1725 1732 } 1726 actionCreateItem.execute = function(pEvent, pContext){1733 WspNavView.actionCreateItem.execute = function(pEvent, pContext){ 1727 1734 var vViewMgr = pContext.viewMgr; 1728 1735 function cb(pDataProvider, pFullUri) { … … 1737 1744 * ActionContext : scWsp, fullUri, viewMgr 1738 1745 */ 1739 varactionCreateSpace = new actions.Action("actionCreateSpace").setGroup("uriCreate").setLabel("Créer un espace...");1740 actionCreateSpace.isVisible = function(pContext){1746 WspNavView.actionCreateSpace = new actions.Action("actionCreateSpace").setGroup("uriCreate").setLabel("Créer un espace..."); 1747 WspNavView.actionCreateSpace.isVisible = function(pContext){ 1741 1748 //Cette action n'est visible que si on est sur un espace ou à la racine de l'atelier. 1742 1749 return pContext.scWsp && pContext.fullUri && ! pContext.viewMgr.isReadOnly(); // && ! item.extractCodeFromFullUri(pContext.fullUri); 1743 1750 } 1744 actionCreateSpace.execute = function(pEvent, pContext){1751 WspNavView.actionCreateSpace.execute = function(pEvent, pContext){ 1745 1752 var vViewMgr = pContext.viewMgr; 1746 1753 function cb(pDataProvider, pFullUri) { … … 1754 1761 * ActionContext : shortDesc, viewMgr 1755 1762 */ 1756 varactionCut = new actions.Action("actionCut").setGroup("uriCopyPaste").setLabel("Couper");1757 actionCut.isVisible = function(pContext){1763 WspNavView.actionCut = new actions.Action("actionCut").setGroup("uriCopyPaste").setLabel("Couper"); 1764 WspNavView.actionCut.isVisible = function(pContext){ 1758 1765 return pContext.shortDesc != null && ! pContext.viewMgr.isReadOnly(); 1759 1766 } 1760 actionCut.execute = function(pEvent, pContext){1767 WspNavView.actionCut.execute = function(pEvent, pContext){ 1761 1768 try{ 1762 1769 var vViewMgr = pContext.viewMgr; … … 1799 1806 * ActionContext : shortDesc, viewMgr 1800 1807 */ 1801 varactionPaste = new actions.Action("actionPaste").setGroup("uriCopyPaste").setLabel("Coller");1802 actionPaste.isVisible = function(pContext){1808 WspNavView.actionPaste = new actions.Action("actionPaste").setGroup("uriCopyPaste").setLabel("Coller"); 1809 WspNavView.actionPaste.isVisible = function(pContext){ 1803 1810 return ! pContext.viewMgr.isReadOnly(); 1804 1811 } 1805 actionPaste.isEnabled = function(pContext){1812 WspNavView.actionPaste.isEnabled = function(pContext){ 1806 1813 return transf.isClipboardContainFileOrScenariUri() || 1807 1814 (pContext.viewMgr.fExtItemsMimeTypeAllowed && transf.isClipboardContainMimeType(pContext.viewMgr.fExtItemsMimeTypeAllowed)); 1808 1815 } 1809 actionPaste.execute = function(pEvent, pContext){1816 WspNavView.actionPaste.execute = function(pEvent, pContext){ 1810 1817 try{ 1811 1818 var vViewMgr = pContext.viewMgr; … … 1932 1939 * ActionContext : fullUri, viewMgr 1933 1940 */ 1934 varactionDelete = new actions.Action("actionDelete").setGroup("uriEdit").setLabel("Supprimer");1935 actionDelete.isVisible = function(pContext){1941 WspNavView.actionDelete = new actions.Action("actionDelete").setGroup("uriEdit").setLabel("Supprimer"); 1942 WspNavView.actionDelete.isVisible = function(pContext){ 1936 1943 return ! pContext.viewMgr.isReadOnly(); 1937 1944 } 1938 actionDelete.execute = function(pEvent, pContext){1945 WspNavView.actionDelete.execute = function(pEvent, pContext){ 1939 1946 var vViewMgr = pContext.viewMgr; 1940 1947 if(! vViewMgr.fWindow.desk.saveAll(vViewMgr.fCdWsp)) return; … … 1968 1975 * ActionContext : fullUri, viewMgr 1969 1976 */ 1970 varactionRename = new actions.Action("actionRename").setGroup("uriEdit").setLabel("Renommer...");1971 actionRename.isVisible = function(pContext){1977 WspNavView.actionRename = new actions.Action("actionRename").setGroup("uriEdit").setLabel("Renommer..."); 1978 WspNavView.actionRename.isVisible = function(pContext){ 1972 1979 return ! pContext.viewMgr.isReadOnly(); 1973 1980 } 1974 actionRename.execute = function(pEvent, pContext){1981 WspNavView.actionRename.execute = function(pEvent, pContext){ 1975 1982 var vViewMgr = pContext.viewMgr; 1976 1983 if(! vViewMgr.fWindow.desk.saveAll(vViewMgr.fCdWsp)) return;
Note: See TracChangeset
for help on using the changeset viewer.