Lively Kernel canvas
Web-basedDevelopmentEnvironments201018nullnull
40nullnull
Widgets40nulltrue
-ModelViewPresenterPattern...-buildView28true1
truetrue
prevfalsenullfalsetrue
nextfalsenullfalsetrue
100015.526000105589599Wikicontroltrue
Widget.subclass('MyWidget',{initialize:function($super){$super();returnthis;},onDeserialize:function(){//dosomethingafterloading...},buildView:function(extent){this.panel=PanelMorph.makePanedPanel(extent,[['urlPane',TextMorph,newRectangle(0,0,0.8,0.1)],['loadButton',ButtonMorph,newRectangle(0.8,0,0.1,0.1)],['saveButton',ButtonMorph,newRectangle(0.9,0,0.1,0.1)],['textPane',TextMorph,newRectangle(0,0.1,1,0.9)]]);this.panel.urlPane.beInputLine();this.panel.urlPane.setBorderColor(null);this.panel.urlPane.suppressHandles=true;this.panel.textPane.suppressHandles=true;this.panel.ownerWidget=this;//toserializethewidgetthis.panel.loadButton.setLabel("load")this.panel.saveButton.setLabel("save")varurl="http://www.lively-kernel.org/repository/webwerkstatt/"+"ProjectSeminar2010/tutorial/test.txt"this.panel.urlPane.setTextString(url)connect(this.panel.loadButton,"fire",this,"onLoad")connect(this.panel.saveButton,"fire",this,"onSave")returnthis.panel;},getURL:function(){returnthis.panel.urlPane.textString},onLoad:function(){varr=newWebResource(this.getURL());if(r.forceUncached().exists()){WorldMorph.current().setStatusMessage("loaded"+this.getURL(),Color.green)this.panel.textPane.setTextString(r.getContent())}else{WorldMorph.current().setStatusMessage(""+this.getURL()+"doesnotexist",Color.red)}},onSave:function(){varr=newWebResource(this.getURL());r.setContent(this.panel.textPane.textString)WorldMorph.current().setStatusMessage("loaded"+this.getURL(),Color.green)},});newMyWidget().openIn(WorldMorph.current())20truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null81