Advertisement
marcopolorez

regex.ui.form.collapsePanel

Mar 22nd, 2016
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. qx.Class.define("regex.ui.form.collapsePanel", {
  2.  
  3.   extend : qx.ui.container.Composite,
  4.  
  5.   construct : function(form) {
  6.    
  7.     this.base(arguments, new qx.ui.layout.HBox(2));
  8.    
  9.     var vbox = new qx.ui.container.Composite(new qx.ui.layout.VBox(2));
  10.  
  11.     var button0 = new qx.ui.form.Button(null, "icon/16/actions/media-playback-start.png").set({
  12.       allowStretchX : false,
  13.       visibility : "excluded"
  14.     });
  15.    
  16.     var button1 = new qx.ui.form.Button(null, "icon/16/actions/media-playback-stop.png").set({
  17.       allowStretchX : false
  18.     });
  19.    
  20.     vbox.add(button1);
  21.     vbox.add(form, { flex : 1 });
  22.  
  23.     this.add(button0);
  24.     this.add(vbox);
  25.    
  26.     button0.addListener("execute", function(){
  27.       button0.setVisibility("excluded");
  28.       button1.setVisibility("visible");
  29.       form.setVisibility("visible");
  30.     });
  31.    
  32.     button1.addListener("execute", function(){
  33.       button0.setVisibility("visible");
  34.       button1.setVisibility("excluded");
  35.       form.setVisibility("excluded");
  36.     });
  37.    
  38.   }
  39.    
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement