コード例 #1
0
  @Override
  public void fillForm(GenotypeResultParser p, OrganismDefinition od, final File jobDir) {
    WListContainerWidget ul = new WListContainerWidget(this);
    WContainerWidget li;
    li = ul.addItem(new WText(tr("defaultSignalAnalysis.signalValue")));
    li.addWidget(
        new WText(
            GenotypeLib.getEscapedValue(
                p, "/genotype_result/sequence/result[@id='pure-puzzle']/signal")));
    li = ul.addItem(new WText(tr("defaultSignalAnalysis.signalComment")));
    final String puzzleFile =
        p.getValue("/genotype_result/sequence/result[@id='pure-puzzle']/puzzle");

    addWidget(
        GenotypeLib.getWImageFromResource(
            new WFileResource("image/png", "") {
              @Override
              public void handleRequest(WebRequest request, WebResponse response) {
                if (getFileName().isEmpty()) {
                  File file = GenotypeLib.getSignalPNG(GenotypeLib.getFile(jobDir, puzzleFile));
                  setFileName(file.getAbsolutePath());
                }

                super.handleRequest(request, response);
              }
            }));
  }
コード例 #2
0
 /**
  * Shows or hides the title bar for the panel.
  *
  * <p>The title bar appears at the top of the panel.
  *
  * <p>The default value is <code>false:</code> the title bar is not shown unless a title is set or
  * the panel is made collapsible.
  *
  * <p>
  *
  * @see WPanel#setTitle(CharSequence title)
  * @see WPanel#setCollapsible(boolean on)
  */
 public void setTitleBar(boolean enable) {
   if (enable && !(this.getTitleBarWidget() != null)) {
     WContainerWidget titleBar = new WContainerWidget();
     this.impl_.bindWidget("titlebar", titleBar);
     titleBar.setStyleClass("titlebar");
     WBreak br;
     titleBar.addWidget(br = new WBreak());
     br.setClearSides(Side.Horizontals);
   } else {
     if (!enable && this.isTitleBar()) {
       this.impl_.bindWidget("titlebar", (WWidget) null);
       this.title_ = null;
       this.collapseIcon_ = null;
     }
   }
 }
コード例 #3
0
ファイル: PanelList.java プロジェクト: sebap/jwt
  public void addPanel(final WPanel panel) {
    panel.setCollapsible(true);
    panel.collapse();

    panel
        .expanded()
        .addListener(
            this,
            new Signal.Listener() {
              public void trigger() {
                onExpand(true, panel);
              }
            });

    panel
        .collapsed()
        .addListener(
            this,
            new Signal.Listener() {
              public void trigger() {
                onExpand(false, panel);
              }
            });

    super.addWidget(panel);
  }
コード例 #4
0
 /** Creates a panel. */
 public WPanel(WContainerWidget parent) {
   super(parent);
   this.collapseIcon_ = null;
   this.title_ = null;
   this.centralWidget_ = null;
   this.animation_ = new WAnimation();
   this.collapsed_ = new Signal(this);
   this.expanded_ = new Signal(this);
   this.collapsedSS_ = new Signal1<Boolean>(this);
   this.expandedSS_ = new Signal1<Boolean>(this);
   String TEMPLATE = "${shadow-x1-x2}${titlebar}${contents}";
   this.setImplementation(this.impl_ = new WTemplate(new WString(TEMPLATE)));
   this.impl_.setStyleClass("Wt-panel Wt-outset");
   // this.implementStateless(WPanel.doExpand,WPanel.undoExpand);
   // this.implementStateless(WPanel.doCollapse,WPanel.undoCollapse);
   WContainerWidget centralArea = new WContainerWidget();
   centralArea.setStyleClass("body");
   this.impl_.bindString("shadow-x1-x2", WTemplate.DropShadow_x1_x2);
   this.impl_.bindWidget("titlebar", (WWidget) null);
   this.impl_.bindWidget("contents", centralArea);
   this.setJavaScriptMember(
       WT_RESIZE_JS,
       "function(self, w, h) {self.style.height= h + 'px';if (Wt3_2_2.boxSizing(self)) {h -= Wt3_2_2.px(self, 'borderTopWidth') + Wt3_2_2.px(self, 'borderBottomWidth');}var c = self.lastChild;var t = c.previousSibling;if (t.className == 'titlebar')h -= t.offsetHeight;h -= 8;if (h > 0) {c.style.height = h + 'px';$(c).children().each(function() { var self = $(this), padding = self.outerHeight() - self.height();self.height(h - padding);});}};");
 }