Index: lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceDialog.as =================================================================== diff -u -r013ffab327d1ae71d19c5fca8558145955d156d7 -r38cd9b8499ebe7e8dce1607c63af6c3f536f9608 --- lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceDialog.as (.../WorkspaceDialog.as) (revision 013ffab327d1ae71d19c5fca8558145955d156d7) +++ lams_common/src/flash/org/lamsfoundation/lams/common/ws/WorkspaceDialog.as (.../WorkspaceDialog.as) (revision 38cd9b8499ebe7e8dce1607c63af6c3f536f9608) @@ -36,6 +36,7 @@ private var copy_btn:Button; private var paste_btn:Button; private var delete_btn:Button; + private var rename_btn:Button; //properties @@ -111,6 +112,9 @@ ok_btn.label = Dictionary.getValue('ws_dlg_ok_button'); cancel_btn.label = Dictionary.getValue('ws_dlg_cancel_button'); + //TODO: Dictionary calls for all the rest of the buttons + + //get focus manager + set focus to OK button, focus manager is available to all components through getFocusManager fm = _container.getFocusManager(); @@ -173,6 +177,7 @@ copy_btn.addEventListener('click',Delegate.create(_workspaceController, _workspaceController.fileOperationRequest)); paste_btn.addEventListener('click',Delegate.create(_workspaceController, _workspaceController.fileOperationRequest)); delete_btn.addEventListener('click',Delegate.create(_workspaceController, _workspaceController.fileOperationRequest)); + rename_btn.addEventListener('click',Delegate.create(_workspaceController, _workspaceController.fileOperationRequest)); //Set up the treeview @@ -310,7 +315,7 @@ //_global.breakpoint(); //Only update the details if the node if its a resource:a var nodeData = newSelectedNode.attributes.data; - if(nodeData.resourceType == "Folder"){ + if(nodeData.resourceType == _workspaceModel.RT_FOLDER){ resourceTitle_txi.text = ""; resourceDesc_txa.text = ""; @@ -340,6 +345,7 @@ copy_btn.visible = v; paste_btn.visible = v; delete_btn.visible = v; + rename_btn.visible = v; @@ -481,11 +487,11 @@ Debugger.log('_workspaceModel.currentMode: ' + _workspaceModel.currentMode,Debugger.GEN,'setStyles','org.lamsfoundation.lams.WorkspaceDialog'); if(_workspaceModel.currentMode=="SAVE" || _workspaceModel.currentMode=="SAVEAS"){ //var rid:Number = Number(snode.attributes.data.resourceID); - if(snode.attributes.data.resourceType=="LearningDesign"){ + if(snode.attributes.data.resourceType==_workspaceModel.RT_LD){ //run a confirm dialogue as user is about to overwrite a design! LFMessage.showMessageConfirm("LOOKOUT ABOUT TO OVERWRITE A RESOURCE!", Proxy.create(this,doWorkspaceDispatch,true), Proxy.create(this,closeThisDialogue)); - }else if (snode.attributes.data.resourceType=="Folder"){ + }else if (snode.attributes.data.resourceType==_workspaceModel.RT_FOLDER){ doWorkspaceDispatch(false); }else{ LFMessage.showMessageAlert("__Please click on either a Folder to save in, or a Design to overwrite__",null);